diff --git a/Minecraft.Client/Platform/Common/App_Defines.h b/Minecraft.Client/Common/App_Defines.h similarity index 100% rename from Minecraft.Client/Platform/Common/App_Defines.h rename to Minecraft.Client/Common/App_Defines.h diff --git a/Minecraft.Client/Platform/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h similarity index 100% rename from Minecraft.Client/Platform/Common/App_enums.h rename to Minecraft.Client/Common/App_enums.h diff --git a/Minecraft.Client/Platform/Common/App_structs.h b/Minecraft.Client/Common/App_structs.h similarity index 100% rename from Minecraft.Client/Platform/Common/App_structs.h rename to Minecraft.Client/Common/App_structs.h diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/Consoles_App.cpp rename to Minecraft.Client/Common/Consoles_App.cpp index e6ea0b3c5..0a3f7b4d0 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1,67 +1,67 @@ -#include "../Minecraft.World/Platform/stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" -#include "../Minecraft.World/Recipes/Recipy.h" -#include "../Minecraft.Client/GameState/Options.h" -#include "../Minecraft.World/Util/AABB.h" -#include "../Minecraft.World/Util/Vec3.h" -#include "../Minecraft.Client/MinecraftServer.h" -#include "../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../Minecraft.Client/Rendering/GameRenderer.h" -#include "../Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h" -#include "../Minecraft.Client/Rendering/LevelRenderer.h" -#include "../Minecraft.Client/Textures/MobSkinMemTextureProcessor.h" -#include "../Minecraft.Client/Minecraft.h" -#include "../Minecraft.Client/Network/ClientConnection.h" -#include "../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../Minecraft.Client/Player/LocalPlayer.h" -#include "../Minecraft.World/Player/Player.h" -#include "../Minecraft.World/Containers/Inventory.h" -#include "../Minecraft.World/Level/Level.h" -#include "../Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h" -#include "../Minecraft.World/Containers/Container.h" -#include "../Minecraft.World/Blocks/TileEntities/DispenserTileEntity.h" -#include "../Minecraft.World/Blocks/TileEntities/SignTileEntity.h" -#include "../Minecraft.World/Blocks/TileEntities/HopperTileEntity.h" -#include "../Minecraft.World/Util/PathHelper.h" -#include "../Minecraft.Client/GameState/StatsCounter.h" -#include "../Minecraft.Client/GameState/GameMode.h" -#include "../Minecraft.Client/Platform/Windows64/Social/SocialManager.h" -#include "Tutorial/TutorialMode.h" +#include "../../Minecraft.World/net/minecraft/world/item/crafting/Recipy.h" +#include "../net/minecraft/client/Options.h" +#include "../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../Minecraft.World/net/minecraft/world/phys/Vec3.h" +#include "../net/minecraft/server/MinecraftServer.h" +#include "../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../net/minecraft/client/renderer/GameRenderer.h" +#include "../net/minecraft/client/ProgressRenderer.h" +#include "../net/minecraft/client/renderer/LevelRenderer.h" +#include "../Header Files/MobSkinMemTextureProcessor.h" +#include "../net/minecraft/client/Minecraft.h" +#include "../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../net/minecraft/client/player/LocalPlayer.h" +#include "../../Minecraft.World/net/minecraft/world/entity/player/Player.h" +#include "../../Minecraft.World/net/minecraft/world/entity/player/Inventory.h" +#include "../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h" +#include "../../Minecraft.World/net/minecraft/world/Container.h" +#include "../../Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h" +#include "../../Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.h" +#include "../../Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h" +#include "../../Minecraft.World/Header Files/PathHelper.h" +#include "../net/minecraft/stats/StatsCounter.h" +#include "../net/minecraft/server/level/GameMode.h" +#include "../Windows64/Source Files/Social/SocialManager.h" +#include "Source Files/Tutorial/TutorialMode.h" #if defined(_WINDOWS64) -#include "../Minecraft.Client/Platform/Common/XML/ATGXmlParser.h" -#include "../Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h" +#include "../Windows64/XML/ATGXmlParser.h" +#include "../Windows64/XML/xmlFilesCallback.h" #endif #include "Minecraft_Macros.h" -#include "../Minecraft.Client/Network/PlayerList.h" -#include "../Minecraft.Client/Player/ServerPlayer.h" -#include "GameRules/ConsoleGameRules.h" -#include "GameRules/ConsoleSchematicFile.h" -#include "../Minecraft.World/IO/Streams/InputOutputStream.h" -#include "../Minecraft.World/Level/Storage/LevelSettings.h" -#include "../Minecraft.Client/Player/User.h" +#include "../net/minecraft/server/PlayerList.h" +#include "../net/minecraft/server/level/ServerPlayer.h" +#include "Source Files/GameRules/ConsoleGameRules.h" +#include "Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h" +#include "../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../Minecraft.World/net/minecraft/world/level/LevelSettings.h" +#include "../net/minecraft/client/User.h" #include -#include "../Minecraft.World/Level/LevelData.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../Minecraft.World/IO/Streams/Compression.h" -#include "../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../Minecraft.Client/Textures/Packs/DLCTexturePack.h" -#include "DLC/DLCPack.h" -#include "../Minecraft.Client/Utils/StringTable.h" -#include "../Minecraft.Client/Utils/ArchiveFile.h" -#include "../Minecraft.Client/Minecraft.h" +#include "../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" +#include "../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../net/minecraft/client/renderer/entity/EntityRenderDispatcher.h" +#include "../../Minecraft.World/Header Files/compression.h" +#include "../net/minecraft/client/skins/TexturePackRepository.h" +#include "../net/minecraft/client/skins/DLCTexturePack.h" +#include "Source Files/DLC/DLCPack.h" +#include "Source Files/Localisation/StringTable.h" +#include "Source Files/UI/All Platforms/ArchiveFile.h" +#include "../net/minecraft/client/Minecraft.h" #if defined(__linux__) #include #include #endif -#include "UI/UI.h" -#include "UI/UIScene_PauseMenu.h" +#include "Source Files/UI/UI.h" +#include "Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h" #include #include -#include "Leaderboards/LeaderboardManager.h" +#include "Source Files/Leaderboards/LeaderboardManager.h" // CMinecraftApp app; unsigned int CMinecraftApp::m_uiLastSignInData = 0; diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h similarity index 98% rename from Minecraft.Client/Platform/Common/Consoles_App.h rename to Minecraft.Client/Common/Consoles_App.h index 9263ac5b2..30e05aab9 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -5,26 +5,26 @@ // using namespace std; -#include "Audio/Consoles_SoundEngine.h" +#include "Source Files/Audio/Consoles_SoundEngine.h" #if !defined(__linux__) #include #endif -#include "Tutorial/TutorialEnum.h" +#include "Source Files/Tutorial/TutorialEnum.h" -#include "UI/UIStructs.h" +#include "Source Files/UI/All Platforms/UIStructs.h" -#include "../Minecraft.World/Network/Packets/DisconnectPacket.h" +#include "../../Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h" #if !defined(__linux__) #include #endif -#include "../Minecraft.Client/Utils/StringTable.h" -#include "DLC/DLCManager.h" -#include "GameRules/ConsoleGameRulesConstants.h" -#include "GameRules/GameRuleManager.h" -#include "../Minecraft.Client/Rendering/Models/SkinBox.h" -#include "../Minecraft.Client/Utils/ArchiveFile.h" -#include "../Minecraft.World/Entities/MinecartHopper.h" +#include "Source Files/Localisation/StringTable.h" +#include "Source Files/DLC/DLCManager.h" +#include "Source Files/GameRules/ConsoleGameRulesConstants.h" +#include "Source Files/GameRules/GameRuleManager.h" +#include "../Header Files/SkinBox.h" +#include "Source Files/UI/All Platforms/ArchiveFile.h" +#include "../../Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.h" typedef struct _JoinFromInviteData { std::uint32_t dwUserIndex; // dwUserIndex diff --git a/Minecraft.Client/Platform/Windows64/Minecraft_Macros.h b/Minecraft.Client/Common/Minecraft_Macros.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Minecraft_Macros.h rename to Minecraft.Client/Common/Minecraft_Macros.h diff --git a/Minecraft.Client/Platform/Common/Potion_Macros.h b/Minecraft.Client/Common/Potion_Macros.h similarity index 100% rename from Minecraft.Client/Platform/Common/Potion_Macros.h rename to Minecraft.Client/Common/Potion_Macros.h diff --git a/Minecraft.Client/Platform/Common/ShutdownManager.h b/Minecraft.Client/Common/ShutdownManager.h similarity index 95% rename from Minecraft.Client/Platform/Common/ShutdownManager.h rename to Minecraft.Client/Common/ShutdownManager.h index 3e672c037..0153b511f 100644 --- a/Minecraft.Client/Platform/Common/ShutdownManager.h +++ b/Minecraft.Client/Common/ShutdownManager.h @@ -6,7 +6,7 @@ #include #include -#include "../../../Minecraft.World/Util/C4JThread.h" +#include "../../Minecraft.World/ConsoleHelpers/C4JThread.h" class ShutdownManager { public: diff --git a/Minecraft.Client/Platform/Common/Audio/Consoles_SoundEngine.cpp b/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/Audio/Consoles_SoundEngine.cpp rename to Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.cpp index 900ec6dc3..708cee3d6 100644 --- a/Minecraft.Client/Platform/Common/Audio/Consoles_SoundEngine.cpp +++ b/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Consoles_SoundEngine.h" bool ConsoleSoundEngine::GetIsPlayingStreamingCDMusic() { diff --git a/Minecraft.Client/Platform/Common/Audio/Consoles_SoundEngine.h b/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h similarity index 93% rename from Minecraft.Client/Platform/Common/Audio/Consoles_SoundEngine.h rename to Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h index 6d25da9b5..b2abab2f8 100644 --- a/Minecraft.Client/Platform/Common/Audio/Consoles_SoundEngine.h +++ b/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h @@ -1,12 +1,12 @@ #pragma once -#include "../../Minecraft.World/Util/SoundTypes.h" +#include "../../../../Minecraft.World/Header Files/SoundTypes.h" #ifdef _WINDOWS64 -#include "../../windows64/Miles/include/mss.h" +#include "../../../Windows64/Miles Sound System/Include/mss.h" #else // Linux currently uses the Windows64 Miles headers as the compatible host SDK. -#include "../../Minecraft.Client/Platform/Windows64/Miles/include/mss.h" +#include "../../../Windows64/Miles Sound System/Include/mss.h" #endif typedef struct { diff --git a/Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp rename to Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp index 29e246508..f5a13942d 100644 --- a/Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "SoundEngine.h" -#include "../../Minecraft.World/Util/PathHelper.h" -#include "../Consoles_App.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Level/LevelData.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" +#include "../../../../Minecraft.World/Header Files/PathHelper.h" +#include "../../Consoles_App.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" +#include "../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../net/minecraft/client/skins/DLCTexturePack.h" #include "../DLC/DLCAudioFile.h" #if defined(__linux__) @@ -33,7 +33,7 @@ int strcasecmp(const char* a, const char* b) { #include "stb_vorbis.c" #endif #if defined(_WINDOWS64) -#include "../../Minecraft.Client/Platform/Windows64/Windows64_App.h" +#include "../../../Windows64/Windows64_App.h" #include "../../Minecraft.Client/Platform/Windows64/Miles/include/imssapi.h" #endif diff --git a/Minecraft.Client/Platform/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Source Files/Audio/SoundEngine.h similarity index 98% rename from Minecraft.Client/Platform/Common/Audio/SoundEngine.h rename to Minecraft.Client/Common/Source Files/Audio/SoundEngine.h index 558131447..65f6606d8 100644 --- a/Minecraft.Client/Platform/Common/Audio/SoundEngine.h +++ b/Minecraft.Client/Common/Source Files/Audio/SoundEngine.h @@ -2,7 +2,7 @@ class Mob; class Options; using namespace std; -#include "../../Minecraft.World/Util/SoundTypes.h" +#include "../../../../Minecraft.World/Header Files/SoundTypes.h" #include "./miniaudio.h" constexpr float SFX_3D_MIN_DISTANCE = 1.0f; constexpr float SFX_3D_MAX_DISTANCE = 16.0f; diff --git a/Minecraft.Client/Platform/Common/Audio/SoundNames.cpp b/Minecraft.Client/Common/Source Files/Audio/SoundNames.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/Audio/SoundNames.cpp rename to Minecraft.Client/Common/Source Files/Audio/SoundNames.cpp index 867716afb..e04bbf71f 100644 --- a/Minecraft.Client/Platform/Common/Audio/SoundNames.cpp +++ b/Minecraft.Client/Common/Source Files/Audio/SoundNames.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Consoles_SoundEngine.h" diff --git a/Minecraft.Client/Platform/Common/BuildVer.h b/Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h similarity index 100% rename from Minecraft.Client/Platform/Common/BuildVer.h rename to Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h diff --git a/Minecraft.Client/Platform/Common/Colours/ColourTable.cpp b/Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/Colours/ColourTable.cpp rename to Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp index 04cfb7fbd..ede383611 100644 --- a/Minecraft.Client/Platform/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "ColourTable.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" std::unordered_map ColourTable::s_colourNamesMap; diff --git a/Minecraft.Client/Platform/Common/Colours/ColourTable.h b/Minecraft.Client/Common/Source Files/Colours/ColourTable.h similarity index 100% rename from Minecraft.Client/Platform/Common/Colours/ColourTable.h rename to Minecraft.Client/Common/Source Files/Colours/ColourTable.h diff --git a/Minecraft.Client/Platform/Common/ConsoleGameMode.cpp b/Minecraft.Client/Common/Source Files/ConsoleGameMode.cpp similarity index 82% rename from Minecraft.Client/Platform/Common/ConsoleGameMode.cpp rename to Minecraft.Client/Common/Source Files/ConsoleGameMode.cpp index d4c2c7f3c..c571751b4 100644 --- a/Minecraft.Client/Platform/Common/ConsoleGameMode.cpp +++ b/Minecraft.Client/Common/Source Files/ConsoleGameMode.cpp @@ -1,4 +1,4 @@ -#include "../Minecraft.World/Platform/stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #include "ConsoleGameMode.h" #include "Tutorial/Tutorial.h" diff --git a/Minecraft.Client/Platform/Common/ConsoleGameMode.h b/Minecraft.Client/Common/Source Files/ConsoleGameMode.h similarity index 100% rename from Minecraft.Client/Platform/Common/ConsoleGameMode.h rename to Minecraft.Client/Common/Source Files/ConsoleGameMode.h diff --git a/Minecraft.Client/Platform/Common/Console_Awards_enum.h b/Minecraft.Client/Common/Source Files/Console_Awards_enum.h similarity index 100% rename from Minecraft.Client/Platform/Common/Console_Awards_enum.h rename to Minecraft.Client/Common/Source Files/Console_Awards_enum.h diff --git a/Minecraft.Client/Platform/Common/Console_Debug_enum.h b/Minecraft.Client/Common/Source Files/Console_Debug_enum.h similarity index 100% rename from Minecraft.Client/Platform/Common/Console_Debug_enum.h rename to Minecraft.Client/Common/Source Files/Console_Debug_enum.h diff --git a/Minecraft.Client/Platform/Common/Console_Utils.cpp b/Minecraft.Client/Common/Source Files/Console_Utils.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/Console_Utils.cpp rename to Minecraft.Client/Common/Source Files/Console_Utils.cpp index 715a2fd2b..8576bb21a 100644 --- a/Minecraft.Client/Platform/Common/Console_Utils.cpp +++ b/Minecraft.Client/Common/Source Files/Console_Utils.cpp @@ -1,4 +1,4 @@ -#include "../Minecraft.World/Platform/stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #define CDECL diff --git a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCAudioFile.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCAudioFile.cpp index 51d9fdf09..cbd55daf2 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCAudioFile.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include #include #include #include "DLCManager.h" #include "DLCAudioFile.h" #if defined(_WINDOWS64) -#include "../../Minecraft.Client/Platform/Common/XML/ATGXmlParser.h" -#include "../../Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h" +#include "../../../Windows64/XML/ATGXmlParser.h" +#include "../../../Windows64/XML/xmlFilesCallback.h" #endif namespace { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCAudioFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCAudioFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCAudioFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCCapeFile.cpp similarity index 82% rename from Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCCapeFile.cpp index 151d1176b..0d93b82a4 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCCapeFile.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCCapeFile.h" diff --git a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCCapeFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCCapeFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCColourTableFile.cpp similarity index 73% rename from Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCColourTableFile.cpp index 2c0ce4980..ddb7b7854 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCColourTableFile.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCColourTableFile.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" +#include "../../../net/minecraft/client/Minecraft.h" +#include "../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../net/minecraft/client/skins/TexturePack.h" DLCColourTableFile::DLCColourTableFile(const std::wstring& path) : DLCFile(DLCManager::e_DLCType_ColourTable, path) { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCColourTableFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCColourTableFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCFile.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/DLC/DLCFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCFile.cpp index 0732416ad..9f9091f05 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCFile.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCFile.h" DLCFile::DLCFile(DLCManager::EDLCType type, const std::wstring& path) { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRules.h b/Minecraft.Client/Common/Source Files/DLC/DLCGameRules.h similarity index 74% rename from Minecraft.Client/Platform/Common/DLC/DLCGameRules.h rename to Minecraft.Client/Common/Source Files/DLC/DLCGameRules.h index 05ad1d783..0da3d4b7b 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRules.h +++ b/Minecraft.Client/Common/Source Files/DLC/DLCGameRules.h @@ -1,7 +1,7 @@ #pragma once #include "DLCFile.h" -#include "../GameRules/LevelGenerationOptions.h" +#include "../GameRules/LevelGeneration/LevelGenerationOptions.h" class DLCGameRules : public DLCFile { public: diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesFile.cpp similarity index 88% rename from Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCGameRulesFile.cpp index 9c1aa397b..7791dc86f 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesFile.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCGameRulesFile.h" diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCGameRulesFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp similarity index 77% rename from Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp index 9fdf31ff0..28685e7ef 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include -#include "../../Minecraft.World/IO/Files/File.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/IO/Streams/InputOutputStream.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "DLCManager.h" #include "DLCGameRulesHeader.h" diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.h similarity index 96% rename from Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h rename to Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.h index ddf766d00..e080e2baf 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h +++ b/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.h @@ -1,7 +1,7 @@ #pragma once #include "DLCGameRules.h" -#include "../GameRules/LevelGenerationOptions.h" +#include "../GameRules/LevelGeneration/LevelGenerationOptions.h" class DLCGameRulesHeader : public DLCGameRules, public JustGrSource { private: diff --git a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCLocalisationFile.cpp similarity index 78% rename from Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCLocalisationFile.cpp index 8c835e553..b241ec5c2 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCLocalisationFile.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCLocalisationFile.h" -#include "../../Minecraft.Client/Utils/StringTable.h" +#include "../Localisation/StringTable.h" DLCLocalisationFile::DLCLocalisationFile(const std::wstring& path) : DLCFile(DLCManager::e_DLCType_LocalisationData, path) { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCLocalisationFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCLocalisationFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCManager.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/DLC/DLCManager.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCManager.cpp index 00b7e0c7b..7cc9b746b 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCManager.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include #include "DLCManager.h" #include "DLCPack.h" #include "DLCFile.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/PortableFileIO.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../Minecraft.World/Header Files/PortableFileIO.h" +#include "../../../net/minecraft/client/Minecraft.h" +#include "../../../net/minecraft/client/skins/TexturePackRepository.h" #include #include #include diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.h b/Minecraft.Client/Common/Source Files/DLC/DLCManager.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCManager.h rename to Minecraft.Client/Common/Source Files/DLC/DLCManager.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCPack.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/DLC/DLCPack.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCPack.cpp index 790eddab8..6a22c9b38 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCPack.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCPack.h" #include "DLCSkinFile.h" #include "DLCCapeFile.h" @@ -9,7 +9,7 @@ #include "DLCGameRulesHeader.h" #include "DLCAudioFile.h" #include "DLCColourTableFile.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" DLCPack::DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask) { m_dataPath = L""; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.h b/Minecraft.Client/Common/Source Files/DLC/DLCPack.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCPack.h rename to Minecraft.Client/Common/Source Files/DLC/DLCPack.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.cpp index 1f55c3357..727e05bb2 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCSkinFile.h" -#include "../../Minecraft.Client/Rendering/Models/ModelPart.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Minecraft.World/Player/Player.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../net/minecraft/client/model/geom/ModelPart.h" +#include "../../../net/minecraft/client/renderer/entity/EntityRenderer.h" +#include "../../../net/minecraft/client/renderer/entity/EntityRenderDispatcher.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/player/Player.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" DLCSkinFile::DLCSkinFile(const std::wstring& path) : DLCFile(DLCManager::e_DLCType_Skin, path) { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.h similarity index 93% rename from Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.h index c0facea6c..c30a9fc5a 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h +++ b/Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.h @@ -1,6 +1,6 @@ #pragma once #include "DLCFile.h" -#include "../../Minecraft.Client/Rendering/Models/HumanoidModel.h" +#include "../../../net/minecraft/client/model/HumanoidModel.h" class DLCSkinFile : public DLCFile { private: diff --git a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCTextureFile.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCTextureFile.cpp index ed6b9fcce..f48c38660 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCTextureFile.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCTextureFile.h" diff --git a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCTextureFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCTextureFile.h diff --git a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp b/Minecraft.Client/Common/Source Files/DLC/DLCUIDataFile.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp rename to Minecraft.Client/Common/Source Files/DLC/DLCUIDataFile.cpp index 4acc5fae2..1ed764f57 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp +++ b/Minecraft.Client/Common/Source Files/DLC/DLCUIDataFile.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DLCManager.h" #include "DLCUIDataFile.h" diff --git a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h b/Minecraft.Client/Common/Source Files/DLC/DLCUIDataFile.h similarity index 100% rename from Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h rename to Minecraft.Client/Common/Source Files/DLC/DLCUIDataFile.h diff --git a/Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRules.h b/Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRules.h new file mode 100644 index 000000000..bb12d422e --- /dev/null +++ b/Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRules.h @@ -0,0 +1,32 @@ +#pragma once +#include "ConsoleGameRulesConstants.h" + +#include "GameRuleManager.h" + +#include "LevelRules/Rules/GameRule.h" + +#include "LevelRules/RuleDefinitions/GameRuleDefinition.h" + +#include "LevelRules/RuleDefinitions/LevelRuleset.h" +#include "LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h" + +#include "LevelRules/RuleDefinitions/CollectItemRuleDefinition.h" +#include "LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h" +#include "LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h" +#include "LevelRules/RuleDefinitions/UseTileRuleDefinition.h" +#include "LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h" +#include "LevelRules/RuleDefinitions/AddItemRuleDefinition.h" +#include "LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.h" + +#include "LevelGeneration/LevelGenerationOptions.h" +#include "LevelGeneration/ApplySchematicRuleDefinition.h" +#include "LevelGeneration/ConsoleGenerateStructure.h" +#include "LevelGeneration/ConsoleGenerateStructureAction.h" +#include "LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h" +#include "LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h" +#include "LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h" +#include "LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h" +#include "LevelGeneration/BiomeOverride.h" +#include "LevelGeneration/StartFeature.h" + +#include "LevelRules/Rules/GameRulesInstance.h" diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGameRulesConstants.h b/Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRulesConstants.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/ConsoleGameRulesConstants.h rename to Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRulesConstants.h diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp rename to Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp index fd3f79820..973c79c9b 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp @@ -1,14 +1,14 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/IO/Files/File.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Minecraft.World/Header Files/compression.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../Minecraft.World/Header Files/compression.h" #include "../DLC/DLCPack.h" #include "../DLC/DLCLocalisationFile.h" #include "../DLC/DLCGameRulesFile.h" #include "../DLC/DLCGameRules.h" #include "../DLC/DLCGameRulesHeader.h" -#include "../../Minecraft.Client/Utils/StringTable.h" +#include "../Localisation/StringTable.h" #include "ConsoleGameRules.h" #include "GameRuleManager.h" diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h b/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.h similarity index 97% rename from Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h rename to Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.h index ae4a28ad4..90e97e43c 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h +++ b/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.h @@ -1,8 +1,8 @@ #pragma once ////using namespace std; -#include "LevelGenerators.h" -#include "LevelRules.h" +#include "LevelGeneration/LevelGenerators.h" +#include "LevelRules/LevelRules.h" #include "../DLC/DLCGameRulesHeader.h" class LevelGenerationOptions; diff --git a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ApplySchematicRuleDefinition.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ApplySchematicRuleDefinition.cpp index d6d049b59..43c7e25ba 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ApplySchematicRuleDefinition.cpp @@ -1,14 +1,14 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "ApplySchematicRuleDefinition.h" #include "LevelGenerationOptions.h" #include "ConsoleSchematicFile.h" -#include "../../Minecraft.World/Util/AABB.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" ApplySchematicRuleDefinition::ApplySchematicRuleDefinition( LevelGenerationOptions* levelGenOptions) { diff --git a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ApplySchematicRuleDefinition.h similarity index 92% rename from Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ApplySchematicRuleDefinition.h index 90afa1be1..92a7083d1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ApplySchematicRuleDefinition.h @@ -1,8 +1,8 @@ #pragma once #include -#include "GameRuleDefinition.h" +#include "../LevelRules/RuleDefinitions/GameRuleDefinition.h" #include "ConsoleSchematicFile.h" -#include "../../Minecraft.World/Util/AABB.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" class AABB; class Vec3; diff --git a/Minecraft.Client/Platform/Common/GameRules/BiomeOverride.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/BiomeOverride.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/GameRules/BiomeOverride.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/BiomeOverride.cpp index 9ee41e272..9db6a4a18 100644 --- a/Minecraft.Client/Platform/Common/GameRules/BiomeOverride.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/BiomeOverride.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "BiomeOverride.h" BiomeOverride::BiomeOverride() { diff --git a/Minecraft.Client/Platform/Common/GameRules/BiomeOverride.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/BiomeOverride.h similarity index 91% rename from Minecraft.Client/Platform/Common/GameRules/BiomeOverride.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/BiomeOverride.h index 191cbff33..dddf3ea6f 100644 --- a/Minecraft.Client/Platform/Common/GameRules/BiomeOverride.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/BiomeOverride.h @@ -1,7 +1,7 @@ #pragma once // using namespace std; -#include "GameRuleDefinition.h" +#include "../LevelRules/RuleDefinitions/GameRuleDefinition.h" class BiomeOverride : public GameRuleDefinition { private: diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructure.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructure.cpp index 64c9db7af..4fd480cfb 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructure.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ConsoleGenerateStructure.h" -#include "ConsoleGameRules.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.h" +#include "../ConsoleGameRules.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/net.minecraft.h" ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0) { m_x = m_y = m_z = 0; diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructure.h similarity index 90% rename from Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructure.h index c65280d56..388cdc5aa 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructure.h @@ -1,6 +1,6 @@ #pragma once -#include "GameRuleDefinition.h" -#include "../../Minecraft.World/WorldGen/Structures/StructurePiece.h" +#include "../LevelRules/RuleDefinitions/GameRuleDefinition.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h" class Level; class Random; diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructureAction.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h similarity index 74% rename from Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructureAction.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h index 937b70c34..1e12e739b 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructureAction.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h @@ -1,6 +1,6 @@ #pragma once -#include "GameRuleDefinition.h" +#include "../LevelRules/RuleDefinitions/GameRuleDefinition.h" class ConsoleGenerateStructureAction : public GameRuleDefinition { public: diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp index 9614fcfca..1df124475 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp @@ -1,16 +1,16 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include -#include "../../Minecraft.World/Headers/com.mojang.nbt.h" -#include "../../Minecraft.World/Platform/System.h" +#include "../../../../../Minecraft.World/com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" #include "ConsoleSchematicFile.h" -#include "../../Minecraft.World/IO/Streams/InputOutputStream.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/Header Files/compression.h" ConsoleSchematicFile::ConsoleSchematicFile() { m_xSize = m_ySize = m_zSize = 0; diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h similarity index 98% rename from Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h index 8a54f201d..e52cb93f1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h @@ -4,7 +4,7 @@ #define XBOX_SCHEMATIC_ORIGINAL_VERSION 1 #define XBOX_SCHEMATIC_CURRENT_VERSION 2 -#include "../../Minecraft.World/Util/ArrayWithLength.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" class Level; class DataOutputStream; diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.cpp index 105267e8d..d29d67547 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.cpp @@ -1,15 +1,15 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.Client/Utils/StringTable.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../Localisation/StringTable.h" #include "LevelGenerationOptions.h" -#include "ConsoleGameRules.h" +#include "../ConsoleGameRules.h" JustGrSource::JustGrSource() { m_displayName = L"Default_DisplayName"; diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.h similarity index 97% rename from Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.h index f95c9accc..b6b598208 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.h @@ -5,8 +5,8 @@ #include -#include "GameRuleDefinition.h" -#include "../../Minecraft.World/WorldGen/Features/StructureFeature.h" +#include "../LevelRules/RuleDefinitions/GameRuleDefinition.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h" class ApplySchematicRuleDefinition; class LevelChunk; diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerators.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerators.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/GameRules/LevelGenerators.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerators.cpp index 5c8fdff78..7e80242a1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerators.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerators.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LevelGenerationOptions.h" #include "LevelGenerators.h" diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerators.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerators.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/LevelGenerators.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerators.h diff --git a/Minecraft.Client/Platform/Common/GameRules/StartFeature.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StartFeature.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/GameRules/StartFeature.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StartFeature.cpp index 293e4ca84..6824bc977 100644 --- a/Minecraft.Client/Platform/Common/GameRules/StartFeature.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StartFeature.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "StartFeature.h" StartFeature::StartFeature() { diff --git a/Minecraft.Client/Platform/Common/GameRules/StartFeature.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StartFeature.h similarity index 81% rename from Minecraft.Client/Platform/Common/GameRules/StartFeature.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StartFeature.h index d2c7c9d24..bdc3b0166 100644 --- a/Minecraft.Client/Platform/Common/GameRules/StartFeature.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StartFeature.h @@ -1,8 +1,8 @@ #pragma once // using namespace std; -#include "GameRuleDefinition.h" -#include "../../Minecraft.World/WorldGen/Features/StructureFeature.h" +#include "../LevelRules/RuleDefinitions/GameRuleDefinition.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h" class StartFeature : public GameRuleDefinition { private: diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionGenerateBox.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionGenerateBox.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.cpp index 4edd3be9d..70888aedb 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionGenerateBox.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "XboxStructureActionGenerateBox.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h" XboxStructureActionGenerateBox::XboxStructureActionGenerateBox() { m_x0 = m_y0 = m_z0 = m_x1 = m_y1 = m_z1 = m_edgeTile = m_fillTile = 0; diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionGenerateBox.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h similarity index 94% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionGenerateBox.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h index 7625f141c..e6fc7e256 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionGenerateBox.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h @@ -1,5 +1,5 @@ #pragma once -#include "ConsoleGenerateStructureAction.h" +#include "../ConsoleGenerateStructureAction.h" class StructurePiece; class Level; diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceBlock.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceBlock.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.cpp index b98d4a974..5812b8c82 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceBlock.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "XboxStructureActionPlaceBlock.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h" XboxStructureActionPlaceBlock::XboxStructureActionPlaceBlock() { m_x = m_y = m_z = m_tile = m_data = 0; diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceBlock.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h similarity index 94% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceBlock.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h index 63a4b6754..7c740c7ba 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceBlock.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h @@ -1,5 +1,5 @@ #pragma once -#include "ConsoleGenerateStructureAction.h" +#include "../ConsoleGenerateStructureAction.h" class StructurePiece; class Level; diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.cpp similarity index 83% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.cpp index 1315c1ea6..9484fc0d5 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "XboxStructureActionPlaceContainer.h" -#include "AddItemRuleDefinition.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../LevelRules/RuleDefinitions/AddItemRuleDefinition.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer() { m_tile = Tile::chest_Id; diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceSpawner.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.cpp similarity index 82% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceSpawner.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.cpp index 670528169..4c24dcc3d 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceSpawner.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "XboxStructureActionPlaceSpawner.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" XboxStructureActionPlaceSpawner::XboxStructureActionPlaceSpawner() { m_tile = Tile::mobSpawner_Id; diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceSpawner.h b/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceSpawner.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRules.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/LevelRules.cpp similarity index 86% rename from Minecraft.Client/Platform/Common/GameRules/LevelRules.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/LevelRules.cpp index 8e280e0ac..7d02770b1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelRules.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/LevelRules.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LevelRules.h" LevelRules::LevelRules() {} diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRules.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/LevelRules.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/LevelRules.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/LevelRules.h diff --git a/Minecraft.Client/Platform/Common/GameRules/AddEnchantmentRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.cpp similarity index 87% rename from Minecraft.Client/Platform/Common/GameRules/AddEnchantmentRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.cpp index 4a1d27bf7..81a5a4574 100644 --- a/Minecraft.Client/Platform/Common/GameRules/AddEnchantmentRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h" #include "AddEnchantmentRuleDefinition.h" AddEnchantmentRuleDefinition::AddEnchantmentRuleDefinition() { diff --git a/Minecraft.Client/Platform/Common/GameRules/AddEnchantmentRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/AddEnchantmentRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.h diff --git a/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.cpp index 4f9868d24..8fe3538c2 100644 --- a/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" #include "AddItemRuleDefinition.h" #include "AddEnchantmentRuleDefinition.h" diff --git a/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h diff --git a/Minecraft.Client/Platform/Common/GameRules/CollectItemRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/GameRules/CollectItemRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.cpp index 7360dcf33..2e454297f 100644 --- a/Minecraft.Client/Platform/Common/GameRules/CollectItemRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.Client/Utils/WstringLookup.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../WstringLookup.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "CollectItemRuleDefinition.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Network/Connection.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/Connection.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" CollectItemRuleDefinition::CollectItemRuleDefinition() { m_itemId = 0; diff --git a/Minecraft.Client/Platform/Common/GameRules/CollectItemRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/CollectItemRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h diff --git a/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.cpp similarity index 86% rename from Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.cpp index 82baa6c60..c94a0382e 100644 --- a/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "CompleteAllRuleDefinition.h" -#include "ConsoleGameRules.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Network/Connection.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" +#include "../../ConsoleGameRules.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/Connection.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" void CompleteAllRuleDefinition::getChildren( std::vector* children) { diff --git a/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h diff --git a/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.cpp index 3b8913f89..11727a8cf 100644 --- a/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "CompoundGameRuleDefinition.h" -#include "ConsoleGameRules.h" +#include "../../ConsoleGameRules.h" CompoundGameRuleDefinition::CompoundGameRuleDefinition() { m_lastRuleStatusChanged = nullptr; diff --git a/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.cpp index 87081110c..d8f82d6e2 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.Client/Utils/WstringLookup.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "ConsoleGameRules.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../WstringLookup.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../ConsoleGameRules.h" GameRuleDefinition::GameRuleDefinition() { m_descriptionId = L""; diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h similarity index 93% rename from Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h index bf5967365..506c2e21b 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h @@ -3,10 +3,10 @@ #include #include -#include "../../Minecraft.World/Items/ItemInstance.h" -#include "ConsoleGameRulesConstants.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" +#include "../../ConsoleGameRulesConstants.h" -#include "GameRulesInstance.h" +#include "../Rules/GameRulesInstance.h" class GameRule; class LevelRuleset; diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/LevelRuleset.cpp similarity index 86% rename from Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/LevelRuleset.cpp index 8cb2b3eb8..d8f2abe4a 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/LevelRuleset.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.Client/Utils/StringTable.h" -#include "ConsoleGameRules.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../Localisation/StringTable.h" +#include "../../ConsoleGameRules.h" #include "LevelRuleset.h" LevelRuleset::LevelRuleset() { m_stringTable = nullptr; } diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h diff --git a/Minecraft.Client/Platform/Common/GameRules/NamedAreaRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/GameRules/NamedAreaRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.cpp index da0524ff7..5865c50c8 100644 --- a/Minecraft.Client/Platform/Common/GameRules/NamedAreaRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "NamedAreaRuleDefinition.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" NamedAreaRuleDefinition::NamedAreaRuleDefinition() { m_name = L""; diff --git a/Minecraft.Client/Platform/Common/GameRules/NamedAreaRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h similarity index 89% rename from Minecraft.Client/Platform/Common/GameRules/NamedAreaRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h index 81be6c4bc..e356c3e26 100644 --- a/Minecraft.Client/Platform/Common/GameRules/NamedAreaRuleDefinition.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h @@ -1,7 +1,7 @@ #pragma once #include "GameRuleDefinition.h" -#include "../../Minecraft.World/Util/AABB.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" class NamedAreaRuleDefinition : public GameRuleDefinition { private: diff --git a/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.cpp index 7444fc21e..2b6f384da 100644 --- a/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "UpdatePlayerRuleDefinition.h" -#include "ConsoleGameRules.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.food.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../ConsoleGameRules.h" +#include "../../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() { m_bUpdateHealth = m_bUpdateFood = m_bUpdateYRot = false; diff --git a/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h diff --git a/Minecraft.Client/Platform/Common/GameRules/UseTileRuleDefinition.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/GameRules/UseTileRuleDefinition.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.cpp index 4650f2210..824d2ffee 100644 --- a/Minecraft.Client/Platform/Common/GameRules/UseTileRuleDefinition.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "UseTileRuleDefinition.h" UseTileRuleDefinition::UseTileRuleDefinition() { diff --git a/Minecraft.Client/Platform/Common/GameRules/UseTileRuleDefinition.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h similarity index 92% rename from Minecraft.Client/Platform/Common/GameRules/UseTileRuleDefinition.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h index d4b3e2eff..8fbb597b1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/UseTileRuleDefinition.h +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h @@ -2,7 +2,7 @@ // using namespace std; #include "GameRuleDefinition.h" -#include "../../Minecraft.World/Util/Pos.h" +#include "../../../../../../Minecraft.World/net/minecraft/Pos.h" class UseTileRuleDefinition : public GameRuleDefinition { private: diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRule.cpp b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRule.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/GameRules/GameRule.cpp rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRule.cpp index 35c52fc55..14063d437 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRule.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRule.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "ConsoleGameRules.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../ConsoleGameRules.h" GameRule::GameRule(GameRuleDefinition* definition, Connection* connection) { m_definition = definition; diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRule.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRule.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/GameRule.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRule.h diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRulesInstance.h b/Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRulesInstance.h similarity index 100% rename from Minecraft.Client/Platform/Common/GameRules/GameRulesInstance.h rename to Minecraft.Client/Common/Source Files/GameRules/LevelRules/Rules/GameRulesInstance.h diff --git a/Minecraft.Client/Utils/WstringLookup.cpp b/Minecraft.Client/Common/Source Files/GameRules/WstringLookup.cpp similarity index 94% rename from Minecraft.Client/Utils/WstringLookup.cpp rename to Minecraft.Client/Common/Source Files/GameRules/WstringLookup.cpp index edfd37d40..821feb11d 100644 --- a/Minecraft.Client/Utils/WstringLookup.cpp +++ b/Minecraft.Client/Common/Source Files/GameRules/WstringLookup.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "WstringLookup.h" diff --git a/Minecraft.Client/Utils/WstringLookup.h b/Minecraft.Client/Common/Source Files/GameRules/WstringLookup.h similarity index 100% rename from Minecraft.Client/Utils/WstringLookup.h rename to Minecraft.Client/Common/Source Files/GameRules/WstringLookup.h diff --git a/Minecraft.Client/Platform/Common/Leaderboards/LeaderboardInterface.cpp b/Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardInterface.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/Leaderboards/LeaderboardInterface.cpp rename to Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardInterface.cpp index d7f331577..328a46bea 100644 --- a/Minecraft.Client/Platform/Common/Leaderboards/LeaderboardInterface.cpp +++ b/Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardInterface.cpp @@ -1,4 +1,4 @@ -#include "../../stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "LeaderboardInterface.h" LeaderboardInterface::LeaderboardInterface(LeaderboardManager* man) { diff --git a/Minecraft.Client/Platform/Common/Leaderboards/LeaderboardInterface.h b/Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardInterface.h similarity index 100% rename from Minecraft.Client/Platform/Common/Leaderboards/LeaderboardInterface.h rename to Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardInterface.h diff --git a/Minecraft.Client/Platform/Common/Leaderboards/LeaderboardManager.cpp b/Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/Leaderboards/LeaderboardManager.cpp rename to Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.cpp index 454559503..a31d61f4c 100644 --- a/Minecraft.Client/Platform/Common/Leaderboards/LeaderboardManager.cpp +++ b/Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "LeaderboardManager.h" diff --git a/Minecraft.Client/Platform/Common/Leaderboards/LeaderboardManager.h b/Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.h similarity index 100% rename from Minecraft.Client/Platform/Common/Leaderboards/LeaderboardManager.h rename to Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.h diff --git a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp b/Minecraft.Client/Common/Source Files/Leaderboards/SonyLeaderboardManager.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp rename to Minecraft.Client/Common/Source Files/Leaderboards/SonyLeaderboardManager.cpp index 7397abb93..807bb8aee 100644 --- a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp +++ b/Minecraft.Client/Common/Source Files/Leaderboards/SonyLeaderboardManager.cpp @@ -1,4 +1,4 @@ -#include "../../stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include #include @@ -10,10 +10,10 @@ #include "base64.h" -#include "Common/Consoles_App.h" +#include "../../Consoles_App.h" #include "Common/Network/Sony/SQRNetworkManager.h" -#include "../../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #error "SonyLeaderboardManager is included for a non-sony platform." diff --git a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h b/Minecraft.Client/Common/Source Files/Leaderboards/SonyLeaderboardManager.h similarity index 98% rename from Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h rename to Minecraft.Client/Common/Source Files/Leaderboards/SonyLeaderboardManager.h index 16eb1fc64..1a68c5bc0 100644 --- a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h +++ b/Minecraft.Client/Common/Source Files/Leaderboards/SonyLeaderboardManager.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Common/Leaderboards/LeaderboardManager.h" +#include "LeaderboardManager.h" typedef SceRtcTick SonyRtcTick; diff --git a/Minecraft.Client/Platform/Common/Leaderboards/base64.cpp b/Minecraft.Client/Common/Source Files/Leaderboards/base64.cpp similarity index 100% rename from Minecraft.Client/Platform/Common/Leaderboards/base64.cpp rename to Minecraft.Client/Common/Source Files/Leaderboards/base64.cpp diff --git a/Minecraft.Client/Platform/Common/Leaderboards/base64.h b/Minecraft.Client/Common/Source Files/Leaderboards/base64.h similarity index 100% rename from Minecraft.Client/Platform/Common/Leaderboards/base64.h rename to Minecraft.Client/Common/Source Files/Leaderboards/base64.h diff --git a/Minecraft.Client/Utils/StringTable.cpp b/Minecraft.Client/Common/Source Files/Localisation/StringTable.cpp similarity index 98% rename from Minecraft.Client/Utils/StringTable.cpp rename to Minecraft.Client/Common/Source Files/Localisation/StringTable.cpp index 63f5e2303..0786dab03 100644 --- a/Minecraft.Client/Utils/StringTable.cpp +++ b/Minecraft.Client/Common/Source Files/Localisation/StringTable.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "StringTable.h" StringTable::StringTable(void) {} diff --git a/Minecraft.Client/Utils/StringTable.h b/Minecraft.Client/Common/Source Files/Localisation/StringTable.h similarity index 100% rename from Minecraft.Client/Utils/StringTable.h rename to Minecraft.Client/Common/Source Files/Localisation/StringTable.h diff --git a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp rename to Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp index ab700d242..9c0efc7c0 100644 --- a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp @@ -1,38 +1,38 @@ #include #include -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/AABB.h" -#include "../../Minecraft.World/Util/Vec3.h" -#include "../../Minecraft.World/Network/Socket.h" -#include "../../Minecraft.World/Util/ThreadName.h" -#include "../../Minecraft.World/Entities/Entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Recipes/FireworksRecipe.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/User.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Network/PlayerList.h" -#include "../../Minecraft.Client/Player/ServerPlayer.h" -#include "../../Minecraft.Client/Network/PlayerConnection.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Network/Packets/DisconnectPacket.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" -#include "../../Minecraft.World/Level/Storage/OldChunkStorage.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ThreadName.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/crafting/FireworksRecipe.h" +#include "../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../net/minecraft/client/Minecraft.h" +#include "../../../net/minecraft/client/User.h" +#include "../../../net/minecraft/server/MinecraftServer.h" +#include "../../../net/minecraft/server/PlayerList.h" +#include "../../../net/minecraft/server/level/ServerPlayer.h" +#include "../../../net/minecraft/server/network/PlayerConnection.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../net/minecraft/client/ProgressRenderer.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h" +#include "../../../../Minecraft.World/Header Files/compression.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h" +#include "../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../net/minecraft/client/skins/TexturePack.h" -#include "../../Minecraft.Client/UI/Gui.h" -#include "../../Minecraft.Client/Rendering/LevelRenderer.h" +#include "../../../net/minecraft/client/gui/Gui.h" +#include "../../../net/minecraft/client/renderer/LevelRenderer.h" #include "../GameRules/ConsoleGameRules.h" #include "GameNetworkManager.h" #include "../UI/UI.h" -#include "../UI/UIScene_PauseMenu.h" +#include "../UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h" // Global instance CGameNetworkManager g_NetworkManager; diff --git a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h b/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h similarity index 99% rename from Minecraft.Client/Platform/Common/Network/GameNetworkManager.h rename to Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h index f81e22f32..f93de859a 100644 --- a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h +++ b/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h @@ -4,7 +4,7 @@ #if !defined(__linux__) #include #endif -#include "../../Minecraft.World/Util/C4JThread.h" +#include "../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" #include "NetworkPlayerInterface.h" #include "PlatformNetworkManagerStub.h" #include "SessionInfo.h" diff --git a/Minecraft.Client/Platform/Common/Network/NetworkPlayerInterface.h b/Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h similarity index 100% rename from Minecraft.Client/Platform/Common/Network/NetworkPlayerInterface.h rename to Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h diff --git a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerInterface.h b/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerInterface.h similarity index 98% rename from Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerInterface.h rename to Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerInterface.h index bd0d40b8a..a836a552d 100644 --- a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerInterface.h +++ b/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerInterface.h @@ -4,7 +4,7 @@ #if !defined(__linux__) #include #endif -#include "../../Minecraft.World/Util/C4JThread.h" +#include "../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" #include "NetworkPlayerInterface.h" #include "SessionInfo.h" diff --git a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp rename to Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp index 9bc82654a..962b52957 100644 --- a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Network/Socket.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "NetworkPlayerQNet.h" #include "PlatformNetworkManagerStub.h" diff --git a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.h b/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.h similarity index 99% rename from Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.h rename to Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.h index dd184f5bc..a9a749b21 100644 --- a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.h +++ b/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.h @@ -1,7 +1,7 @@ #pragma once // using namespace std; #include -#include "../../Minecraft.World/Util/C4JThread.h" +#include "../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" #include "NetworkPlayerInterface.h" #include "PlatformNetworkManagerInterface.h" #include "SessionInfo.h" diff --git a/Minecraft.Client/Platform/Common/Network/SessionInfo.h b/Minecraft.Client/Common/Source Files/Network/SessionInfo.h similarity index 100% rename from Minecraft.Client/Platform/Common/Network/SessionInfo.h rename to Minecraft.Client/Common/Source Files/Network/SessionInfo.h diff --git a/Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.cpp b/Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.cpp rename to Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.cpp index 8526b0fe7..325ffb37f 100644 --- a/Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.cpp +++ b/Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Level/Storage/LevelSettings.h" -#include "../../Minecraft.World/Level/LevelData.h" -#include "../../Minecraft.World/Level/Level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/LevelSettings.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/Level.h" #include "TelemetryManager.h" diff --git a/Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.h b/Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.h similarity index 95% rename from Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.h rename to Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.h index 8803034c1..4381ab2ed 100644 --- a/Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.h +++ b/Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.h @@ -4,11 +4,11 @@ // SentientManager.h -> MinecraftTelemetry.h. Using the Windows64 path would // cause duplicate enum definitions. #if defined(__linux__) -#include "../../Minecraft.Client/Platform/Linux/Sentient/TelemetryEnum.h" +#include "../../../Windows64/Source Files/Sentient/TelemetryEnum.h" #else -#include "../../Minecraft.Client/Platform/Windows64/Sentient/TelemetryEnum.h" +#include "../../../Windows64/Source Files/Sentient/TelemetryEnum.h" #endif -#include "../UI/UIEnums.h" +#include "../UI/All Platforms/UIEnums.h" class CTelemetryManager { public: diff --git a/Minecraft.Client/Platform/Common/Trial/TrialMode.cpp b/Minecraft.Client/Common/Source Files/Trial/TrialMode.cpp similarity index 81% rename from Minecraft.Client/Platform/Common/Trial/TrialMode.cpp rename to Minecraft.Client/Common/Source Files/Trial/TrialMode.cpp index fa0b37847..527688565 100644 --- a/Minecraft.Client/Platform/Common/Trial/TrialMode.cpp +++ b/Minecraft.Client/Common/Source Files/Trial/TrialMode.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "TrialMode.h" #include "../Tutorial/FullTutorial.h" diff --git a/Minecraft.Client/Platform/Common/Trial/TrialMode.h b/Minecraft.Client/Common/Source Files/Trial/TrialMode.h similarity index 100% rename from Minecraft.Client/Platform/Common/Trial/TrialMode.h rename to Minecraft.Client/Common/Source Files/Trial/TrialMode.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaConstraint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/AreaConstraint.cpp similarity index 84% rename from Minecraft.Client/Platform/Common/Tutorial/AreaConstraint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/AreaConstraint.cpp index 2cf4ab5ee..ab8afef92 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/AreaConstraint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/AreaConstraint.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "AreaConstraint.h" -#include "../../Minecraft.World/Util/AABB.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" AreaConstraint::AreaConstraint(int descriptionId, double x0, double y0, double z0, double x1, double y1, double z1, diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaConstraint.h b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/AreaConstraint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/AreaConstraint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/AreaConstraint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/ChangeStateConstraint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/ChangeStateConstraint.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/Tutorial/ChangeStateConstraint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/ChangeStateConstraint.cpp index ebcc44bcc..56afc5d4d 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ChangeStateConstraint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/ChangeStateConstraint.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" -#include "Tutorial.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../Tutorial.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "ChangeStateConstraint.h" -#include "../../Minecraft.World/Util/AABB.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" ChangeStateConstraint::ChangeStateConstraint( Tutorial* tutorial, eTutorial_State targetState, diff --git a/Minecraft.Client/Platform/Common/Tutorial/ChangeStateConstraint.h b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/ChangeStateConstraint.h similarity index 97% rename from Minecraft.Client/Platform/Common/Tutorial/ChangeStateConstraint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/ChangeStateConstraint.h index 4be844890..66a5d5128 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ChangeStateConstraint.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/ChangeStateConstraint.h @@ -1,6 +1,6 @@ #pragma once -#include "TutorialEnum.h" +#include "../TutorialEnum.h" #include "TutorialConstraint.h" #include diff --git a/Minecraft.Client/Platform/Common/Tutorial/InputConstraint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/InputConstraint.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/Tutorial/InputConstraint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/InputConstraint.cpp index 5037d260b..67974bcc8 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/InputConstraint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/InputConstraint.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "InputConstraint.h" bool InputConstraint::isMappingConstrained(int iPad, int mapping) { diff --git a/Minecraft.Client/Platform/Common/Tutorial/InputConstraint.h b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/InputConstraint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/InputConstraint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/InputConstraint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialConstraint.h b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialConstraint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialConstraints.h b/Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraints.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialConstraints.h rename to Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraints.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/FullTutorial.cpp b/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/Tutorial/FullTutorial.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp index 48259ceae..23271ef87 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/FullTutorial.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp @@ -1,15 +1,15 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" #include "../GameRules/ConsoleGameRules.h" -#include "DiggerItemHint.h" -#include "TutorialTasks.h" -#include "AreaHint.h" +#include "Hints/DiggerItemHint.h" +#include "Tasks/TutorialTasks.h" +#include "Hints/AreaHint.h" #include "FullTutorial.h" -#include "TutorialConstraints.h" +#include "Constraints/TutorialConstraints.h" FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) : Tutorial(iPad, true) { diff --git a/Minecraft.Client/Platform/Common/Tutorial/FullTutorial.h b/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/FullTutorial.h rename to Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/FullTutorialMode.cpp b/Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.cpp similarity index 78% rename from Minecraft.Client/Platform/Common/Tutorial/FullTutorialMode.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.cpp index 274fcb3c8..39be37c03 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/FullTutorialMode.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../net/minecraft/client/Minecraft.h" #include "FullTutorial.h" #include "FullTutorialMode.h" diff --git a/Minecraft.Client/Platform/Common/Tutorial/FullTutorialMode.h b/Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/FullTutorialMode.h rename to Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaHint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.cpp similarity index 79% rename from Minecraft.Client/Platform/Common/Tutorial/AreaHint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.cpp index b3ebdf65a..9f84469fd 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/AreaHint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "AreaHint.h" -#include "../../Minecraft.World/Util/AABB.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../Tutorial.h" AreaHint::AreaHint(eTutorial_Hint id, Tutorial* tutorial, eTutorial_State displayState, eTutorial_State completeState, diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaHint.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/AreaHint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/DiggerItemHint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Hints/DiggerItemHint.cpp similarity index 79% rename from Minecraft.Client/Platform/Common/Tutorial/DiggerItemHint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/DiggerItemHint.cpp index a23dc4853..3082fee8a 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/DiggerItemHint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/DiggerItemHint.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../Tutorial.h" #include "DiggerItemHint.h" DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/DiggerItemHint.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/DiggerItemHint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/DiggerItemHint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/DiggerItemHint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/LookAtEntityHint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.cpp similarity index 89% rename from Minecraft.Client/Platform/Common/Tutorial/LookAtEntityHint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.cpp index 2c7eff378..58b767536 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/LookAtEntityHint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../Tutorial.h" #include "LookAtEntityHint.h" LookAtEntityHint::LookAtEntityHint(eTutorial_Hint id, Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/LookAtEntityHint.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h similarity index 87% rename from Minecraft.Client/Platform/Common/Tutorial/LookAtEntityHint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h index fdd209517..593970070 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/LookAtEntityHint.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h @@ -1,7 +1,7 @@ #pragma once // using namespace std; -#include "../../Minecraft.World/Util/Class.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Class.h" #include "TutorialHint.h" class ItemInstance; diff --git a/Minecraft.Client/Platform/Common/Tutorial/LookAtTileHint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtTileHint.cpp similarity index 87% rename from Minecraft.Client/Platform/Common/Tutorial/LookAtTileHint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtTileHint.cpp index d79d0e679..d5a2688f4 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/LookAtTileHint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtTileHint.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../Tutorial.h" #include "LookAtTileHint.h" LookAtTileHint::LookAtTileHint(eTutorial_Hint id, Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/LookAtTileHint.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtTileHint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/LookAtTileHint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtTileHint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/TakeItemHint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TakeItemHint.cpp similarity index 79% rename from Minecraft.Client/Platform/Common/Tutorial/TakeItemHint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/TakeItemHint.cpp index ca2dac44b..1cbc6180a 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TakeItemHint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TakeItemHint.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../Tutorial.h" #include "TakeItemHint.h" TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial* tutorial, int items[], diff --git a/Minecraft.Client/Platform/Common/Tutorial/TakeItemHint.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TakeItemHint.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TakeItemHint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/TakeItemHint.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHint.cpp similarity index 84% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHint.cpp index 91a4797f3..318131b88 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHint.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../Tutorial.h" #include "TutorialHint.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial* tutorial, int descriptionId, eHintType type, diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHint.h similarity index 98% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialHint.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHint.h index 901713572..171c7b002 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHint.h @@ -1,7 +1,7 @@ #pragma once // using namespace std; -#include "TutorialEnum.h" +#include "../TutorialEnum.h" #define TUTORIAL_HINT_MAX_MINE_REPEATS 20 diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialHints.h b/Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHints.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialHints.h rename to Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHints.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/AreaTask.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/AreaTask.cpp index 14ed6b0a6..27fc6464b 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/AreaTask.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../Tutorial.h" #include "AreaTask.h" AreaTask::AreaTask(eTutorial_State state, Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/AreaTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/AreaTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/AreaTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ChoiceTask.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ChoiceTask.cpp index 985be9647..c55f99d5a 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ChoiceTask.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include #include -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "Tutorial.h" -#include "TutorialConstraints.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../Tutorial.h" +#include "../Constraints/TutorialConstraints.h" #include "ChoiceTask.h" -#include "../../Minecraft.World/Blocks/Material.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/Material.h" ChoiceTask::ChoiceTask( Tutorial* tutorial, int descriptionId, int promptId /*= -1*/, diff --git a/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ChoiceTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ChoiceTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/CompleteUsingItemTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/CompleteUsingItemTask.cpp similarity index 87% rename from Minecraft.Client/Platform/Common/Tutorial/CompleteUsingItemTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/CompleteUsingItemTask.cpp index bcf5b2002..ef1d8568c 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/CompleteUsingItemTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/CompleteUsingItemTask.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Items/ItemInstance.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" #include "CompleteUsingItemTask.h" CompleteUsingItemTask::CompleteUsingItemTask(Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/CompleteUsingItemTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/CompleteUsingItemTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/CompleteUsingItemTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/CompleteUsingItemTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/ControllerTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ControllerTask.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/Tutorial/ControllerTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ControllerTask.cpp index 1a82e615f..0ca558da5 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ControllerTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ControllerTask.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include #include -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "Tutorial.h" -#include "TutorialConstraints.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../Tutorial.h" +#include "../Constraints/TutorialConstraints.h" #include "ControllerTask.h" ControllerTask::ControllerTask(Tutorial* tutorial, int descriptionId, diff --git a/Minecraft.Client/Platform/Common/Tutorial/ControllerTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ControllerTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/ControllerTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ControllerTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/CraftTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/CraftTask.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/Tutorial/CraftTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/CraftTask.cpp index 5d8532e0f..3fab52c5c 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/CraftTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/CraftTask.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "CraftTask.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" CraftTask::CraftTask( int itemId, int auxValue, int quantity, Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/CraftTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/CraftTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/CraftTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/CraftTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/EffectChangedTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/EffectChangedTask.cpp similarity index 85% rename from Minecraft.Client/Platform/Common/Tutorial/EffectChangedTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/EffectChangedTask.cpp index e07d075fb..396fd01b2 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/EffectChangedTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/EffectChangedTask.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" #include "EffectChangedTask.h" EffectChangedTask::EffectChangedTask(Tutorial* tutorial, int descriptionId, diff --git a/Minecraft.Client/Platform/Common/Tutorial/EffectChangedTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/EffectChangedTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/EffectChangedTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/EffectChangedTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/FullTutorialActiveTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/FullTutorialActiveTask.cpp similarity index 86% rename from Minecraft.Client/Platform/Common/Tutorial/FullTutorialActiveTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/FullTutorialActiveTask.cpp index 4acc3698b..705575a05 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/FullTutorialActiveTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/FullTutorialActiveTask.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../Tutorial.h" #include "FullTutorialActiveTask.h" FullTutorialActiveTask::FullTutorialActiveTask( diff --git a/Minecraft.Client/Platform/Common/Tutorial/FullTutorialActiveTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/FullTutorialActiveTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/FullTutorialActiveTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/FullTutorialActiveTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/HorseChoiceTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/HorseChoiceTask.cpp similarity index 85% rename from Minecraft.Client/Platform/Common/Tutorial/HorseChoiceTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/HorseChoiceTask.cpp index aa3214bee..14a69df83 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/HorseChoiceTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/HorseChoiceTask.cpp @@ -1,11 +1,11 @@ -#include "../../stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include -#include "../../../Minecraft.h" -#include "Tutorial.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../Tutorial.h" -#include "../../../../Minecraft.World/Entities/Mobs/EntityHorse.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h" #include "HorseChoiceTask.h" diff --git a/Minecraft.Client/Platform/Common/Tutorial/HorseChoiceTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/HorseChoiceTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/HorseChoiceTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/HorseChoiceTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/InfoTask.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/InfoTask.cpp index 3d7b9c3bc..7acb74699 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/InfoTask.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include #include -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "Tutorial.h" -#include "TutorialConstraints.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../Tutorial.h" +#include "../Constraints/TutorialConstraints.h" #include "InfoTask.h" -#include "../../Minecraft.World/Blocks/Material.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/Material.h" InfoTask::InfoTask( Tutorial* tutorial, int descriptionId, int promptId /*= -1*/, diff --git a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/InfoTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/InfoTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/InfoTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/PickupTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/PickupTask.cpp similarity index 88% rename from Minecraft.Client/Platform/Common/Tutorial/PickupTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/PickupTask.cpp index 544ede0b4..aaf99965f 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/PickupTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/PickupTask.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "PickupTask.h" void PickupTask::onTake(std::shared_ptr item, diff --git a/Minecraft.Client/Platform/Common/Tutorial/PickupTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/PickupTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/PickupTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/PickupTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProcedureCompoundTask.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProcedureCompoundTask.cpp index 0f90c261b..ba60fea58 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProcedureCompoundTask.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ProcedureCompoundTask.h" ProcedureCompoundTask::~ProcedureCompoundTask() { diff --git a/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProcedureCompoundTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProcedureCompoundTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/ProgressFlagTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProgressFlagTask.cpp similarity index 84% rename from Minecraft.Client/Platform/Common/Tutorial/ProgressFlagTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProgressFlagTask.cpp index 6c849e030..98384cc16 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ProgressFlagTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProgressFlagTask.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ProgressFlagTask.h" bool ProgressFlagTask::isCompleted() { diff --git a/Minecraft.Client/Platform/Common/Tutorial/ProgressFlagTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProgressFlagTask.h similarity index 96% rename from Minecraft.Client/Platform/Common/Tutorial/ProgressFlagTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProgressFlagTask.h index 5b14e216d..0dc8ae26a 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ProgressFlagTask.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/ProgressFlagTask.h @@ -1,6 +1,6 @@ #pragma once // using namespace std; -#include "Tutorial.h" +#include "../Tutorial.h" #include "TutorialTask.h" class ProgressFlagTask : public TutorialTask { diff --git a/Minecraft.Client/Platform/Common/Tutorial/RideEntityTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/RideEntityTask.cpp similarity index 76% rename from Minecraft.Client/Platform/Common/Tutorial/RideEntityTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/RideEntityTask.cpp index 7325da1a6..cb7fae7c4 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/RideEntityTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/RideEntityTask.cpp @@ -1,11 +1,11 @@ -#include "../../stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include -#include "../../../Minecraft.h" -#include "Tutorial.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../Tutorial.h" -#include "../../../../Minecraft.World/Entities/Mobs/EntityHorse.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h" #include "RideEntityTask.h" diff --git a/Minecraft.Client/Platform/Common/Tutorial/RideEntityTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/RideEntityTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/RideEntityTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/RideEntityTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/StatTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/StatTask.cpp similarity index 68% rename from Minecraft.Client/Platform/Common/Tutorial/StatTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/StatTask.cpp index 321c93c19..d3396c52f 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/StatTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/StatTask.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.Client/GameState/StatsCounter.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../../net/minecraft/stats/StatsCounter.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" #include "StatTask.h" StatTask::StatTask(Tutorial* tutorial, int descriptionId, diff --git a/Minecraft.Client/Platform/Common/Tutorial/StatTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/StatTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/StatTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/StatTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/StateChangeTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/StateChangeTask.h similarity index 97% rename from Minecraft.Client/Platform/Common/Tutorial/StateChangeTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/StateChangeTask.h index 9a5e7a83a..17345ee25 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/StateChangeTask.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/StateChangeTask.h @@ -1,6 +1,6 @@ #pragma once // using namespace std; -#include "Tutorial.h" +#include "../Tutorial.h" #include "TutorialTask.h" class StateChangeTask : public TutorialTask { diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTask.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTask.cpp index 2ae529c40..720e18c99 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTask.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "Tutorial.h" -#include "TutorialConstraints.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../Tutorial.h" +#include "../Constraints/TutorialConstraints.h" #include "TutorialTask.h" TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId, diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTask.h similarity index 99% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTask.h index 4eabc3d44..b0fca6d4e 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTask.h @@ -1,6 +1,6 @@ #pragma once // using namespace std; -#include "TutorialEnum.h" +#include "../TutorialEnum.h" class Level; class Tutorial; diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialTasks.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTasks.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialTasks.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTasks.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/UseItemTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseItemTask.cpp similarity index 71% rename from Minecraft.Client/Platform/Common/Tutorial/UseItemTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseItemTask.cpp index 7874eec5f..3c684e2a6 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/UseItemTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseItemTask.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Entities/Entity.h" -#include "../../Minecraft.World/Level/Level.h" -#include "../../Minecraft.World/Items/ItemInstance.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" #include "UseItemTask.h" UseItemTask::UseItemTask(const int itemId, Tutorial* tutorial, diff --git a/Minecraft.Client/Platform/Common/Tutorial/UseItemTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseItemTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/UseItemTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseItemTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/UseTileTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseTileTask.cpp similarity index 84% rename from Minecraft.Client/Platform/Common/Tutorial/UseTileTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseTileTask.cpp index 35d992d14..620189c75 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/UseTileTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseTileTask.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Entities/Entity.h" -#include "../../Minecraft.World/Level/Level.h" -#include "../../Minecraft.World/Items/ItemInstance.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" #include "UseTileTask.h" UseTileTask::UseTileTask(const int tileId, int x, int y, int z, diff --git a/Minecraft.Client/Platform/Common/Tutorial/UseTileTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseTileTask.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/UseTileTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/UseTileTask.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/XuiCraftingTask.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/XuiCraftingTask.cpp similarity index 80% rename from Minecraft.Client/Platform/Common/Tutorial/XuiCraftingTask.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/XuiCraftingTask.cpp index e27f9e052..d63af9aaa 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/XuiCraftingTask.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/XuiCraftingTask.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Items/ItemInstance.h" -#include "../UI/UI.h" -#include "Tutorial.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" +#include "../../UI/UI.h" +#include "../Tutorial.h" #include "XuiCraftingTask.h" bool XuiCraftingTask::isCompleted() { diff --git a/Minecraft.Client/Platform/Common/Tutorial/XuiCraftingTask.h b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/XuiCraftingTask.h similarity index 94% rename from Minecraft.Client/Platform/Common/Tutorial/XuiCraftingTask.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tasks/XuiCraftingTask.h index 3ed6b6d96..d3bcc3e20 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/XuiCraftingTask.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tasks/XuiCraftingTask.h @@ -1,6 +1,6 @@ #pragma once #include "TutorialTask.h" -#include "../../Minecraft.World/Recipes/Recipy.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/crafting/Recipy.h" class XuiCraftingTask : public TutorialTask { public: diff --git a/Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp b/Minecraft.Client/Common/Source Files/Tutorial/Tutorial.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/Tutorial.cpp index 7ac952962..9fa1a5f29 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tutorial.cpp @@ -1,22 +1,22 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.World/Entities/Entity.h" -#include "../../Minecraft.World/Level/Level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.Client/GameState/SurvivalMode.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../net/minecraft/server/MinecraftServer.h" +#include "../../../net/minecraft/client/Minecraft.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../net/minecraft/server/level/SurvivalMode.h" #include "Tutorial.h" #include "TutorialMessage.h" -#include "TutorialTasks.h" -#include "TutorialConstraints.h" -#include "TutorialHints.h" +#include "Tasks/TutorialTasks.h" +#include "Constraints/TutorialConstraints.h" +#include "Hints/TutorialHints.h" std::vector Tutorial::s_completableTasks; diff --git a/Minecraft.Client/Platform/Common/Tutorial/Tutorial.h b/Minecraft.Client/Common/Source Files/Tutorial/Tutorial.h similarity index 98% rename from Minecraft.Client/Platform/Common/Tutorial/Tutorial.h rename to Minecraft.Client/Common/Source Files/Tutorial/Tutorial.h index 17cdac680..77d76ced3 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/Tutorial.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/Tutorial.h @@ -1,8 +1,8 @@ #pragma once // using namespace std; -#include "TutorialTask.h" -#include "TutorialConstraint.h" -#include "TutorialHint.h" +#include "Tasks/TutorialTask.h" +#include "Constraints/TutorialConstraint.h" +#include "Hints/TutorialHint.h" #include "TutorialMessage.h" #include "TutorialEnum.h" diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialEnum.h b/Minecraft.Client/Common/Source Files/Tutorial/TutorialEnum.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialEnum.h rename to Minecraft.Client/Common/Source Files/Tutorial/TutorialEnum.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialMessage.cpp b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMessage.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialMessage.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/TutorialMessage.cpp index 30fd6cd1d..b475d8bcd 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialMessage.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMessage.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "TutorialMessage.h" TutorialMessage::TutorialMessage( diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialMessage.h b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMessage.h similarity index 100% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialMessage.h rename to Minecraft.Client/Common/Source Files/Tutorial/TutorialMessage.h diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialMode.cpp b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.cpp similarity index 83% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialMode.cpp rename to Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.cpp index e6c74cc5b..1e7126e22 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialMode.cpp +++ b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.World/Containers/Inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../../net/minecraft/client/Minecraft.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/player/Inventory.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "TutorialMode.h" TutorialMode::TutorialMode(int iPad, Minecraft* minecraft, diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialMode.h b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.h similarity index 93% rename from Minecraft.Client/Platform/Common/Tutorial/TutorialMode.h rename to Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.h index be3c0bd7e..3277c89b8 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialMode.h +++ b/Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.h @@ -1,7 +1,7 @@ #pragma once // using namespace std; -#include "../../Minecraft.Client/Player/MultiPlayerGameMode.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerGameMode.h" #include "Tutorial.h" class TutorialMode : public MultiPlayerGameMode { diff --git a/Minecraft.Client/Utils/ArchiveFile.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.cpp similarity index 94% rename from Minecraft.Client/Utils/ArchiveFile.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.cpp index 16d952792..6024419df 100644 --- a/Minecraft.Client/Utils/ArchiveFile.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/PortableFileIO.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/Header Files/PortableFileIO.h" +#include "../../../../../Minecraft.World/Header Files/compression.h" #include "ArchiveFile.h" diff --git a/Minecraft.Client/Utils/ArchiveFile.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h similarity index 83% rename from Minecraft.Client/Utils/ArchiveFile.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h index 6645a39a9..dc4635ef9 100644 --- a/Minecraft.Client/Utils/ArchiveFile.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h @@ -4,8 +4,8 @@ #include #include -#include "../../Minecraft.World/IO/Files/File.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" class ArchiveFile { protected: diff --git a/Minecraft.Client/Platform/Common/UI/IUIController.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIController.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIController.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIController.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp index eef48ca56..4263111e6 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_AbstractContainerMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.crafting.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/Minecraft.h" IUIScene_AbstractContainerMenu::IUIScene_AbstractContainerMenu() { m_menu = nullptr; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp index 9b45900f9..8f8b62b8c 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_AnvilMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/IO/Streams/InputOutputStream.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/multiplayer/ClientConnection.h" IUIScene_AnvilMenu::IUIScene_AnvilMenu() { m_inventory = nullptr; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.h similarity index 94% rename from Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.h index 5833471f8..cb065f5f8 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.h @@ -1,6 +1,6 @@ #pragma once #include "IUIScene_AbstractContainerMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.ContainerListener.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.ContainerListener.h" // The 0-indexed slot in the inventory list that lines up with the result slot #define ANVIL_SCENE_RESULT_SLOT_UP_OFFSET 5 diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_BeaconMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BeaconMenu.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/IUIScene_BeaconMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BeaconMenu.cpp index 960d24046..871371134 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_BeaconMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BeaconMenu.cpp @@ -1,13 +1,13 @@ -#include "../../stdafx.h" -#include "../../../../Minecraft.World/Network/Packets/CustomPayloadPacket.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../../../Minecraft.World/Util/HtmlString.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/net/minecraft/util/HtmlString.h" #include "IUIScene_BeaconMenu.h" -#include "../../../Minecraft.h" -#include "../../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Network/ClientConnection.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/multiplayer/ClientConnection.h" IUIScene_BeaconMenu::IUIScene_BeaconMenu() { m_beacon = nullptr; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_BeaconMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BeaconMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/IUIScene_BeaconMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BeaconMenu.h index f09bef038..2636b0f2d 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_BeaconMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BeaconMenu.h @@ -1,5 +1,5 @@ #pragma once -#include "Common/UI/IUIScene_AbstractContainerMenu.h" +#include "IUIScene_AbstractContainerMenu.h" class BeaconTileEntity; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_BrewingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BrewingMenu.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/IUIScene_BrewingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BrewingMenu.cpp index 3cccef704..22af1e10e 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_BrewingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BrewingMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_BrewingMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_BrewingMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_BrewingMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BrewingMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_BrewingMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_BrewingMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CommandBlockMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CommandBlockMenu.cpp similarity index 69% rename from Minecraft.Client/Platform/Common/UI/IUIScene_CommandBlockMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CommandBlockMenu.cpp index ae5bbf32f..7abc1c9a6 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CommandBlockMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CommandBlockMenu.cpp @@ -1,7 +1,7 @@ -#include "../../stdafx.h" -#include "../../../../Minecraft.World/Network/Packets/CustomPayloadPacket.h" -#include "../../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Network/ClientConnection.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/multiplayer/ClientConnection.h" #include "IUIScene_CommandBlockMenu.h" void IUIScene_CommandBlockMenu::Initialise(CommandBlockEntity* commandBlock) { diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CommandBlockMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CommandBlockMenu.h similarity index 76% rename from Minecraft.Client/Platform/Common/UI/IUIScene_CommandBlockMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CommandBlockMenu.h index ee6b9b295..6522c13f2 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CommandBlockMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CommandBlockMenu.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" class IUIScene_CommandBlockMenu { public: diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_ContainerMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_ContainerMenu.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/IUIScene_ContainerMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_ContainerMenu.cpp index b4201cf59..891ab6cb6 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_ContainerMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_ContainerMenu.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_ContainerMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_ContainerMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_ContainerMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_ContainerMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_ContainerMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_ContainerMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp index c34ebf7a1..7200e8f5f 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.crafting.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../net/minecraft/client/player/LocalPlayer.h" #include "IUIScene_CraftingMenu.h" Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.h index f446d8a27..aae4086cd 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/Recipes/Recipy.h" -#include "../../Minecraft.World/Items/Item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/crafting/Recipy.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/Item.h" class LocalPlayer; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp index 563bfdf27..4cd0d10fd 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp @@ -1,16 +1,16 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_CreativeMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.enchantment.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../Minecraft.World/Util/JavaMath.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" // 4J JEV - Images for each tab. IUIScene_CreativeMenu::TabSpec** IUIScene_CreativeMenu::specs = nullptr; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.h index 21f1e40d9..174a2f4d8 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.h @@ -1,6 +1,6 @@ #pragma once #include "IUIScene_AbstractContainerMenu.h" -#include "../../Minecraft.World/Containers/AbstractContainerMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h" // 4J Stu - This class is for code that is common between XUI and Iggy class SimpleContainer; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_DispenserMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_DispenserMenu.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/IUIScene_DispenserMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_DispenserMenu.cpp index bd296c080..5e8789185 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_DispenserMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_DispenserMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_DispenserMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_DispenserMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_DispenserMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_DispenserMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_DispenserMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_DispenserMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_EnchantingMenu.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_EnchantingMenu.cpp index 8e932e713..9f8dd0510 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_EnchantingMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "IUIScene_EnchantingMenu.h" IUIScene_AbstractContainerMenu::ESceneSection diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_EnchantingMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_EnchantingMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_FireworksMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FireworksMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/IUIScene_FireworksMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FireworksMenu.cpp index 585092be1..ce2185540 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_FireworksMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FireworksMenu.cpp @@ -1,7 +1,7 @@ -#include "../../stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_FireworksMenu.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_FireworksMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_FireworksMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FireworksMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_FireworksMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FireworksMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_FurnaceMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FurnaceMenu.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/IUIScene_FurnaceMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FurnaceMenu.cpp index 30fe84d08..6b3edf5d5 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_FurnaceMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FurnaceMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_FurnaceMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_FurnaceMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_FurnaceMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FurnaceMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_FurnaceMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_FurnaceMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_HUD.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HUD.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/IUIScene_HUD.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HUD.cpp index d6efeca88..9c95b24ac 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_HUD.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HUD.cpp @@ -1,10 +1,10 @@ -#include "../../stdafx.h" -#include "../../../Minecraft.h" -#include "../../../Player/MultiPlayerLocalPlayer.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" #include "IUIScene_HUD.h" IUIScene_HUD::IUIScene_HUD() { diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_HUD.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HUD.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_HUD.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HUD.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_HopperMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HopperMenu.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/IUIScene_HopperMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HopperMenu.cpp index f13419f34..0db96d233 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_HopperMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HopperMenu.cpp @@ -1,6 +1,6 @@ -#include "../../stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_HopperMenu.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_HopperMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_HopperMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HopperMenu.h similarity index 75% rename from Minecraft.Client/Platform/Common/UI/IUIScene_HopperMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HopperMenu.h index a11d33d85..bfc70de2c 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_HopperMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HopperMenu.h @@ -1,8 +1,8 @@ #pragma once #include "IUIScene_AbstractContainerMenu.h" -#include "../../../../Minecraft.World/Containers/Container.h" -#include "../../../../Minecraft.World/Containers/Inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/Container.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/Inventory.h" class IUIScene_HopperMenu : public virtual IUIScene_AbstractContainerMenu { public: diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_HorseInventoryMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HorseInventoryMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/IUIScene_HorseInventoryMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HorseInventoryMenu.cpp index edb469933..bddf4ccef 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_HorseInventoryMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HorseInventoryMenu.cpp @@ -1,6 +1,6 @@ -#include "../../stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_HorseInventoryMenu.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_HorseInventoryMenu::GetSectionAndSlotInDirection( diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_HorseInventoryMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HorseInventoryMenu.h similarity index 74% rename from Minecraft.Client/Platform/Common/UI/IUIScene_HorseInventoryMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HorseInventoryMenu.h index 86a8f09c8..ae02a7fc8 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_HorseInventoryMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_HorseInventoryMenu.h @@ -1,9 +1,9 @@ #pragma once #include "IUIScene_AbstractContainerMenu.h" -#include "../../../../Minecraft.World/Containers/Container.h" -#include "../../../../Minecraft.World/Containers/Inventory.h" -#include "../../../../Minecraft.World/Entities/Mobs/EntityHorse.h" +#include "../../../../../Minecraft.World/net/minecraft/world/Container.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/Inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h" class IUIScene_HorseInventoryMenu : public virtual IUIScene_AbstractContainerMenu { diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_InventoryMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_InventoryMenu.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/IUIScene_InventoryMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_InventoryMenu.cpp index 717d1b481..a804a87ef 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_InventoryMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_InventoryMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" IUIScene_AbstractContainerMenu::ESceneSection IUIScene_InventoryMenu::GetSectionAndSlotInDirection(ESceneSection eSection, diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_InventoryMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_InventoryMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_InventoryMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_InventoryMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_PauseMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/IUIScene_PauseMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp index 6ede8262e..70ffcb2b5 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp @@ -1,19 +1,19 @@ #include #include -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "IUIScene_PauseMenu.h" -#include "UIScene.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../UIScene.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../../net/minecraft/client/ProgressRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../net/minecraft/client/skins/TexturePack.h" +#include "../../../../net/minecraft/client/skins/DLCTexturePack.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" int IUIScene_PauseMenu::ExitGameDialogReturned( void* pParam, int iPad, C4JStorage::EMessageResult result) { diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_PauseMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/IUIScene_PauseMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp index 7ed495e3d..d22b36f4d 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/multiplayer/ClientConnection.h" #include "IUIScene_TradingMenu.h" IUIScene_TradingMenu::IUIScene_TradingMenu() { diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.h similarity index 88% rename from Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.h index 4715fefd5..1a7291ed6 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Minecraft.World/Containers/MerchantMenu.h" -#include "../Minecraft.World/Util/HtmlString.h" -#include "../Minecraft.World/Util/Rarity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/util/HtmlString.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/Rarity.h" class MerchantRecipe; diff --git a/Minecraft.Client/Platform/Common/UI/UIEnums.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/UIEnums.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIEnums.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/UIEnums.h diff --git a/Minecraft.Client/Platform/Common/UI/UIStructs.h b/Minecraft.Client/Common/Source Files/UI/All Platforms/UIStructs.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIStructs.h rename to Minecraft.Client/Common/Source Files/UI/All Platforms/UIStructs.h index 4cba8ce6c..afdccb7fc 100644 --- a/Minecraft.Client/Platform/Common/UI/UIStructs.h +++ b/Minecraft.Client/Common/Source Files/UI/All Platforms/UIStructs.h @@ -5,7 +5,7 @@ #include #include "UIEnums.h" -#include "../App_Defines.h" +#include "../../../App_Defines.h" class Container; class Inventory; diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Chat.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Chat.cpp index 27e41c3b8..c9fe264b1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Chat.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_Chat.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/UI/Gui.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/gui/Gui.h" UIComponent_Chat::UIComponent_Chat(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Chat.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Chat.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Chat.h index 7f63fe4e8..e1d85e9a9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Chat.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" #define CHAT_LINES_COUNT 10 diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIConsole.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIConsole.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIConsole.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIConsole.cpp index 91e234a56..aec46f569 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIConsole.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIConsole.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_DebugUIConsole.h" UIComponent_DebugUIConsole::UIComponent_DebugUIConsole(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIConsole.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIConsole.h similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIConsole.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIConsole.h index fce2571de..242fa91e9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIConsole.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIConsole.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "UIControl_Label.h" +#include "../UIScene.h" +#include "../Controls/UIControl_Label.h" class UIComponent_DebugUIConsole : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIMarketingGuide.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIMarketingGuide.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIMarketingGuide.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIMarketingGuide.cpp index bc24f4746..a2c6b50e8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIMarketingGuide.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIMarketingGuide.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_DebugUIMarketingGuide.h" UIComponent_DebugUIMarketingGuide::UIComponent_DebugUIMarketingGuide( diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIMarketingGuide.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIMarketingGuide.h similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIMarketingGuide.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIMarketingGuide.h index cad8a03d2..2e550ec1d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_DebugUIMarketingGuide.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_DebugUIMarketingGuide.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "UIControl_Label.h" +#include "../UIScene.h" +#include "../Controls/UIControl_Label.h" class UIComponent_DebugUIMarketingGuide : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Logo.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Logo.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Logo.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Logo.cpp index 5489c2a7e..ac5024bfd 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Logo.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Logo.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_Logo.h" UIComponent_Logo::UIComponent_Logo(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Logo.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Logo.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Logo.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Logo.h index 179eaf512..cde241f03 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Logo.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Logo.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIComponent_Logo : public UIScene { public: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_MenuBackground.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_MenuBackground.cpp index 8a8bffe9c..3dcdfd9ed 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_MenuBackground.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_MenuBackground.h" UIComponent_MenuBackground::UIComponent_MenuBackground(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_MenuBackground.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_MenuBackground.h index 5f8ef4129..ad3f4df24 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_MenuBackground.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIComponent_MenuBackground : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Panorama.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Panorama.cpp index 2e096319d..3cc14f485 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Panorama.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_Panorama.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" #include UIComponent_Panorama::UIComponent_Panorama(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Panorama.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Panorama.h index 4a8bf858d..48f7634c9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Panorama.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIComponent_Panorama : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_PressStartToPlay.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_PressStartToPlay.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIComponent_PressStartToPlay.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_PressStartToPlay.cpp index caf942753..107853ca9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_PressStartToPlay.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_PressStartToPlay.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_PressStartToPlay.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIComponent_PressStartToPlay::UIComponent_PressStartToPlay(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_PressStartToPlay.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_PressStartToPlay.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIComponent_PressStartToPlay.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_PressStartToPlay.h index 8752c2a5f..e91da7a41 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_PressStartToPlay.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_PressStartToPlay.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIComponent_PressStartToPlay : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Tooltips.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Tooltips.cpp index c12ff2083..fcd520fe4 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Tooltips.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_Tooltips.h" UIComponent_Tooltips::UIComponent_Tooltips(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Tooltips.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Tooltips.h index c98e847a4..6b54ffb26 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_Tooltips.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIComponent_Tooltips : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_TutorialPopup.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_TutorialPopup.cpp index caae72b52..a770536e6 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_TutorialPopup.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIComponent_TutorialPopup.h" -#include "../Tutorial/Tutorial.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../Tutorial/Tutorial.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" UIComponent_TutorialPopup::UIComponent_TutorialPopup(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.h b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_TutorialPopup.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIComponent_TutorialPopup.h index a1fec6513..2477de825 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIComponent_TutorialPopup.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" #define TUTORIAL_POPUP_FADE_TIMER_ID 0 #define TUTORIAL_POPUP_MOVE_SCENE_TIMER_ID 1 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/Source Files/UI/Components/UIScene_HUD.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp rename to Minecraft.Client/Common/Source Files/UI/Components/UIScene_HUD.cpp index af297d586..ad5dc127e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIScene_HUD.cpp @@ -1,15 +1,15 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_HUD.h" -#include "../../Minecraft.Client/UI/BossMobGuiInfo.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../net/minecraft/client/renderer/BossMobGuiInfo.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../net/minecraft/client/renderer/entity/EnderDragonRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIScene_HUD::UIScene_HUD(int iPad, void* initData, UILayer* parentLayer) : UIScene(iPad, parentLayer) { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HUD.h b/Minecraft.Client/Common/Source Files/UI/Components/UIScene_HUD.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_HUD.h rename to Minecraft.Client/Common/Source Files/UI/Components/UIScene_HUD.h index 08757fd17..c1cfd979e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HUD.h +++ b/Minecraft.Client/Common/Source Files/UI/Components/UIScene_HUD.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "IUIScene_HUD.h" +#include "../UIScene.h" +#include "../All Platforms/IUIScene_HUD.h" #define CHAT_LINES_COUNT 10 diff --git a/Minecraft.Client/Platform/Common/UI/UIControl.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIControl.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp index efe5988ef..1d2060058 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" UIControl::UIControl() { m_parentScene = nullptr; diff --git a/Minecraft.Client/Platform/Common/UI/UIControl.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Base.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UIControl_Base.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp index 82fc597c3..0ee4054f2 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Base.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" UIControl_Base::UIControl_Base() { m_bLabelChanged = false; diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Base.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_Base.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.h index 0aa25e053..c7d22f9e8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Base.h +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.h @@ -1,7 +1,7 @@ #pragma once #include "UIControl.h" -#include "UIString.h" +#include "../UIString.h" // This class maps to the FJ_Base class in actionscript class UIControl_Base : public UIControl { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_BeaconEffectButton.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BeaconEffectButton.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIControl_BeaconEffectButton.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BeaconEffectButton.cpp index 62578a3ec..e9690f430 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_BeaconEffectButton.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BeaconEffectButton.cpp @@ -1,5 +1,5 @@ -#include "../../stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_BeaconEffectButton.h" UIControl_BeaconEffectButton::UIControl_BeaconEffectButton() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_BeaconEffectButton.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BeaconEffectButton.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_BeaconEffectButton.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BeaconEffectButton.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_BitmapIcon.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BitmapIcon.cpp similarity index 92% rename from Minecraft.Client/Platform/Common/UI/UIControl_BitmapIcon.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BitmapIcon.cpp index 3afbbf024..4b9795885 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_BitmapIcon.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BitmapIcon.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_BitmapIcon.h" bool UIControl_BitmapIcon::setupControl(UIScene* scene, IggyValuePath* parent, diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_BitmapIcon.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BitmapIcon.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_BitmapIcon.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_BitmapIcon.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Button.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Button.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIControl_Button.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Button.cpp index 10799e520..893a5c64b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Button.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Button.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_Button.h" UIControl_Button::UIControl_Button() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Button.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Button.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_Button.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Button.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_ButtonList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_ButtonList.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIControl_ButtonList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_ButtonList.cpp index d4f9b2def..ddf756f3d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_ButtonList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_ButtonList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_ButtonList.h" UIControl_ButtonList::UIControl_ButtonList() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_ButtonList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_ButtonList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_ButtonList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_ButtonList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_CheckBox.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_CheckBox.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_CheckBox.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_CheckBox.cpp index 518da6b89..2105c6c77 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_CheckBox.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_CheckBox.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_CheckBox.h" UIControl_CheckBox::UIControl_CheckBox() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_CheckBox.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_CheckBox.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_CheckBox.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_CheckBox.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Cursor.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Cursor.cpp similarity index 82% rename from Minecraft.Client/Platform/Common/UI/UIControl_Cursor.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Cursor.cpp index 78c430475..2e64a4256 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Cursor.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Cursor.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_Cursor.h" UIControl_Cursor::UIControl_Cursor() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Cursor.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Cursor.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_Cursor.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Cursor.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_DLCList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DLCList.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIControl_DLCList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DLCList.cpp index ec1e844c5..32031c558 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_DLCList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DLCList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_DLCList.h" bool UIControl_DLCList::setupControl(UIScene* scene, IggyValuePath* parent, diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_DLCList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DLCList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_DLCList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DLCList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_DynamicLabel.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DynamicLabel.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_DynamicLabel.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DynamicLabel.cpp index 7b8d6605f..b4aed7327 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_DynamicLabel.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DynamicLabel.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_DynamicLabel.h" UIControl_DynamicLabel::UIControl_DynamicLabel() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_DynamicLabel.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DynamicLabel.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_DynamicLabel.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_DynamicLabel.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentBook.cpp similarity index 83% rename from Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentBook.cpp index dc6c4540f..86a34ba35 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentBook.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_EnchantmentBook.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EnchantTableRenderer.h" -#include "../../Minecraft.Client/Rendering/Lighting.h" -#include "../../Minecraft.Client/Rendering/Models/BookModel.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h" +#include "../../../../net/minecraft/client/renderer/tileentity/EnchantTableRenderer.h" +#include "../../../../net/minecraft/client/Lighting.h" +#include "../../../../net/minecraft/client/model/BookModel.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" UIControl_EnchantmentBook::UIControl_EnchantmentBook() { UIControl::setControlType(UIControl::eEnchantmentBook); diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentBook.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentBook.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentButton.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentButton.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentButton.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentButton.cpp index 465c33554..eb82c79e9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentButton.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentButton.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include #include -#include "UI.h" +#include "../UI.h" #include "UIControl_EnchantmentButton.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentButton.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentButton.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentButton.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_EnchantmentButton.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_HTMLLabel.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_HTMLLabel.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_HTMLLabel.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_HTMLLabel.cpp index b9ca898f8..6321ee22d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_HTMLLabel.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_HTMLLabel.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_HTMLLabel.h" UIControl_HTMLLabel::UIControl_HTMLLabel() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_HTMLLabel.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_HTMLLabel.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_HTMLLabel.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_HTMLLabel.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Label.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Label.cpp similarity index 87% rename from Minecraft.Client/Platform/Common/UI/UIControl_Label.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Label.cpp index 11079d42a..f3dc4a12c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Label.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Label.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_Label.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIControl_Label::UIControl_Label() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Label.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Label.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_Label.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Label.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_LeaderboardList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_LeaderboardList.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIControl_LeaderboardList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_LeaderboardList.cpp index daa8233dc..f06a3fbdb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_LeaderboardList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_LeaderboardList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_LeaderboardList.h" UIControl_LeaderboardList::UIControl_LeaderboardList() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_LeaderboardList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_LeaderboardList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_LeaderboardList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_LeaderboardList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_MinecraftHorse.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftHorse.cpp similarity index 78% rename from Minecraft.Client/Platform/Common/UI/UIControl_MinecraftHorse.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftHorse.cpp index 5128cb3ac..53b2b52be 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_MinecraftHorse.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftHorse.cpp @@ -1,26 +1,26 @@ -#include "../../stdafx.h" -#include "../../../../Minecraft.Client/Minecraft.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../net/minecraft/client/Minecraft.h" -#include "../../Minecraft.Client/UI/ScreenSizeCalculator.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h" +#include "../../../../net/minecraft/client/gui/ScreenSizeCalculator.h" +#include "../../../../net/minecraft/client/renderer/entity/EntityRenderDispatcher.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.h" +#include "../../../../net/minecraft/client/renderer/entity/PlayerRenderer.h" +#include "../../../../net/minecraft/client/renderer/entity/HorseRenderer.h" -#include "../../Minecraft.Client/Rendering/Models/HumanoidModel.h" -#include "../../Minecraft.Client/Rendering/Models/ModelHorse.h" +#include "../../../../net/minecraft/client/model/HumanoidModel.h" +#include "../../../../net/minecraft/client/model/ModelHorse.h" -#include "../../Minecraft.Client/Rendering/Lighting.h" -#include "../../Minecraft.Client/Rendering/Models/ModelPart.h" -#include "../../Minecraft.Client/GameState/Options.h" +#include "../../../../net/minecraft/client/Lighting.h" +#include "../../../../net/minecraft/client/model/geom/ModelPart.h" +#include "../../../../net/minecraft/client/Options.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" // #include // "../../../Minecraft.World/net.minecraft.world.entity.animal.EntityHorse.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" -#include "UI.h" +#include "../UI.h" #include "UIControl_MinecraftHorse.h" UIControl_MinecraftHorse::UIControl_MinecraftHorse() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_MinecraftHorse.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftHorse.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_MinecraftHorse.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftHorse.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_MinecraftPlayer.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftPlayer.cpp similarity index 82% rename from Minecraft.Client/Platform/Common/UI/UIControl_MinecraftPlayer.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftPlayer.cpp index 5f51122c3..bddfb59e3 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_MinecraftPlayer.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftPlayer.cpp @@ -1,15 +1,15 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/UI/ScreenSizeCalculator.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h" -#include "../../Minecraft.Client/Rendering/Models/HumanoidModel.h" -#include "../../Minecraft.Client/Rendering/Lighting.h" -#include "../../Minecraft.Client/Rendering/Models/ModelPart.h" -#include "../../Minecraft.Client/GameState/Options.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/gui/ScreenSizeCalculator.h" +#include "../../../../net/minecraft/client/renderer/entity/EntityRenderDispatcher.h" +#include "../../../../net/minecraft/client/renderer/entity/PlayerRenderer.h" +#include "../../../../net/minecraft/client/model/HumanoidModel.h" +#include "../../../../net/minecraft/client/Lighting.h" +#include "../../../../net/minecraft/client/model/geom/ModelPart.h" +#include "../../../../net/minecraft/client/Options.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../UI.h" #include "UIControl_MinecraftPlayer.h" UIControl_MinecraftPlayer::UIControl_MinecraftPlayer() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_MinecraftPlayer.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftPlayer.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_MinecraftPlayer.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_MinecraftPlayer.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerList.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIControl_PlayerList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerList.cpp index 39662bcf5..dd6be17ae 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_PlayerList.h" bool UIControl_PlayerList::setupControl(UIScene* scene, IggyValuePath* parent, diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_PlayerList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp index 47ff9ad80..879b41538 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/UI/ScreenSizeCalculator.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h" -#include "../../Minecraft.Client/Rendering/Models/HumanoidModel.h" -#include "../../Minecraft.Client/Rendering/Lighting.h" -#include "../../Minecraft.Client/Rendering/Models/ModelPart.h" -#include "../../Minecraft.Client/GameState/Options.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/gui/ScreenSizeCalculator.h" +#include "../../../../net/minecraft/client/renderer/entity/EntityRenderDispatcher.h" +#include "../../../../net/minecraft/client/renderer/entity/PlayerRenderer.h" +#include "../../../../net/minecraft/client/model/HumanoidModel.h" +#include "../../../../net/minecraft/client/Lighting.h" +#include "../../../../net/minecraft/client/model/geom/ModelPart.h" +#include "../../../../net/minecraft/client/Options.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" #include "UIControl_PlayerSkinPreview.h" // #define SKIN_PREVIEW_BOB_ANIM diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.h index a9072a91e..050e7836b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.h +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.h @@ -3,7 +3,7 @@ #include #include "UIControl.h" -#include "../../Minecraft.Client/Textures/Textures.h" +#include "../../../../net/minecraft/client/renderer/Textures.h" class ModelPart; class EntityRenderer; diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Progress.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Progress.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_Progress.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Progress.cpp index 9a66ac7bc..9939d2a2a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Progress.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Progress.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_Progress.h" UIControl_Progress::UIControl_Progress() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Progress.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Progress.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_Progress.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Progress.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_SaveList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SaveList.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_SaveList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SaveList.cpp index 7d8f2393c..fb9b15abb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_SaveList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SaveList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_SaveList.h" bool UIControl_SaveList::setupControl(UIScene* scene, IggyValuePath* parent, diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_SaveList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SaveList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_SaveList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SaveList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Slider.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Slider.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_Slider.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Slider.cpp index ca8e9d5ed..93d90df68 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Slider.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Slider.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_Slider.h" UIControl_Slider::UIControl_Slider() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Slider.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Slider.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_Slider.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Slider.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_SlotList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SlotList.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_SlotList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SlotList.cpp index a327ef17e..2686570c1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_SlotList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SlotList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_SlotList.h" UIControl_SlotList::UIControl_SlotList() { m_lastHighlighted = -1; } diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_SlotList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SlotList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_SlotList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SlotList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_SpaceIndicatorBar.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SpaceIndicatorBar.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIControl_SpaceIndicatorBar.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SpaceIndicatorBar.cpp index d5c269f72..b6555c351 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_SpaceIndicatorBar.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SpaceIndicatorBar.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_SpaceIndicatorBar.h" UIControl_SpaceIndicatorBar::UIControl_SpaceIndicatorBar() { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_SpaceIndicatorBar.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SpaceIndicatorBar.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_SpaceIndicatorBar.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_SpaceIndicatorBar.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_TextInput.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TextInput.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIControl_TextInput.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TextInput.cpp index 04aa07fd2..748abfc47 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_TextInput.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TextInput.cpp @@ -1,7 +1,7 @@ -#include "../../stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_TextInput.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIControl_TextInput::UIControl_TextInput() { m_bHasFocus = false; } diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_TextInput.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TextInput.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_TextInput.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TextInput.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_TexturePackList.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TexturePackList.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIControl_TexturePackList.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TexturePackList.cpp index a6ae9d3d0..5293e3d93 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_TexturePackList.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TexturePackList.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_TexturePackList.h" UIControl_TexturePackList::UIControl_TexturePackList() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_TexturePackList.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TexturePackList.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_TexturePackList.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_TexturePackList.h diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Touch.cpp b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Touch.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/UI/UIControl_Touch.cpp rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Touch.cpp index 1e2af852a..92af973bf 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_Touch.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Touch.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIControl_Touch.h" UIControl_Touch::UIControl_Touch() {} diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_Touch.h b/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Touch.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIControl_Touch.h rename to Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Touch.h diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugCreateSchematic.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugCreateSchematic.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp index 6eb2c7bb4..8f25eae73 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugCreateSchematic.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #ifdef _DEBUG_MENUS_ENABLED -#include "UI.h" +#include "../../UI.h" #include "UIScene_DebugCreateSchematic.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" UIScene_DebugCreateSchematic::UIScene_DebugCreateSchematic(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugCreateSchematic.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugCreateSchematic.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugCreateSchematic.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugCreateSchematic.h index 5bc0a2fd4..a567bc77c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugCreateSchematic.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugCreateSchematic.h @@ -1,7 +1,7 @@ #pragma once #ifdef _DEBUG_MENUS_ENABLED -#include "UIScene.h" -#include "../GameRules/ConsoleSchematicFile.h" +#include "../../UIScene.h" +#include "../../../GameRules/LevelGeneration/ConsoleSchematicFile.h" class UIScene_DebugCreateSchematic : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOptions.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOptions.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugOptions.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOptions.cpp index 2222d09af..d6b902812 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOptions.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOptions.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_DebugOptions.h" const wchar_t* diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOptions.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOptions.h similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugOptions.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOptions.h index d0b39feba..69f77b7ee 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOptions.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOptions.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "UIControl_CheckBox.h" +#include "../../UIScene.h" +#include "../../Controls/UIControl_CheckBox.h" class UIScene_DebugOptionsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOverlay.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugOverlay.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOverlay.cpp index c5ff4f767..5ec04c5ab 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOverlay.cpp @@ -1,20 +1,20 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #ifdef _DEBUG_MENUS_ENABLED -#include "UI.h" +#include "../../UI.h" #include "UIScene_DebugOverlay.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Rendering/GameRenderer.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.commands.common.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../../net/minecraft/client/renderer/GameRenderer.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../../Minecraft.World/net/minecraft/commands/common/net.minecraft.commands.common.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h" UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOverlay.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOverlay.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugOverlay.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOverlay.h index 19ea8a6c3..6a4de2247 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugOverlay.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugOverlay.h @@ -1,7 +1,7 @@ #pragma once #ifdef _DEBUG_MENUS_ENABLED -#include "UIScene.h" -#include "UIControl_ButtonList.h" +#include "../../UIScene.h" +#include "../../Controls/UIControl_ButtonList.h" class UIScene_DebugOverlay : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp index 12f1b689f..9aa4a6c5c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #ifdef _DEBUG_MENUS_ENABLED -#include "UI.h" +#include "../../UI.h" #include "UIScene_DebugSetCamera.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIScene_DebugSetCamera::UIScene_DebugSetCamera(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugSetCamera.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugSetCamera.h index 7eb9e0652..02e6318b9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Debug/UIScene_DebugSetCamera.h @@ -1,6 +1,6 @@ #pragma once #ifdef _DEBUG_MENUS_ENABLED -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_DebugSetCamera : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/IUIScene_StartGame.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/IUIScene_StartGame.cpp index 391bc67ae..a37862d60 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/IUIScene_StartGame.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" +#include "../../../../../net/minecraft/client/skins/TexturePack.h" +#include "../../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../../net/minecraft/client/Minecraft.h" #include "IUIScene_StartGame.h" IUIScene_StartGame::IUIScene_StartGame(int iPad, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/IUIScene_StartGame.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/IUIScene_StartGame.h index 23107b331..a68867da1 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/IUIScene_StartGame.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" // Shared functions between CreteWorld, Load and Join class IUIScene_StartGame : public UIScene { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp index 693870700..429501ed8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp @@ -1,21 +1,21 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_CreateWorldMenu.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/GameState/Options.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" -#include "../../Minecraft.World/Level/Storage/LevelSettings.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/WorldGen/Biomes/BiomeSource.h" -#include "../../Minecraft.World/Level/Storage/LevelType.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/Options.h" +#include "../../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../../net/minecraft/client/skins/TexturePack.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/LevelSettings.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/LevelType.h" +#include "../../../../../net/minecraft/client/skins/DLCTexturePack.h" #if defined(_WINDOWS64) #include -#include "../../Minecraft.Client/Platform/Windows64/Resource.h" +#include "../../../../../Windows64/Resource.h" #endif #define GAME_CREATE_ONLINE_TIMER_ID 0 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp index a247ddd5a..31866d974 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_DLCMainMenu.h" #define PLAYER_ONLINE_TIMER_ID 0 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.h index 028e8bc77..6a0890c42 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_DLCMainMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DLCOffersMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_DLCOffersMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp index f9152b84e..1b5cbccf5 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DLCOffersMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp @@ -1,7 +1,7 @@ -#include "../../stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_DLCOffersMenu.h" -#include "../../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #define PLAYER_ONLINE_TIMER_ID 0 #define PLAYER_ONLINE_TIMER_TIME 100 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DLCOffersMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_DLCOffersMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.h index 48047e0b1..fa820558a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DLCOffersMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_DLCOffersMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EULA.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UIScene_EULA.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp index dac3ec507..9348246d3 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EULA.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_EULA.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIScene_EULA::UIScene_EULA(int iPad, void* initData, UILayer* parentLayer) : UIScene(iPad, parentLayer) { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EULA.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_EULA.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_EULA.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_EULA.h index 8f6650b80..db3760cd8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EULA.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_EULA.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_EULA : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Intro.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_Intro.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp index 8b60bc8ce..9bded12c6 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Intro.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_Intro.h" #if !defined(_ENABLEIGGY) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Intro.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_Intro.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_Intro.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_Intro.h index 457d783f9..79c40cc46 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Intro.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_Intro.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_Intro : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp index 75cee2880..aed4abac4 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_JoinMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/GameState/Options.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../../net/minecraft/client/Options.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" #define UPDATE_PLAYERS_TIMER_ID 0 #define UPDATE_PLAYERS_TIMER_TIME 30000 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.h index f45aafc6f..85cc12898 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_JoinMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp index ce1554059..b1e09a6ce 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "UIScene_LaunchMoreOptionsMenu.h" #define GAME_CREATE_ONLINE_TIMER_ID 0 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.h index a65ecc7f1..3cc441602 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_LaunchMoreOptionsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LeaderboardsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_LeaderboardsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp index 5a6cc07c0..8079441f7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LeaderboardsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_LeaderboardsMenu.h" -#include "../Leaderboards/LeaderboardManager.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../Leaderboards/LeaderboardManager.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #define PLAYER_ONLINE_TIMER_ID 0 #define PLAYER_ONLINE_TIMER_TIME 100 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LeaderboardsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_LeaderboardsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.h index 55f98001e..8ce0b84ab 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LeaderboardsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "../Leaderboards/LeaderboardInterface.h" +#include "../../UIScene.h" +#include "../../../Leaderboards/LeaderboardInterface.h" class UIScene_LeaderboardsMenu : public UIScene, public LeaderboardReadListener { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp index f9a2e53ab..4b94d3f8e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_LoadMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/GameState/Options.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.World/Level/Storage/LevelSettings.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../../net/minecraft/client/Options.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/LevelSettings.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../net/minecraft/client/skins/DLCTexturePack.h" #define GAME_CREATE_ONLINE_TIMER_ID 0 #define GAME_CREATE_ONLINE_TIMER_TIME 100 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.h diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp index 5228a5787..3dca0294e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp @@ -1,23 +1,23 @@ #include #include -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_LoadOrJoinMenu.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Minecraft.World/IO/Files/ConsoleSaveFile.h" -#include "../../Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h" -#include "../../Minecraft.World/IO/Files/ConsoleSaveFileSplit.h" -#include "../../Minecraft.World/Util/PortableFileIO.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" -#include "../Network/SessionInfo.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.h" +#include "../../../../../../Minecraft.World/Header Files/PortableFileIO.h" +#include "../../../../../net/minecraft/client/ProgressRenderer.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../../net/minecraft/client/skins/TexturePack.h" +#include "../../../Network/SessionInfo.h" #if defined(SONY_REMOTE_STORAGE_DOWNLOAD) unsigned long UIScene_LoadOrJoinMenu::m_ulFileSize = 0L; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.h index acbfde22d..3dd391902 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class LevelGenerationOptions; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp index 16f493c47..a0803d057 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/Random.h" -#include "../../Minecraft.Client/Player/User.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../net/minecraft/client/User.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../UI.h" #include "UIScene_MainMenu.h" Random* UIScene_MainMenu::random = new Random(); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.h index fc0030506..bea3971e2 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_MainMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_NewUpdateMessage.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_NewUpdateMessage.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp index 2db3ae1f9..e95fe5a3f 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_NewUpdateMessage.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp @@ -1,7 +1,7 @@ -#include "../../stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_NewUpdateMessage.h" -#include "../../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIScene_NewUpdateMessage::UIScene_NewUpdateMessage(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_NewUpdateMessage.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_NewUpdateMessage.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.h index a0fdb8b4c..bf9c13f19 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_NewUpdateMessage.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_NewUpdateMessage : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SaveMessage.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SaveMessage.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp index dfc01b3c6..97897b478 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SaveMessage.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SaveMessage.h" #define PROFILE_LOADED_TIMER_ID 0 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SaveMessage.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SaveMessage.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.h index 2512a08ec..8bf09f2d9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SaveMessage.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_SaveMessage : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TrialExitUpsell.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_TrialExitUpsell.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp index 90a4b3297..da01cfe8d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TrialExitUpsell.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_TrialExitUpsell.h" UIScene_TrialExitUpsell::UIScene_TrialExitUpsell(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TrialExitUpsell.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_TrialExitUpsell.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.h index 8f50f7843..45adf15dd 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TrialExitUpsell.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_TrialExitUpsell : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ControlsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_ControlsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp index dfb3e01d4..3e36d53e1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ControlsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_ControlsMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ControlsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ControlsMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_ControlsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ControlsMenu.h index 2ef0d3b60..b89383bd9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ControlsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ControlsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_ControlsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Credits.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_Credits.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_Credits.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_Credits.cpp index 9b87a1588..e37bbe41a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Credits.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_Credits.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_Credits.h" #define CREDIT_ICON -2 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Credits.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_Credits.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_Credits.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_Credits.h index 8eaf95be9..decb00435 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Credits.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_Credits.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" #define PS3_CREDITS_COUNT 80 #define PSVITA_CREDITS_COUNT 82 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HelpAndOptionsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_HelpAndOptionsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp index 92ed5f199..c6fd1ff45 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HelpAndOptionsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_HelpAndOptionsMenu.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../net/minecraft/client/Minecraft.h" UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HelpAndOptionsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_HelpAndOptionsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.h index 914e6603b..394293a1e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HelpAndOptionsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" #define BUTTON_HAO_CHANGESKIN 0 #define BUTTON_HAO_HOWTOPLAY 1 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlay.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_HowToPlay.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp index d28faf138..dc46c20af 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlay.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_HowToPlay.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" static UIScene_HowToPlay::SHowToPlayPageDef gs_aPageDefs[eHowToPlay_NumPages] = { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlay.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlay.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_HowToPlay.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlay.h index c65c4a450..5fa44c9c9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlay.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlay.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_HowToPlay : public UIScene { public: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlayMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_HowToPlayMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp index 59afe3a72..5cf993dff 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlayMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_HowToPlayMenu.h" // strings for buttons in the list diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlayMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_HowToPlayMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.h index 21f4a44d6..79d63f959 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HowToPlayMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_HowToPlayMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LanguageSelector.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_LanguageSelector.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp index 0b2663c57..063662671 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LanguageSelector.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp @@ -1,5 +1,5 @@ -#include "../../stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_LanguageSelector.h" // strings for buttons in the list diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LanguageSelector.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_LanguageSelector.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_LanguageSelector.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_LanguageSelector.h index 09935308f..bba6e21a7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LanguageSelector.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_LanguageSelector.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" #define HAS_LANGUAGE_SYSTEM(exp) exp, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ReinstallMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_ReinstallMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp index 3ce99d9f2..133ebfa54 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ReinstallMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_ReinstallMenu.h" UIScene_ReinstallMenu::UIScene_ReinstallMenu(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ReinstallMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ReinstallMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_ReinstallMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ReinstallMenu.h index 083986184..0aba528b7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ReinstallMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_ReinstallMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_ReinstallMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsAudioMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsAudioMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp index aff54a89c..7b1c78d76 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsAudioMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SettingsAudioMenu.h" UIScene_SettingsAudioMenu::UIScene_SettingsAudioMenu(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsAudioMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsAudioMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.h index f0230302d..0e9e01ad3 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsAudioMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_SettingsAudioMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsControlMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsControlMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp index e2147cec4..82951966f 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsControlMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SettingsControlMenu.h" UIScene_SettingsControlMenu::UIScene_SettingsControlMenu(int iPad, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsControlMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsControlMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.h index fd5ba20be..b07793d40 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsControlMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_SettingsControlMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsGraphicsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp index c080340b4..42759d1e6 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SettingsGraphicsMenu.h" UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsGraphicsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsGraphicsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.h index 68bc18d6c..858e0242e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsGraphicsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_SettingsGraphicsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp index 9f0312aa8..1a94f487b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SettingsMenu.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../net/minecraft/client/Minecraft.h" UIScene_SettingsMenu::UIScene_SettingsMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsMenu.h index 68233e66a..050b5bf41 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" #define BUTTON_ALL_OPTIONS 0 #define BUTTON_ALL_AUDIO 1 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsOptionsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsOptionsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp index a9cb67994..44970b064 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsOptionsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SettingsOptionsMenu.h" int UIScene_SettingsOptionsMenu::m_iDifficultySettingA[4] = { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsOptionsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsOptionsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.h index 67c30660d..0a9eed586 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsOptionsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_SettingsOptionsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsUIMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsUIMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp index 0dca8b89c..31d604d18 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsUIMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SettingsUIMenu.h" UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsUIMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SettingsUIMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.h index 672656a4b..5f883615d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SettingsUIMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_SettingsUIMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp index d9ac7d17e..aee986cd3 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_SkinSelectMenu.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #define SKIN_SELECT_PACK_DEFAULT 0 #define SKIN_SELECT_PACK_FAVORITES 1 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.h index fe73e686b..1fc442359 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.h @@ -1,9 +1,9 @@ #pragma once #include -#include "../../Minecraft.World/Util/Definitions.h" -#include "UIScene.h" -#include "UIControl_PlayerSkinPreview.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/Definitions.h" +#include "../../UIScene.h" +#include "../../Controls/UIControl_PlayerSkinPreview.h" class UIScene_SkinSelectMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_AbstractContainerMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp index 8bd607c8e..bb34122e2 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" #include "UIScene_AbstractContainerMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" UIScene_AbstractContainerMenu::UIScene_AbstractContainerMenu( int iPad, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_AbstractContainerMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_AbstractContainerMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.h index 6af568230..54fe6ecb3 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_AbstractContainerMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "IUIScene_AbstractContainerMenu.h" +#include "../../../UIScene.h" +#include "../../../All Platforms/IUIScene_AbstractContainerMenu.h" class AbstractContainerMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_AnvilMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_AnvilMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp index 429630a1a..dcc3118ab 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "UIScene_AnvilMenu.h" UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_AnvilMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIScene_AnvilMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h index b0a49a710..f95398320 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_AnvilMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h @@ -1,8 +1,8 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_AnvilMenu.h" -#include "../../Minecraft.World/Containers/MerchantMenu.h" +#include "../../../All Platforms/IUIScene_AnvilMenu.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_BeaconMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_BeaconMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.cpp index 6ffe67f7c..ac2f43f49 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_BeaconMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.cpp @@ -1,8 +1,8 @@ -#include "../../stdafx.h" -#include "UI.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_BeaconMenu.h" UIScene_BeaconMenu::UIScene_BeaconMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_BeaconMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_BeaconMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.h index 6eed4eb70..bf7ce62f6 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_BeaconMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.h @@ -1,8 +1,8 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "UIControl_SlotList.h" -#include "IUIScene_BeaconMenu.h" +#include "../../../Controls/UIControl_SlotList.h" +#include "../../../All Platforms/IUIScene_BeaconMenu.h" class UIScene_BeaconMenu : public UIScene_AbstractContainerMenu, public IUIScene_BeaconMenu { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_BrewingStandMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UIScene_BrewingStandMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.cpp index 58c7f32c9..ff422d42c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_BrewingStandMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.alchemy.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_BrewingStandMenu.h" UIScene_BrewingStandMenu::UIScene_BrewingStandMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_BrewingStandMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_BrewingStandMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.h index 0363645c5..ec81f464b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_BrewingStandMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_BrewingMenu.h" +#include "../../../All Platforms/IUIScene_BrewingMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ContainerMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.cpp similarity index 90% rename from Minecraft.Client/Platform/Common/UI/UIScene_ContainerMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.cpp index 24d866e0e..431a788d0 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ContainerMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.cpp @@ -1,15 +1,15 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" #include "UIScene_ContainerMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../Tutorial/Tutorial.h" -#include "../Tutorial/TutorialMode.h" -#include "../Tutorial/TutorialEnum.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../Tutorial/Tutorial.h" +#include "../../../../Tutorial/TutorialMode.h" +#include "../../../../Tutorial/TutorialEnum.h" UIScene_ContainerMenu::UIScene_ContainerMenu(int iPad, void* _initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ContainerMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_ContainerMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.h index 6e4ab49a4..08895cdfd 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ContainerMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_ContainerMenu.h" +#include "../../../All Platforms/IUIScene_ContainerMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreativeMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_CreativeMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp index 6ea862e8e..ead78db11 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" #include "UIScene_CreativeMenu.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../Tutorial/Tutorial.h" -#include "../Tutorial/TutorialMode.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../../Tutorial/Tutorial.h" +#include "../../../../Tutorial/TutorialMode.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void* _initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreativeMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_CreativeMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.h index 6dc6174a4..4baaabc76 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_CreativeMenu.h" +#include "../../../All Platforms/IUIScene_CreativeMenu.h" class UIScene_CreativeMenu : public UIScene_AbstractContainerMenu, public IUIScene_CreativeMenu { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DispenserMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIScene_DispenserMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.cpp index 00bec865d..fcd59af3e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DispenserMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_DispenserMenu.h" UIScene_DispenserMenu::UIScene_DispenserMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DispenserMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_DispenserMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.h index c7c82c8e7..a64ac3f78 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DispenserMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_DispenserMenu.h" +#include "../../../All Platforms/IUIScene_DispenserMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.cpp index 2d6120943..49f011971 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_EnchantingMenu.h" UIScene_EnchantingMenu::UIScene_EnchantingMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.h index 38d64923b..656104bd9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_EnchantingMenu.h" +#include "../../../All Platforms/IUIScene_EnchantingMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FireworksMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIScene_FireworksMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.cpp index 14ed8d205..052141519 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FireworksMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.cpp @@ -1,9 +1,9 @@ -#include "../../stdafx.h" -#include "UI.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../Minecraft.h" -#include "../../../Player/LocalPlayer.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../../net/minecraft/client/player/LocalPlayer.h" #include "UIScene_FireworksMenu.h" UIScene_FireworksMenu::UIScene_FireworksMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FireworksMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_FireworksMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.h index 12cadef24..8342a6590 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FireworksMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_FireworksMenu.h" +#include "../../../All Platforms/IUIScene_FireworksMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FurnaceMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_FurnaceMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.cpp index f75c21615..7caef4c35 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FurnaceMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_FurnaceMenu.h" UIScene_FurnaceMenu::UIScene_FurnaceMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FurnaceMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_FurnaceMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.h index 6000b1e57..8c371a24c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FurnaceMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_FurnaceMenu.h" +#include "../../../All Platforms/IUIScene_FurnaceMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HopperMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIScene_HopperMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.cpp index 7dc4d3132..3a096a6cd 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HopperMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.cpp @@ -1,8 +1,8 @@ -#include "../../stdafx.h" -#include "UI.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_HopperMenu.h" UIScene_HopperMenu::UIScene_HopperMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HopperMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_HopperMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.h index 39b57109c..e26d76071 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HopperMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_HopperMenu.h" +#include "../../../All Platforms/IUIScene_HopperMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HorseInventoryMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_HorseInventoryMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.cpp index 74b6af17e..1cfabb286 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HorseInventoryMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.cpp @@ -1,9 +1,9 @@ -#include "../../stdafx.h" -#include "UI.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../../Player/MultiPlayerLocalPlayer.h" -#include "../../../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_HorseInventoryMenu.h" UIScene_HorseInventoryMenu::UIScene_HorseInventoryMenu(int iPad, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HorseInventoryMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_HorseInventoryMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.h index ef22502db..c0d87d22c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HorseInventoryMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.h @@ -1,7 +1,7 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_HorseInventoryMenu.h" +#include "../../../All Platforms/IUIScene_HorseInventoryMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.cpp similarity index 91% rename from Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.cpp index adb0f25ff..da2845e4e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.cpp @@ -1,19 +1,19 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" #include "UIScene_InventoryMenu.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/GameState/Options.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Minecraft.Client/Rendering/Lighting.h" -#include "../Tutorial/Tutorial.h" -#include "../Tutorial/TutorialMode.h" -#include "../Tutorial/TutorialEnum.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../../net/minecraft/client/Options.h" +#include "../../../../../../net/minecraft/client/renderer/entity/EntityRenderDispatcher.h" +#include "../../../../../../net/minecraft/client/Lighting.h" +#include "../../../../Tutorial/Tutorial.h" +#include "../../../../Tutorial/TutorialMode.h" +#include "../../../../Tutorial/TutorialEnum.h" #define INVENTORY_UPDATE_EFFECTS_TIMER_ID (10) #define INVENTORY_UPDATE_EFFECTS_TIMER_TIME (1000) // 1 second diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.h similarity index 92% rename from Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.h index 1f5267310..bc22daafc 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.h @@ -1,9 +1,9 @@ #pragma once #include "UIScene_AbstractContainerMenu.h" -#include "IUIScene_InventoryMenu.h" +#include "../../../All Platforms/IUIScene_InventoryMenu.h" -#include "../../Minecraft.World/Entities/MobEffect.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/effect/MobEffect.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp similarity index 93% rename from Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp index 163a31686..7b67926c1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Util/HtmlString.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../UI.h" +#include "../../../../../../../Minecraft.World/net/minecraft/util/HtmlString.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../net/minecraft/client/Minecraft.h" #include "UIScene_TradingMenu.h" UIScene_TradingMenu::UIScene_TradingMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.h index 472827520..c6f37a777 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "IUIScene_TradingMenu.h" +#include "../../../All Platforms/IUIScene_TradingMenu.h" class InventoryMenu; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp index 45e31d4f3..6c6813809 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" #include "UIScene_CraftingMenu.h" UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.h index aa2fd54fe..5f47bdfbd 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.h @@ -1,9 +1,9 @@ #pragma once -#include "UIScene.h" -#include "UIControl_SlotList.h" -#include "UIControl_Label.h" -#include "IUIScene_CraftingMenu.h" +#include "../../UIScene.h" +#include "../../Controls/UIControl_SlotList.h" +#include "../../Controls/UIControl_Label.h" +#include "../../All Platforms/IUIScene_CraftingMenu.h" #define CRAFTING_INVENTORY_SLOT_START 0 #define CRAFTING_INVENTORY_SLOT_END (CRAFTING_INVENTORY_SLOT_START + 27) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp index d459788e6..00e842b2f 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp @@ -1,9 +1,9 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_DeathMenu.h" -#include "IUIScene_PauseMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../All Platforms/IUIScene_PauseMenu.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" UIScene_DeathMenu::UIScene_DeathMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.h index 8abba0428..5f50ce989 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_DeathMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp index 921441038..9e6ff946e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_EndPoem.h" -#include "UIBitmapFont.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../UIBitmapFont.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIScene_EndPoem::UIScene_EndPoem(int iPad, void* initData, UILayer* parentLayer) : UIScene(iPad, parentLayer) { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.h similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.h index d07072225..249342420 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_EndPoem : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGameHostOptionsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGameHostOptionsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp index 9eaab478e..5cf82770a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGameHostOptionsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_InGameHostOptionsMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" UIScene_InGameHostOptionsMenu::UIScene_InGameHostOptionsMenu( int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGameHostOptionsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGameHostOptionsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.h index 9ba522936..9556c43f2 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGameHostOptionsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_InGameHostOptionsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGameInfoMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGameInfoMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp index 68989df18..7af0cba82 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGameInfoMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_InGameInfoMenu.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/multiplayer/ClientConnection.h" UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGameInfoMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGameInfoMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.h index e4141d4b0..ab25fbafd 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGameInfoMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.h @@ -2,7 +2,7 @@ #include -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_InGameInfoMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp index 389cb711d..3566fa052 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp @@ -1,10 +1,10 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_InGamePlayerOptionsMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" #define CHECKBOXES_TIMER_ID 0 #define CHECKBOXES_TIMER_TIME 100 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGamePlayerOptionsMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGamePlayerOptionsMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.h index 07a10c730..2c1a0a49e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGamePlayerOptionsMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.h @@ -2,7 +2,7 @@ #include -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_InGamePlayerOptionsMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGameSaveManagementMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameSaveManagementMenu.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGameSaveManagementMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameSaveManagementMenu.cpp index ed88edf2a..e81465f04 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGameSaveManagementMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameSaveManagementMenu.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_InGameSaveManagementMenu.h" namespace { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InGameSaveManagementMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameSaveManagementMenu.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_InGameSaveManagementMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameSaveManagementMenu.h index 704b4ae86..f41d824ae 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InGameSaveManagementMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_InGameSaveManagementMenu.h @@ -2,7 +2,7 @@ #include -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_InGameSaveManagementMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp similarity index 97% rename from Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp index 72079ed0a..97cbc916a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_PauseMenu.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePack.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../net/minecraft/server/MinecraftServer.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../../../net/minecraft/client/skins/TexturePack.h" +#include "../../../../../net/minecraft/client/skins/DLCTexturePack.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h index 56677c284..8a8b627ff 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h @@ -1,7 +1,7 @@ #pragma once -#include "UIScene.h" -#include "IUIScene_PauseMenu.h" +#include "../../UIScene.h" +#include "../../All Platforms/IUIScene_PauseMenu.h" #define BUTTON_PAUSE_RESUMEGAME 0 #define BUTTON_PAUSE_HELPANDOPTIONS 1 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SignEntryMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp similarity index 89% rename from Minecraft.Client/Platform/Common/UI/UIScene_SignEntryMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp index 17c04b3aa..617300ebb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SignEntryMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp @@ -1,13 +1,13 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "UIScene_SignEntryMenu.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../net/minecraft/client/Minecraft.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" UIScene_SignEntryMenu::UIScene_SignEntryMenu(int iPad, void* _initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SignEntryMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_SignEntryMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.h index cc5372947..3635e762b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SignEntryMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../../UIScene.h" class SignTileEntity; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TeleportMenu.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp similarity index 95% rename from Minecraft.Client/Platform/Common/UI/UIScene_TeleportMenu.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp index 7145df5e2..d18c854e7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TeleportMenu.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp @@ -1,11 +1,11 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../UI.h" #include "UIScene_TeleportMenu.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/Network/ClientConnection.h" -#include "../../Minecraft.Client/Commands/TeleportCommand.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../../../net/minecraft/server/commands/TeleportCommand.h" UIScene_TeleportMenu::UIScene_TeleportMenu(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TeleportMenu.h b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_TeleportMenu.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.h index 35f684d5b..da2e87a78 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TeleportMenu.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.h @@ -2,7 +2,7 @@ #include -#include "UIScene.h" +#include "../../UIScene.h" class UIScene_TeleportMenu : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ConnectingProgress.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_ConnectingProgress.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_ConnectingProgress.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_ConnectingProgress.cpp index c3d9c9a39..c53007dbb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ConnectingProgress.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_ConnectingProgress.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_ConnectingProgress.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../net/minecraft/client/Minecraft.h" UIScene_ConnectingProgress::UIScene_ConnectingProgress(int iPad, void* _initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_ConnectingProgress.h b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_ConnectingProgress.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_ConnectingProgress.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_ConnectingProgress.h index 9491b7a34..b790ef39c 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_ConnectingProgress.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_ConnectingProgress.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIScene_ConnectingProgress : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp index b03c1b7d5..b85ceb17e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp @@ -1,8 +1,8 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_FullscreenProgress.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h" +#include "../../../../net/minecraft/client/Minecraft.h" +#include "../../../../net/minecraft/client/ProgressRenderer.h" UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.h b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.h index 05e9bbc53..478a4374b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIScene_FullscreenProgress : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Keyboard.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Keyboard.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_Keyboard.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Keyboard.cpp index 1bc3f9730..9c975516a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Keyboard.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Keyboard.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_Keyboard.h" #define KEYBOARD_DONE_TIMER_ID 0 diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Keyboard.h b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Keyboard.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_Keyboard.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Keyboard.h index be01bc5ec..12bc5adbb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Keyboard.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Keyboard.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIScene_Keyboard : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_MessageBox.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_MessageBox.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_MessageBox.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_MessageBox.cpp index beb6d3b68..e05241a1e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_MessageBox.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_MessageBox.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_MessageBox.h" UIScene_MessageBox::UIScene_MessageBox(int iPad, void* initData, diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_MessageBox.h b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_MessageBox.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_MessageBox.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_MessageBox.h index e2c978561..981133aad 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_MessageBox.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_MessageBox.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIScene_MessageBox : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_QuadrantSignin.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_QuadrantSignin.cpp index 1ce080998..f68d84795 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_QuadrantSignin.cpp @@ -1,7 +1,7 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_QuadrantSignin.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../net/minecraft/client/Minecraft.h" UIScene_QuadrantSignin::UIScene_QuadrantSignin(int iPad, void* _initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_QuadrantSignin.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_QuadrantSignin.h index 8e3b2aa32..d4d6609c4 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_QuadrantSignin.h @@ -2,7 +2,7 @@ #include -#include "UIScene.h" +#include "../UIScene.h" class UIScene_QuadrantSignin : public UIScene { private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Timer.cpp b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Timer.cpp similarity index 88% rename from Minecraft.Client/Platform/Common/UI/UIScene_Timer.cpp rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Timer.cpp index ab10dfffb..e0c6b96bc 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Timer.cpp +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Timer.cpp @@ -1,5 +1,5 @@ -#include "../../Minecraft.World/Platform/stdafx.h" -#include "UI.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../UI.h" #include "UIScene_Timer.h" UIScene_Timer::UIScene_Timer(int iPad, void* initData, UILayer* parentLayer) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_Timer.h b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Timer.h similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIScene_Timer.h rename to Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Timer.h index c13b389cd..f6a807b02 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_Timer.h +++ b/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_Timer.h @@ -1,6 +1,6 @@ #pragma once -#include "UIScene.h" +#include "../UIScene.h" class UIScene_Timer : public UIScene { private: diff --git a/Minecraft.Client/Common/Source Files/UI/UI.h b/Minecraft.Client/Common/Source Files/UI/UI.h new file mode 100644 index 000000000..da18cf8eb --- /dev/null +++ b/Minecraft.Client/Common/Source Files/UI/UI.h @@ -0,0 +1,119 @@ +#pragma once + +#include "All Platforms/UIEnums.h" +#include "All Platforms/UIStructs.h" + +#include "UIBitmapFont.h" +#include "UITTFFont.h" + +#include "UIScene.h" +#include "UILayer.h" +#include "UIGroup.h" +#include "UIController.h" + +#include "Controls/UIControl.h" +#include "Controls/UIControl_Base.h" +#include "Controls/UIControl_Button.h" +#include "Controls/UIControl_CheckBox.h" +#include "Controls/UIControl_Slider.h" +#include "Controls/UIControl_Label.h" +#include "Controls/UIControl_TextInput.h" +#include "Controls/UIControl_SlotList.h" +#include "Controls/UIControl_Cursor.h" +#include "Controls/UIControl_ButtonList.h" +#include "Controls/UIControl_Progress.h" +#include "Controls/UIControl_TexturePackList.h" +#include "Controls/UIControl_LeaderboardList.h" +#include "Controls/UIControl_SaveList.h" +#include "Controls/UIControl_PlayerList.h" +#include "Controls/UIControl_BitmapIcon.h" +#include "Controls/UIControl_DLCList.h" +#include "Controls/UIControl_HTMLLabel.h" +#include "Controls/UIControl_DynamicLabel.h" +#include "Controls/UIControl_MinecraftPlayer.h" +#include "Controls/UIControl_MinecraftHorse.h" +#include "Controls/UIControl_PlayerSkinPreview.h" +#include "Controls/UIControl_EnchantmentButton.h" +#include "Controls/UIControl_EnchantmentBook.h" +#include "Controls/UIControl_SpaceIndicatorBar.h" +#include "Controls/UIControl_BeaconEffectButton.h" + +#include "Components/UIScene_HUD.h" +#include "Components/UIComponent_Panorama.h" +#include "Components/UIComponent_Logo.h" +#include "Components/UIComponent_Tooltips.h" +#include "Components/UIComponent_TutorialPopup.h" +#include "Components/UIComponent_Chat.h" +#include "Components/UIComponent_PressStartToPlay.h" +#include "Components/UIComponent_MenuBackground.h" + +#include "Scenes/UIScene_QuadrantSignin.h" +#include "Scenes/UIScene_MessageBox.h" +#include "Scenes/UIScene_Timer.h" +#include "Scenes/UIScene_Keyboard.h" + +#include "Scenes/Debug/UIScene_DebugOverlay.h" +#include "Scenes/Debug/UIScene_DebugOptions.h" +#include "Components/UIComponent_DebugUIConsole.h" +#include "Components/UIComponent_DebugUIMarketingGuide.h" +#include "Scenes/Debug/UIScene_DebugSetCamera.h" +#include "Scenes/Debug/UIScene_DebugCreateSchematic.h" + +#include "Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.h" +#include "Scenes/Frontend Menu screens/UIScene_Intro.h" +#include "Scenes/Frontend Menu screens/UIScene_SaveMessage.h" +#include "Scenes/Frontend Menu screens/UIScene_MainMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_LoadMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_JoinMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.h" +#include "Scenes/UIScene_FullscreenProgress.h" +#include "Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_DLCMainMenu.h" +#include "Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.h" +#include "Scenes/Help & Options/UIScene_ReinstallMenu.h" + +#include "Scenes/Help & Options/UIScene_HelpAndOptionsMenu.h" +#include "Scenes/Help & Options/UIScene_SettingsMenu.h" +#include "Scenes/Help & Options/UIScene_SettingsOptionsMenu.h" +#include "Scenes/Help & Options/UIScene_SettingsAudioMenu.h" +#include "Scenes/Help & Options/UIScene_SettingsControlMenu.h" +#include "Scenes/Help & Options/UIScene_SettingsGraphicsMenu.h" +#include "Scenes/Help & Options/UIScene_SettingsUIMenu.h" +#include "Scenes/Help & Options/UIScene_SkinSelectMenu.h" +#include "Scenes/Help & Options/UIScene_HowToPlayMenu.h" +#include "Scenes/Help & Options/UIScene_LanguageSelector.h" +#include "Scenes/Help & Options/UIScene_HowToPlay.h" +#include "Scenes/Help & Options/UIScene_ControlsMenu.h" +#include "Scenes/Help & Options/UIScene_Credits.h" + +#include "Scenes/In-Game Menu Screens/UIScene_PauseMenu.h" + +#include "Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_BrewingStandMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_ContainerMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_DispenserMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_FurnaceMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_HopperMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_BeaconMenu.h" +#include "Scenes/In-Game Menu Screens/Containers/UIScene_FireworksMenu.h" + +#include "Scenes/In-Game Menu Screens/UIScene_CraftingMenu.h" +#include "Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.h" + +#include "Scenes/UIScene_ConnectingProgress.h" +#include "Scenes/In-Game Menu Screens/UIScene_DeathMenu.h" +#include "Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.h" +#include "Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.h" +#include "Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.h" +#include "Scenes/In-Game Menu Screens/UIScene_TeleportMenu.h" +#include "Scenes/In-Game Menu Screens/UIScene_EndPoem.h" +#include "Scenes/Frontend Menu screens/UIScene_EULA.h" +#include "Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.h" \ No newline at end of file diff --git a/Minecraft.Client/Platform/Common/UI/UIBitmapFont.cpp b/Minecraft.Client/Common/Source Files/UI/UIBitmapFont.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIBitmapFont.cpp rename to Minecraft.Client/Common/Source Files/UI/UIBitmapFont.cpp index f6c0d0603..9c2793dd5 100644 --- a/Minecraft.Client/Platform/Common/UI/UIBitmapFont.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UIBitmapFont.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../Minecraft.Client/Textures/BufferedImage.h" +#include "../../../Header Files/BufferedImage.h" #include "UIFontData.h" #include diff --git a/Minecraft.Client/Platform/Common/UI/UIBitmapFont.h b/Minecraft.Client/Common/Source Files/UI/UIBitmapFont.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIBitmapFont.h rename to Minecraft.Client/Common/Source Files/UI/UIBitmapFont.h diff --git a/Minecraft.Client/Platform/Common/UI/UIController.cpp b/Minecraft.Client/Common/Source Files/UI/UIController.cpp similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIController.cpp rename to Minecraft.Client/Common/Source Files/UI/UIController.cpp index 341b9d78e..7e25ef816 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UIController.cpp @@ -1,16 +1,16 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "UIController.h" #include "UI.h" #include "UIScene.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.Client/UI/Screens/TitleScreen.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../net/minecraft/client/skins/DLCTexturePack.h" +#include "../../../net/minecraft/client/skins/TexturePackRepository.h" +#include "../../../net/minecraft/client/Minecraft.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../net/minecraft/client/renderer/entity/EnderDragonRenderer.h" +#include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../net/minecraft/client/title/TitleScreen.h" #include "UIFontData.h" // 4J Stu - Enable this to override the Iggy Allocator @@ -19,7 +19,7 @@ // #define ENABLE_IGGY_EXPLORER #if defined(ENABLE_IGGY_EXPLORER) -#include "../../Minecraft.Client/Platform/Windows64/Iggy/include/iggyexpruntime.h" +#include "../../../Windows64/Iggy/include/iggyexpruntime.h" #endif // #define ENABLE_IGGY_PERFMON @@ -29,7 +29,7 @@ #define PM_ORIGIN_Y 34 #if defined(__WINDOWS64) -#include "../../Minecraft.Client/Platform/Windows64/Iggy/include/iggyperfmon.h" +#include "../../../Windows64/Iggy/include/iggyperfmon.h" #endif #endif diff --git a/Minecraft.Client/Platform/Common/UI/UIController.h b/Minecraft.Client/Common/Source Files/UI/UIController.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIController.h rename to Minecraft.Client/Common/Source Files/UI/UIController.h index 09223ba6d..903a03b65 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.h +++ b/Minecraft.Client/Common/Source Files/UI/UIController.h @@ -3,8 +3,8 @@ #include #include -#include "IUIController.h" -#include "UIEnums.h" +#include "All Platforms/IUIController.h" +#include "All Platforms/UIEnums.h" #include "UIGroup.h" class UIAbstractBitmapFont; diff --git a/Minecraft.Client/Platform/Common/UI/UIFontData.cpp b/Minecraft.Client/Common/Source Files/UI/UIFontData.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIFontData.cpp rename to Minecraft.Client/Common/Source Files/UI/UIFontData.cpp index 51dee10e7..34e7139e0 100644 --- a/Minecraft.Client/Platform/Common/UI/UIFontData.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UIFontData.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "UIFontData.h" ///////////////////////////////////////////////////// diff --git a/Minecraft.Client/Platform/Common/UI/UIFontData.h b/Minecraft.Client/Common/Source Files/UI/UIFontData.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIFontData.h rename to Minecraft.Client/Common/Source Files/UI/UIFontData.h diff --git a/Minecraft.Client/Platform/Common/UI/UIGroup.cpp b/Minecraft.Client/Common/Source Files/UI/UIGroup.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIGroup.cpp rename to Minecraft.Client/Common/Source Files/UI/UIGroup.cpp index 03efb921c..758b00cc7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIGroup.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UIGroup.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "UIGroup.h" UIGroup::UIGroup(EUIGroup group, int iPad) { diff --git a/Minecraft.Client/Platform/Common/UI/UIGroup.h b/Minecraft.Client/Common/Source Files/UI/UIGroup.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UIGroup.h rename to Minecraft.Client/Common/Source Files/UI/UIGroup.h index 7057b8d12..2bf4046e7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIGroup.h +++ b/Minecraft.Client/Common/Source Files/UI/UIGroup.h @@ -1,6 +1,6 @@ #pragma once #include "UILayer.h" -#include "UIEnums.h" +#include "All Platforms/UIEnums.h" class UIComponent_Tooltips; class UIComponent_TutorialPopup; diff --git a/Minecraft.Client/Platform/Common/UI/UILayer.cpp b/Minecraft.Client/Common/Source Files/UI/UILayer.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UILayer.cpp rename to Minecraft.Client/Common/Source Files/UI/UILayer.cpp index 9be214373..675f9957c 100644 --- a/Minecraft.Client/Platform/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UILayer.cpp @@ -1,4 +1,4 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "UI.h" #include "UILayer.h" #include "UIScene.h" diff --git a/Minecraft.Client/Platform/Common/UI/UILayer.h b/Minecraft.Client/Common/Source Files/UI/UILayer.h similarity index 98% rename from Minecraft.Client/Platform/Common/UI/UILayer.h rename to Minecraft.Client/Common/Source Files/UI/UILayer.h index 831b34b66..fb34c1b3c 100644 --- a/Minecraft.Client/Platform/Common/UI/UILayer.h +++ b/Minecraft.Client/Common/Source Files/UI/UILayer.h @@ -1,5 +1,5 @@ #pragma once -#include "UIEnums.h" +#include "All Platforms/UIEnums.h" // using namespace std; class UIScene; class UIGroup; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.cpp b/Minecraft.Client/Common/Source Files/UI/UIScene.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene.cpp rename to Minecraft.Client/Common/Source Files/UI/UIScene.cpp index 632273c6b..77befbd1d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UIScene.cpp @@ -1,12 +1,12 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include #include "UI.h" #include "UIScene.h" -#include "../../Minecraft.Client/Rendering/Lighting.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../net/minecraft/client/Lighting.h" +#include "../../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../net/minecraft/client/renderer/entity/ItemRenderer.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" UIScene::UIScene(int iPad, UILayer* parentLayer) { m_parentLayer = parentLayer; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.h b/Minecraft.Client/Common/Source Files/UI/UIScene.h similarity index 99% rename from Minecraft.Client/Platform/Common/UI/UIScene.h rename to Minecraft.Client/Common/Source Files/UI/UIScene.h index c7a0edfea..0314f9bcf 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/Source Files/UI/UIScene.h @@ -7,8 +7,8 @@ #include -#include "UIEnums.h" -#include "UIControl_Base.h" +#include "All Platforms/UIEnums.h" +#include "Controls/UIControl_Base.h" class ItemRenderer; class UILayer; diff --git a/Minecraft.Client/Platform/Common/UI/UIString.cpp b/Minecraft.Client/Common/Source Files/UI/UIString.cpp similarity index 96% rename from Minecraft.Client/Platform/Common/UI/UIString.cpp rename to Minecraft.Client/Common/Source Files/UI/UIString.cpp index 07afa1eb0..91f59b0c2 100644 --- a/Minecraft.Client/Platform/Common/UI/UIString.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UIString.cpp @@ -1,6 +1,6 @@ -#include "../../stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" -#include "../../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "UIString.h" diff --git a/Minecraft.Client/Platform/Common/UI/UIString.h b/Minecraft.Client/Common/Source Files/UI/UIString.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UIString.h rename to Minecraft.Client/Common/Source Files/UI/UIString.h diff --git a/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp b/Minecraft.Client/Common/Source Files/UI/UITTFFont.cpp similarity index 94% rename from Minecraft.Client/Platform/Common/UI/UITTFFont.cpp rename to Minecraft.Client/Common/Source Files/UI/UITTFFont.cpp index 71db8d0dd..44f0f7ef0 100644 --- a/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp +++ b/Minecraft.Client/Common/Source Files/UI/UITTFFont.cpp @@ -1,6 +1,6 @@ -#include "../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "UI.h" -#include "../../Minecraft.World/Util/PortableFileIO.h" +#include "../../../../Minecraft.World/Header Files/PortableFileIO.h" #include "UITTFFont.h" UITTFFont::UITTFFont(const std::string& name, const std::string& path, diff --git a/Minecraft.Client/Platform/Common/UI/UITTFFont.h b/Minecraft.Client/Common/Source Files/UI/UITTFFont.h similarity index 100% rename from Minecraft.Client/Platform/Common/UI/UITTFFont.h rename to Minecraft.Client/Common/Source Files/UI/UITTFFont.h diff --git a/Minecraft.Client/Platform/Common/C4JMemoryPool.h b/Minecraft.Client/ConsoleHelpers/C4JMemoryPool.h similarity index 100% rename from Minecraft.Client/Platform/Common/C4JMemoryPool.h rename to Minecraft.Client/ConsoleHelpers/C4JMemoryPool.h diff --git a/Minecraft.Client/Platform/Common/C4JMemoryPoolAllocator.h b/Minecraft.Client/ConsoleHelpers/C4JMemoryPoolAllocator.h similarity index 100% rename from Minecraft.Client/Platform/Common/C4JMemoryPoolAllocator.h rename to Minecraft.Client/ConsoleHelpers/C4JMemoryPoolAllocator.h diff --git a/Minecraft.Client/GameState/DispenserBootstrap.cpp b/Minecraft.Client/GameState/DispenserBootstrap.cpp deleted file mode 100644 index 7eaa38011..000000000 --- a/Minecraft.Client/GameState/DispenserBootstrap.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "../Platform/stdafx.h" \ No newline at end of file diff --git a/Minecraft.Client/GameState/StatsSyncer.cpp b/Minecraft.Client/GameState/StatsSyncer.cpp deleted file mode 100644 index 1e33aafa4..000000000 --- a/Minecraft.Client/GameState/StatsSyncer.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "../Platform/stdafx.h" -#include "StatsSyncer.h" - -// 4J - TODO \ No newline at end of file diff --git a/Minecraft.Client/Textures/BufferedImage.h b/Minecraft.Client/Header Files/BufferedImage.h similarity index 100% rename from Minecraft.Client/Textures/BufferedImage.h rename to Minecraft.Client/Header Files/BufferedImage.h diff --git a/Minecraft.Client/Utils/FrameProfiler.h b/Minecraft.Client/Header Files/FrameProfiler.h similarity index 100% rename from Minecraft.Client/Utils/FrameProfiler.h rename to Minecraft.Client/Header Files/FrameProfiler.h diff --git a/Minecraft.Client/Textures/MemTexture.h b/Minecraft.Client/Header Files/MemTexture.h similarity index 100% rename from Minecraft.Client/Textures/MemTexture.h rename to Minecraft.Client/Header Files/MemTexture.h diff --git a/Minecraft.Client/Textures/MemTextureProcessor.h b/Minecraft.Client/Header Files/MemTextureProcessor.h similarity index 100% rename from Minecraft.Client/Textures/MemTextureProcessor.h rename to Minecraft.Client/Header Files/MemTextureProcessor.h diff --git a/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.spa.h b/Minecraft.Client/Header Files/Minecraft.spa.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.spa.h rename to Minecraft.Client/Header Files/Minecraft.spa.h diff --git a/Minecraft.Client/Textures/MobSkinMemTextureProcessor.h b/Minecraft.Client/Header Files/MobSkinMemTextureProcessor.h similarity index 100% rename from Minecraft.Client/Textures/MobSkinMemTextureProcessor.h rename to Minecraft.Client/Header Files/MobSkinMemTextureProcessor.h diff --git a/Minecraft.Client/Rendering/Models/SkinBox.h b/Minecraft.Client/Header Files/SkinBox.h similarity index 100% rename from Minecraft.Client/Rendering/Models/SkinBox.h rename to Minecraft.Client/Header Files/SkinBox.h diff --git a/Minecraft.Client/Platform/extraX64client.h b/Minecraft.Client/Header Files/extraX64client.h similarity index 100% rename from Minecraft.Client/Platform/extraX64client.h rename to Minecraft.Client/Header Files/extraX64client.h diff --git a/Minecraft.Client/Header Files/stdafx.h b/Minecraft.Client/Header Files/stdafx.h new file mode 100644 index 000000000..8dde1a3d9 --- /dev/null +++ b/Minecraft.Client/Header Files/stdafx.h @@ -0,0 +1,153 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +// #include +// #include + +#define __STR2__(x) #x +#define __STR1__(x) __STR2__(x) +#define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : 4J Warning Msg: " + +// use - #pragma message(__LOC__"Need to do something here") + +#include +#include +#include +#include +#include + +#ifdef __linux__ +#include "../Linux/Stubs/LinuxStubs.h" +#endif + +#ifdef _WINDOWS64 +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#include +#include +#include +#include +#include +using namespace DirectX; + +#define HRESULT_SUCCEEDED(hr) (((int32_t)(hr)) >= 0) +#endif + +#include "../../Minecraft.World/x64headers/extraX64.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "../../Minecraft.World/ConsoleHelpers/Definitions.h" +#include "../../Minecraft.World/ConsoleJavaLibs/Class.h" +#include "../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +#include "../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../Minecraft.World/Header Files/compression.h" +#include "../../Minecraft.World/ConsoleHelpers/PerformanceTimer.h" + +#ifdef _WINDOWS64 +#include "../Platform/Windows64/4JLibs/inc/4J_Input.h" +#include "../Platform/Windows64/4JLibs/inc/4J_Profile.h" +#include "../Platform/Windows64/4JLibs/inc/4J_Render.h" +#include "../Platform/Windows64/4JLibs/inc/4J_Storage.h" +#else +#include "4J_Input.h" +#include "4J_Profile.h" +#include "4J_Render.h" +#include "4J_Storage.h" +#endif + +#include "../net/minecraft/client/renderer/Textures.h" +#include "../net/minecraft/client/gui/Font.h" +#include "../net/minecraft/client/ClientConstants.h" +#include "../net/minecraft/client/gui/Gui.h" +#include "../net/minecraft/client/gui/Screen.h" +#include "../net/minecraft/client/gui/ScreenSizeCalculator.h" +#include "../net/minecraft/client/Minecraft.h" +#include "../net/minecraft/client/MemoryTracker.h" +#include "stubs.h" +#include "BufferedImage.h" + +#include "../Common/Source Files/Network/GameNetworkManager.h" + +#include "../Common/Source Files/UI/All Platforms/UIEnums.h" +#include "../Common/Source Files/UI/All Platforms/UIStructs.h" +#include "../Common/App_Defines.h" +#include "../Common/App_enums.h" +#include "../Common/Source Files/Tutorial/TutorialEnum.h" +#include "../Common/App_structs.h" + +#include "../Common/Consoles_App.h" +#include "../Common/Minecraft_Macros.h" +#include "../Common/Source Files/BuildVer/BuildVer.h" + +// This is generated at build time via scripts/pack_loc.py +#include "strings.h" + +#ifdef _WINDOWS64 +#include "../Windows64/Source Files/Sentient/MinecraftTelemetry.h" +#include "../Windows64/Windows64_App.h" +#include "../Windows64/Source Files/Sentient/DynamicConfigurations.h" +#include "../Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "Minecraft.spa.h" +#include "../Windows64/XML/ATGXmlParser.h" +#include "../Windows64/Source Files/Social/SocialManager.h" +#include "../Common/Source Files/Audio/SoundEngine.h" +#include "../Windows64/Iggy/include/iggy.h" +#include "../Windows64/Iggy/gdraw/gdraw_d3d11.h" +#include "../Windows64/Windows64_UIController.h" +#else +// Linux build: keep the Linux runtime/controller path and use the supported +// Linux/Windows64 metadata headers only. +#include "../Linux/Linux_App.h" +#include "../Windows64/Iggy/include/iggy.h" +#include "../Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "../Windows64/Source Files/Sentient/DynamicConfigurations.h" +#include "Minecraft.spa.h" +#include "../Common/Source Files/Audio/SoundEngine.h" +#include "../Linux/Linux_UIController.h" +#include "../Windows64/Source Files/Social/SocialManager.h" +#endif + +#include "../Common/Source Files/ConsoleGameMode.h" +#include "../Common/Source Files/Console_Debug_enum.h" +#include "../Common/Source Files/Console_Awards_enum.h" +#include "../Common/Source Files/Tutorial/TutorialMode.h" +#include "../Common/Source Files/Tutorial/Tutorial.h" +#include "../Common/Source Files/Tutorial/FullTutorialMode.h" +#include "../Common/Source Files/Trial/TrialMode.h" +#include "../Common/Source Files/GameRules/ConsoleGameRules.h" +#include "../Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h" +#include "../Common/Source Files/Colours/ColourTable.h" +#include "../Common/Source Files/DLC/DLCSkinFile.h" +#include "../Common/Source Files/DLC/DLCManager.h" +#include "../Common/Source Files/DLC/DLCPack.h" +#include "../Common/Source Files/Telemetry/TelemetryManager.h" + +#include "extraX64client.h" + +#ifdef _FINAL_BUILD +#define printf BREAKTHECOMPILE +#define wprintf BREAKTHECOMPILE +#undef OutputDebugString +#define OutputDebugString BREAKTHECOMPILE +#define OutputDebugStringA BREAKTHECOMPILE +#define OutputDebugStringW BREAKTHECOMPILE +#endif + +void MemSect(int sect); diff --git a/Minecraft.Client/Platform/stubs.h b/Minecraft.Client/Header Files/stubs.h similarity index 100% rename from Minecraft.Client/Platform/stubs.h rename to Minecraft.Client/Header Files/stubs.h diff --git a/Minecraft.Client/Platform/Linux/Iggy/gdraw/gdraw.c b/Minecraft.Client/Linux/Iggy/gdraw/gdraw.c similarity index 99% rename from Minecraft.Client/Platform/Linux/Iggy/gdraw/gdraw.c rename to Minecraft.Client/Linux/Iggy/gdraw/gdraw.c index 4fde9a91f..4670f4c67 100644 --- a/Minecraft.Client/Platform/Linux/Iggy/gdraw/gdraw.c +++ b/Minecraft.Client/Linux/Iggy/gdraw/gdraw.c @@ -1,8 +1,8 @@ #define GDRAW_ASSERTS -#include "../../../Windows64/Iggy/include/iggy.h" -#include "../../../Windows64/Iggy/include/gdraw.h" -#include "gdraw.h" +#include "../../../../Windows64/Iggy/include/iggy.h" +#include "../../../../Windows64/Iggy/include/gdraw.h" +#include "../../../../Windows64/Iggy/include/gdraw.h" #include #include @@ -684,7 +684,7 @@ static void gdraw_FramebufferRenderbufferSafe(GLenum target, GLenum attachment, #define glFramebufferRenderbuffer_SAFE gdraw_FramebufferRenderbufferSafe #define glFramebufferRenderbuffer glFramebufferRenderbuffer_SAFE -#include "../../../Windows64/Iggy/gdraw/gdraw_gl_shared.inl" +#include "../../../../Windows64/Iggy/gdraw/gdraw_gl_shared.inl" #undef glVertexAttribPointer #define glVertexAttribPointer gdraw_real_vtxattrib diff --git a/Minecraft.Client/Platform/Linux/Iggy/gdraw/gdraw.h b/Minecraft.Client/Linux/Iggy/gdraw/gdraw.h similarity index 94% rename from Minecraft.Client/Platform/Linux/Iggy/gdraw/gdraw.h rename to Minecraft.Client/Linux/Iggy/gdraw/gdraw.h index 8e0b3aa17..9852143d8 100644 --- a/Minecraft.Client/Platform/Linux/Iggy/gdraw/gdraw.h +++ b/Minecraft.Client/Linux/Iggy/gdraw/gdraw.h @@ -1,8 +1,8 @@ #ifndef __LINUX_IGGY_GDRAW_H__ #define __LINUX_IGGY_GDRAW_H__ -#include "../../../Windows64/Iggy/include/gdraw.h" -#include "../../../Windows64/Iggy/include/iggy.h" +#include "../../../../Windows64/Iggy/include/gdraw.h" +#include "../../../../Windows64/Iggy/include/iggy.h" #ifdef __cplusplus extern "C" { diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/gdraw.h b/Minecraft.Client/Linux/Iggy/include/gdraw.h similarity index 99% rename from Minecraft.Client/Platform/Windows64/Iggy/include/gdraw.h rename to Minecraft.Client/Linux/Iggy/include/gdraw.h index ab41d5075..3e28fb560 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/include/gdraw.h +++ b/Minecraft.Client/Linux/Iggy/include/gdraw.h @@ -6,7 +6,7 @@ #ifndef __RAD_INCLUDE_GDRAW_H__ #define __RAD_INCLUDE_GDRAW_H__ -#include "../../Miles/include/rrcore.h" +#include "../../../../Windows64/Miles Sound System/Include/rrcore.h" #define IDOC diff --git a/Minecraft.Client/Platform/Linux/Iggy/include/iggy.h b/Minecraft.Client/Linux/Iggy/include/iggy.h similarity index 99% rename from Minecraft.Client/Platform/Linux/Iggy/include/iggy.h rename to Minecraft.Client/Linux/Iggy/include/iggy.h index 46e75ea41..5d43d46ac 100644 --- a/Minecraft.Client/Platform/Linux/Iggy/include/iggy.h +++ b/Minecraft.Client/Linux/Iggy/include/iggy.h @@ -8,7 +8,7 @@ #define IggyVersion "1.2.30" #define IggyFlashVersion "9,1,2,30" -#include "../../../Windows64/Miles/include/rrcore.h" // base data types, macros +#include "../../../../Windows64/Miles Sound System/Include/rrcore.h" // base data types, macros RADDEFSTART diff --git a/Minecraft.Client/Platform/Linux/Iggy/include/rrCore.h b/Minecraft.Client/Linux/Iggy/include/rrCore.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Iggy/include/rrCore.h rename to Minecraft.Client/Linux/Iggy/include/rrCore.h diff --git a/Minecraft.Client/Platform/Linux/Leaderboards/LinuxLeaderboardManager.cpp b/Minecraft.Client/Linux/Leaderboards/LinuxLeaderboardManager.cpp similarity index 77% rename from Minecraft.Client/Platform/Linux/Leaderboards/LinuxLeaderboardManager.cpp rename to Minecraft.Client/Linux/Leaderboards/LinuxLeaderboardManager.cpp index 3c82b10a2..a71d37cd6 100644 --- a/Minecraft.Client/Platform/Linux/Leaderboards/LinuxLeaderboardManager.cpp +++ b/Minecraft.Client/Linux/Leaderboards/LinuxLeaderboardManager.cpp @@ -1,4 +1,4 @@ -#include "../../../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "LinuxLeaderboardManager.h" diff --git a/Minecraft.Client/Platform/Linux/Leaderboards/LinuxLeaderboardManager.h b/Minecraft.Client/Linux/Leaderboards/LinuxLeaderboardManager.h similarity index 95% rename from Minecraft.Client/Platform/Linux/Leaderboards/LinuxLeaderboardManager.h rename to Minecraft.Client/Linux/Leaderboards/LinuxLeaderboardManager.h index 641622381..5aa7b1b2d 100644 --- a/Minecraft.Client/Platform/Linux/Leaderboards/LinuxLeaderboardManager.h +++ b/Minecraft.Client/Linux/Leaderboards/LinuxLeaderboardManager.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Common/Leaderboards/LeaderboardManager.h" +#include "../../../Common/Source Files/Leaderboards/LeaderboardManager.h" class LinuxLeaderboardManager : public LeaderboardManager { public: diff --git a/Minecraft.Client/Platform/Linux/LinuxGL.cpp b/Minecraft.Client/Linux/LinuxGL.cpp similarity index 95% rename from Minecraft.Client/Platform/Linux/LinuxGL.cpp rename to Minecraft.Client/Linux/LinuxGL.cpp index c7fff72d5..2d0cd3372 100644 --- a/Minecraft.Client/Platform/Linux/LinuxGL.cpp +++ b/Minecraft.Client/Linux/LinuxGL.cpp @@ -1,11 +1,11 @@ #ifdef __linux__ -#include "../stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #include "4J_Render.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" -#include "../../Minecraft.World/IO/Streams/ByteBuffer.h" +#include "../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" extern C4JRender RenderManager; diff --git a/Minecraft.Client/Platform/Linux/LinuxGL.h b/Minecraft.Client/Linux/LinuxGL.h similarity index 100% rename from Minecraft.Client/Platform/Linux/LinuxGL.h rename to Minecraft.Client/Linux/LinuxGL.h diff --git a/Minecraft.Client/Platform/Linux/Linux_App.cpp b/Minecraft.Client/Linux/Linux_App.cpp similarity index 87% rename from Minecraft.Client/Platform/Linux/Linux_App.cpp rename to Minecraft.Client/Linux/Linux_App.cpp index e7d5d629a..9065d6e48 100644 --- a/Minecraft.Client/Platform/Linux/Linux_App.cpp +++ b/Minecraft.Client/Linux/Linux_App.cpp @@ -1,14 +1,14 @@ -#include "../../../Minecraft.World/Platform/stdafx.h" -#include "../Common/Consoles_App.h" -#include "../../Player/User.h" -#include "../../Minecraft.h" -#include "../../MinecraftServer.h" -#include "../../Network/PlayerList.h" -#include "../../Player/ServerPlayer.h" -#include "../../../Minecraft.World/Level/Level.h" -#include "../../../Minecraft.World/Level/Storage/LevelSettings.h" -#include "../../../Minecraft.World/WorldGen/Biomes/BiomeSource.h" -#include "../../../Minecraft.World/Level/Storage/LevelType.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" +#include "../../Common/Consoles_App.h" +#include "../../net/minecraft/client/User.h" +#include "../../net/minecraft/client/Minecraft.h" +#include "../../net/minecraft/server/MinecraftServer.h" +#include "../../net/minecraft/server/PlayerList.h" +#include "../../net/minecraft/server/level/ServerPlayer.h" +#include "../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../Minecraft.World/net/minecraft/world/level/LevelSettings.h" +#include "../../../Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h" +#include "../../../Minecraft.World/net/minecraft/world/level/LevelType.h" #include "Linux_App.h" CConsoleMinecraftApp app; diff --git a/Minecraft.Client/Platform/Linux/Linux_App.h b/Minecraft.Client/Linux/Linux_App.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Linux_App.h rename to Minecraft.Client/Linux/Linux_App.h diff --git a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp b/Minecraft.Client/Linux/Linux_Minecraft.cpp similarity index 96% rename from Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp rename to Minecraft.Client/Linux/Linux_Minecraft.cpp index ecfcb7dc5..939bef0a5 100644 --- a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp +++ b/Minecraft.Client/Linux/Linux_Minecraft.cpp @@ -1,7 +1,7 @@ // Minecraft.cpp : Defines the entry point for the application. // -#include "../../../Minecraft.World/Platform/stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #include #include @@ -38,36 +38,36 @@ static void sigsegv_handler(int sig) { _exit(139); } #endif -#include "../Windows64/GameConfig/Minecraft.spa.h" -#include "../../MinecraftServer.h" -#include "../../Player/LocalPlayer.h" -#include "../../../Minecraft.World/Items/ItemInstance.h" -#include "../../../Minecraft.World/Items/MapItem.h" -#include "../../../Minecraft.World/Recipes/Recipes.h" -#include "../../../Minecraft.World/Recipes/Recipy.h" -#include "../../../Minecraft.World/Util/Language.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Util/AABB.h" -#include "../../../Minecraft.World/Util/Vec3.h" -#include "../../../Minecraft.World/Level/Level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../Header Files/Minecraft.spa.h" +#include "../../net/minecraft/server/MinecraftServer.h" +#include "../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" +#include "../../../Minecraft.World/net/minecraft/world/item/MapItem.h" +#include "../../../Minecraft.World/net/minecraft/world/item/crafting/Recipes.h" +#include "../../../Minecraft.World/net/minecraft/world/item/crafting/Recipy.h" +#include "../../../Minecraft.World/net/minecraft/locale/Language.h" +#include "../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" +#include "../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" -#include "../../Network/ClientConnection.h" -#include "../../Player/User.h" -#include "../../../Minecraft.World/Network/Socket.h" -#include "../../../Minecraft.World/Util/ThreadName.h" -#include "../../GameState/StatsCounter.h" -#include "../../UI/Screens/ConnectScreen.h" -// #include "../Durango/Social/SocialManager.h" -// #include "../Common/Leaderboards/LeaderboardManager.h" +#include "../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../net/minecraft/client/User.h" +#include "../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../Minecraft.World/ConsoleHelpers/ThreadName.h" +#include "../../net/minecraft/stats/StatsCounter.h" +#include "../../net/minecraft/client/multiplayer/ConnectScreen.h" +// #include "../../Windows64/Source Files/Social/SocialManager.h" +// #include "../../Common/Source Files/Leaderboards/LeaderboardManager.h" // #include "../Common/XUI/XUI_Scene_Container.h" // #include "NetworkManager.h" -#include "../../Rendering/Tesselator.h" -#include "../../GameState/Options.h" -#include "../Linux/Sentient/SentientManager.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/IO/Streams/Compression.h" -#include "../../../Minecraft.World/Level/Storage/OldChunkStorage.h" +#include "../../net/minecraft/client/renderer/Tesselator.h" +#include "../../net/minecraft/client/Options.h" +#include "../../Windows64/Source Files/Sentient/SentientManager.h" +#include "../../net/minecraft/client/renderer/Textures.h" +#include "../../../Minecraft.World/Header Files/compression.h" +#include "../../../Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h" // #include "../Orbis/Leaderboards/OrbisLeaderboardManager.h" // #include "../Orbis/Network/Orbis_NPToolkit.h" diff --git a/Minecraft.Client/Platform/Linux/Linux_ShutdownManager.cpp b/Minecraft.Client/Linux/Linux_ShutdownManager.cpp similarity index 86% rename from Minecraft.Client/Platform/Linux/Linux_ShutdownManager.cpp rename to Minecraft.Client/Linux/Linux_ShutdownManager.cpp index a2137cefb..fc5405d7c 100644 --- a/Minecraft.Client/Platform/Linux/Linux_ShutdownManager.cpp +++ b/Minecraft.Client/Linux/Linux_ShutdownManager.cpp @@ -1,7 +1,7 @@ // Linux stub implementations for ShutdownManager // The PS3/PSVita versions have full implementations; on Linux these are no-ops. -#include "../../Platform/stdafx.h" -#include "../Common/ShutdownManager.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" +#include "../../Common/ShutdownManager.h" void ShutdownManager::Initialise() {} void ShutdownManager::StartShutdown() {} diff --git a/Minecraft.Client/Platform/Linux/Linux_UIController.cpp b/Minecraft.Client/Linux/Linux_UIController.cpp similarity index 97% rename from Minecraft.Client/Platform/Linux/Linux_UIController.cpp rename to Minecraft.Client/Linux/Linux_UIController.cpp index 855c10b9d..c56136a99 100644 --- a/Minecraft.Client/Platform/Linux/Linux_UIController.cpp +++ b/Minecraft.Client/Linux/Linux_UIController.cpp @@ -1,8 +1,8 @@ -#include "../../../Minecraft.World/Platform/stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #include "Linux_UIController.h" // GDraw GL backend for Linux -#include "Iggy/gdraw/gdraw.h" +#include "../../Windows64/Iggy/include/gdraw.h" ConsoleUIController ui; diff --git a/Minecraft.Client/Platform/Linux/Linux_UIController.h b/Minecraft.Client/Linux/Linux_UIController.h similarity index 94% rename from Minecraft.Client/Platform/Linux/Linux_UIController.h rename to Minecraft.Client/Linux/Linux_UIController.h index ff0a6521e..9e5037f04 100644 --- a/Minecraft.Client/Platform/Linux/Linux_UIController.h +++ b/Minecraft.Client/Linux/Linux_UIController.h @@ -1,6 +1,6 @@ #pragma once -#include "../Common/UI/UIController.h" +#include "../../Common/Source Files/UI/UIController.h" class ConsoleUIController : public UIController { public: diff --git a/Minecraft.Client/Platform/Linux/Sentient/DynamicConfigurations.h b/Minecraft.Client/Linux/Sentient/DynamicConfigurations.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Sentient/DynamicConfigurations.h rename to Minecraft.Client/Linux/Sentient/DynamicConfigurations.h diff --git a/Minecraft.Client/Linux/Sentient/MinecraftTelemetry.h b/Minecraft.Client/Linux/Sentient/MinecraftTelemetry.h new file mode 100644 index 000000000..9b85def6d --- /dev/null +++ b/Minecraft.Client/Linux/Sentient/MinecraftTelemetry.h @@ -0,0 +1,4 @@ +#pragma once +#include "../../../Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "../../../Windows64/Source Files/Sentient/TelemetryEnum.h" +#include "../../../Windows64/Source Files/Sentient/SentientStats.h" \ No newline at end of file diff --git a/Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h b/Minecraft.Client/Linux/Sentient/SentientManager.h similarity index 98% rename from Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h rename to Minecraft.Client/Linux/Sentient/SentientManager.h index 8101745af..5b2a5f92c 100644 --- a/Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h +++ b/Minecraft.Client/Linux/Sentient/SentientManager.h @@ -1,5 +1,5 @@ #pragma once -#include "MinecraftTelemetry.h" +#include "../../../Windows64/Source Files/Sentient/MinecraftTelemetry.h" class CSentientManager { public: diff --git a/Minecraft.Client/Platform/Linux/Sentient/SentientStats.h b/Minecraft.Client/Linux/Sentient/SentientStats.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Sentient/SentientStats.h rename to Minecraft.Client/Linux/Sentient/SentientStats.h diff --git a/Minecraft.Client/Platform/Linux/Sentient/SentientTelemetryCommon.h b/Minecraft.Client/Linux/Sentient/SentientTelemetryCommon.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Sentient/SentientTelemetryCommon.h rename to Minecraft.Client/Linux/Sentient/SentientTelemetryCommon.h diff --git a/Minecraft.Client/Platform/Linux/Sentient/TelemetryEnum.h b/Minecraft.Client/Linux/Sentient/TelemetryEnum.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Sentient/TelemetryEnum.h rename to Minecraft.Client/Linux/Sentient/TelemetryEnum.h diff --git a/Minecraft.Client/Platform/Linux/Social/SocialManager.h b/Minecraft.Client/Linux/Social/SocialManager.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Social/SocialManager.h rename to Minecraft.Client/Linux/Social/SocialManager.h diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXCollision.h b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXCollision.h similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXCollision.h rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXCollision.h index b1d24621a..6605197bd 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXCollision.h +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXCollision.h @@ -1,448 +1,448 @@ -//------------------------------------------------------------------------------------- -// DirectXCollision.h -- C++ Collision Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -#include "DirectXMath.h" - -namespace DirectX { - -enum ContainmentType { DISJOINT = 0, INTERSECTS = 1, CONTAINS = 2 }; - -enum PlaneIntersectionType { FRONT = 0, INTERSECTING = 1, BACK = 2 }; - -struct BoundingBox; -struct BoundingOrientedBox; -struct BoundingFrustum; - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4324 4820) -// C4324: alignment padding warnings -// C4820: Off by default noise -#endif - -//------------------------------------------------------------------------------------- -// Bounding sphere -//------------------------------------------------------------------------------------- -struct BoundingSphere { - XMFLOAT3 Center; // Center of the sphere. - float Radius; // Radius of the sphere. - - // Creators - BoundingSphere() noexcept : Center(0, 0, 0), Radius(1.f) {} - - BoundingSphere(const BoundingSphere&) = default; - BoundingSphere& operator=(const BoundingSphere&) = default; - - BoundingSphere(BoundingSphere&&) = default; - BoundingSphere& operator=(BoundingSphere&&) = default; - - constexpr BoundingSphere(_In_ const XMFLOAT3& center, - _In_ float radius) noexcept - : Center(center), Radius(radius) {} - - // Methods - void XM_CALLCONV Transform(_Out_ BoundingSphere& Out, - _In_ FXMMATRIX M) const noexcept; - void XM_CALLCONV Transform(_Out_ BoundingSphere& Out, _In_ float Scale, - _In_ FXMVECTOR Rotation, - _In_ FXMVECTOR Translation) const noexcept; - // Transform the sphere - - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; - ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; - ContainmentType Contains( - _In_ const BoundingOrientedBox& box) const noexcept; - ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; - - bool Intersects(_In_ const BoundingSphere& sh) const noexcept; - bool Intersects(_In_ const BoundingBox& box) const noexcept; - bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; - bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - // Triangle-sphere test - - PlaneIntersectionType XM_CALLCONV - Intersects(_In_ FXMVECTOR Plane) const noexcept; - // Plane-sphere test - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, - _Out_ float& Dist) const noexcept; - // Ray-sphere test - - ContainmentType XM_CALLCONV - ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, - _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, - _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; - // Test sphere against six planes (see BoundingFrustum::GetPlanes) - - // Static methods - static void CreateMerged(_Out_ BoundingSphere& Out, - _In_ const BoundingSphere& S1, - _In_ const BoundingSphere& S2) noexcept; - - static void CreateFromBoundingBox(_Out_ BoundingSphere& Out, - _In_ const BoundingBox& box) noexcept; - static void CreateFromBoundingBox( - _Out_ BoundingSphere& Out, - _In_ const BoundingOrientedBox& box) noexcept; - - static void CreateFromPoints(_Out_ BoundingSphere& Out, _In_ size_t Count, - _In_reads_bytes_(sizeof(XMFLOAT3) + - Stride * (Count - 1)) - const XMFLOAT3* pPoints, - _In_ size_t Stride) noexcept; - - static void CreateFromFrustum(_Out_ BoundingSphere& Out, - _In_ const BoundingFrustum& fr) noexcept; -}; - -//------------------------------------------------------------------------------------- -// Axis-aligned bounding box -//------------------------------------------------------------------------------------- -struct BoundingBox { - static constexpr size_t CORNER_COUNT = 8; - - XMFLOAT3 Center; // Center of the box. - XMFLOAT3 Extents; // Distance from the center to each side. - - // Creators - BoundingBox() noexcept : Center(0, 0, 0), Extents(1.f, 1.f, 1.f) {} - - BoundingBox(const BoundingBox&) = default; - BoundingBox& operator=(const BoundingBox&) = default; - - BoundingBox(BoundingBox&&) = default; - BoundingBox& operator=(BoundingBox&&) = default; - - constexpr BoundingBox(_In_ const XMFLOAT3& center, - _In_ const XMFLOAT3& extents) noexcept - : Center(center), Extents(extents) {} - - // Methods - void XM_CALLCONV Transform(_Out_ BoundingBox& Out, - _In_ FXMMATRIX M) const noexcept; - void XM_CALLCONV Transform(_Out_ BoundingBox& Out, _In_ float Scale, - _In_ FXMVECTOR Rotation, - _In_ FXMVECTOR Translation) const noexcept; - - void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; - // Gets the 8 corners of the box - - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; - ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; - ContainmentType Contains( - _In_ const BoundingOrientedBox& box) const noexcept; - ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; - - bool Intersects(_In_ const BoundingSphere& sh) const noexcept; - bool Intersects(_In_ const BoundingBox& box) const noexcept; - bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; - bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - // Triangle-Box test - - PlaneIntersectionType XM_CALLCONV - Intersects(_In_ FXMVECTOR Plane) const noexcept; - // Plane-box test - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, - _Out_ float& Dist) const noexcept; - // Ray-Box test - - ContainmentType XM_CALLCONV - ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, - _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, - _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; - // Test box against six planes (see BoundingFrustum::GetPlanes) - - // Static methods - static void CreateMerged(_Out_ BoundingBox& Out, _In_ const BoundingBox& b1, - _In_ const BoundingBox& b2) noexcept; - - static void CreateFromSphere(_Out_ BoundingBox& Out, - _In_ const BoundingSphere& sh) noexcept; - - static void XM_CALLCONV CreateFromPoints(_Out_ BoundingBox& Out, - _In_ FXMVECTOR pt1, - _In_ FXMVECTOR pt2) noexcept; - static void CreateFromPoints(_Out_ BoundingBox& Out, _In_ size_t Count, - _In_reads_bytes_(sizeof(XMFLOAT3) + - Stride * (Count - 1)) - const XMFLOAT3* pPoints, - _In_ size_t Stride) noexcept; -}; - -//------------------------------------------------------------------------------------- -// Oriented bounding box -//------------------------------------------------------------------------------------- -struct BoundingOrientedBox { - static constexpr size_t CORNER_COUNT = 8; - - XMFLOAT3 Center; // Center of the box. - XMFLOAT3 Extents; // Distance from the center to each side. - XMFLOAT4 - Orientation; // Unit quaternion representing rotation (box -> world). - - // Creators - BoundingOrientedBox() noexcept - : Center(0, 0, 0), Extents(1.f, 1.f, 1.f), Orientation(0, 0, 0, 1.f) {} - - BoundingOrientedBox(const BoundingOrientedBox&) = default; - BoundingOrientedBox& operator=(const BoundingOrientedBox&) = default; - - BoundingOrientedBox(BoundingOrientedBox&&) = default; - BoundingOrientedBox& operator=(BoundingOrientedBox&&) = default; - - constexpr BoundingOrientedBox(_In_ const XMFLOAT3& center, - _In_ const XMFLOAT3& extents, - _In_ const XMFLOAT4& orientation) noexcept - : Center(center), Extents(extents), Orientation(orientation) {} - - // Methods - void XM_CALLCONV Transform(_Out_ BoundingOrientedBox& Out, - _In_ FXMMATRIX M) const noexcept; - void XM_CALLCONV Transform(_Out_ BoundingOrientedBox& Out, _In_ float Scale, - _In_ FXMVECTOR Rotation, - _In_ FXMVECTOR Translation) const noexcept; - - void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; - // Gets the 8 corners of the box - - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; - ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; - ContainmentType Contains( - _In_ const BoundingOrientedBox& box) const noexcept; - ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; - - bool Intersects(_In_ const BoundingSphere& sh) const noexcept; - bool Intersects(_In_ const BoundingBox& box) const noexcept; - bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; - bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - // Triangle-OrientedBox test - - PlaneIntersectionType XM_CALLCONV - Intersects(_In_ FXMVECTOR Plane) const noexcept; - // Plane-OrientedBox test - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, - _Out_ float& Dist) const noexcept; - // Ray-OrientedBox test - - ContainmentType XM_CALLCONV - ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, - _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, - _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; - // Test OrientedBox against six planes (see BoundingFrustum::GetPlanes) - - // Static methods - static void CreateFromBoundingBox(_Out_ BoundingOrientedBox& Out, - _In_ const BoundingBox& box) noexcept; - - static void CreateFromPoints(_Out_ BoundingOrientedBox& Out, - _In_ size_t Count, - _In_reads_bytes_(sizeof(XMFLOAT3) + - Stride * (Count - 1)) - const XMFLOAT3* pPoints, - _In_ size_t Stride) noexcept; -}; - -//------------------------------------------------------------------------------------- -// Bounding frustum -//------------------------------------------------------------------------------------- -struct BoundingFrustum { - static constexpr size_t CORNER_COUNT = 8; - - XMFLOAT3 Origin; // Origin of the frustum (and projection). - XMFLOAT4 Orientation; // Quaternion representing rotation. - - float RightSlope; // Positive X (X/Z) - float LeftSlope; // Negative X - float TopSlope; // Positive Y (Y/Z) - float BottomSlope; // Negative Y - float Near, Far; // Z of the near plane and far plane. - - // Creators - BoundingFrustum() noexcept - : Origin(0, 0, 0), - Orientation(0, 0, 0, 1.f), - RightSlope(1.f), - LeftSlope(-1.f), - TopSlope(1.f), - BottomSlope(-1.f), - Near(0), - Far(1.f) {} - - BoundingFrustum(const BoundingFrustum&) = default; - BoundingFrustum& operator=(const BoundingFrustum&) = default; - - BoundingFrustum(BoundingFrustum&&) = default; - BoundingFrustum& operator=(BoundingFrustum&&) = default; - - constexpr BoundingFrustum(_In_ const XMFLOAT3& origin, - _In_ const XMFLOAT4& orientation, - _In_ float rightSlope, _In_ float leftSlope, - _In_ float topSlope, _In_ float bottomSlope, - _In_ float nearPlane, - _In_ float farPlane) noexcept - : Origin(origin), - Orientation(orientation), - RightSlope(rightSlope), - LeftSlope(leftSlope), - TopSlope(topSlope), - BottomSlope(bottomSlope), - Near(nearPlane), - Far(farPlane) {} - BoundingFrustum(_In_ CXMMATRIX Projection, bool rhcoords = false) noexcept; - - // Methods - void XM_CALLCONV Transform(_Out_ BoundingFrustum& Out, - _In_ FXMMATRIX M) const noexcept; - void XM_CALLCONV Transform(_Out_ BoundingFrustum& Out, _In_ float Scale, - _In_ FXMVECTOR Rotation, - _In_ FXMVECTOR Translation) const noexcept; - - void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; - // Gets the 8 corners of the frustum - - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; - ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - ContainmentType Contains(_In_ const BoundingSphere& sp) const noexcept; - ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; - ContainmentType Contains( - _In_ const BoundingOrientedBox& box) const noexcept; - ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; - // Frustum-Frustum test - - bool Intersects(_In_ const BoundingSphere& sh) const noexcept; - bool Intersects(_In_ const BoundingBox& box) const noexcept; - bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; - bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) const noexcept; - // Triangle-Frustum test - - PlaneIntersectionType XM_CALLCONV - Intersects(_In_ FXMVECTOR Plane) const noexcept; - // Plane-Frustum test - - bool XM_CALLCONV Intersects(_In_ FXMVECTOR rayOrigin, - _In_ FXMVECTOR Direction, - _Out_ float& Dist) const noexcept; - // Ray-Frustum test - - ContainmentType XM_CALLCONV - ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, - _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, - _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; - // Test frustum against six planes (see BoundingFrustum::GetPlanes) - - void GetPlanes(_Out_opt_ XMVECTOR* NearPlane, _Out_opt_ XMVECTOR* FarPlane, - _Out_opt_ XMVECTOR* RightPlane, - _Out_opt_ XMVECTOR* LeftPlane, _Out_opt_ XMVECTOR* TopPlane, - _Out_opt_ XMVECTOR* BottomPlane) const noexcept; - // Create 6 Planes representation of Frustum - - // Static methods - static void XM_CALLCONV CreateFromMatrix(_Out_ BoundingFrustum& Out, - _In_ FXMMATRIX Projection, - bool rhcoords = false) noexcept; -}; - -//----------------------------------------------------------------------------- -// Triangle intersection testing routines. -//----------------------------------------------------------------------------- -namespace TriangleTests { -bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, - _In_ FXMVECTOR V0, _In_ GXMVECTOR V1, - _In_ HXMVECTOR V2, _Out_ float& Dist) noexcept; -// Ray-Triangle - -bool XM_CALLCONV Intersects(_In_ FXMVECTOR A0, _In_ FXMVECTOR A1, - _In_ FXMVECTOR A2, _In_ GXMVECTOR B0, - _In_ HXMVECTOR B1, _In_ HXMVECTOR B2) noexcept; -// Triangle-Triangle - -PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR V0, - _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2, - _In_ GXMVECTOR Plane) noexcept; -// Plane-Triangle - -ContainmentType XM_CALLCONV -ContainedBy(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2, - _In_ GXMVECTOR Plane0, _In_ HXMVECTOR Plane1, _In_ HXMVECTOR Plane2, - _In_ CXMVECTOR Plane3, _In_ CXMVECTOR Plane4, - _In_ CXMVECTOR Plane5) noexcept; -// Test a triangle against six planes at once (see BoundingFrustum::GetPlanes) -} // namespace TriangleTests - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * Implementation - * - ****************************************************************************/ - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4068 4365 4616 6001) -// C4068/4616: ignore unknown pragmas -// C4365: Off by default noise -// C6001: False positives -#endif - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") -#pragma prefast(disable : 26495, "Union initialization confuses /analyze") -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wfloat-equal" -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" -#endif - -#include "DirectXCollision.inl" - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -} // namespace DirectX +//------------------------------------------------------------------------------------- +// DirectXCollision.h -- C++ Collision Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#include "DirectXMath.h" + +namespace DirectX { + +enum ContainmentType { DISJOINT = 0, INTERSECTS = 1, CONTAINS = 2 }; + +enum PlaneIntersectionType { FRONT = 0, INTERSECTING = 1, BACK = 2 }; + +struct BoundingBox; +struct BoundingOrientedBox; +struct BoundingFrustum; + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4324 4820) +// C4324: alignment padding warnings +// C4820: Off by default noise +#endif + +//------------------------------------------------------------------------------------- +// Bounding sphere +//------------------------------------------------------------------------------------- +struct BoundingSphere { + XMFLOAT3 Center; // Center of the sphere. + float Radius; // Radius of the sphere. + + // Creators + BoundingSphere() noexcept : Center(0, 0, 0), Radius(1.f) {} + + BoundingSphere(const BoundingSphere&) = default; + BoundingSphere& operator=(const BoundingSphere&) = default; + + BoundingSphere(BoundingSphere&&) = default; + BoundingSphere& operator=(BoundingSphere&&) = default; + + constexpr BoundingSphere(_In_ const XMFLOAT3& center, + _In_ float radius) noexcept + : Center(center), Radius(radius) {} + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingSphere& Out, + _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingSphere& Out, _In_ float Scale, + _In_ FXMVECTOR Rotation, + _In_ FXMVECTOR Translation) const noexcept; + // Transform the sphere + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains( + _In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + // Triangle-sphere test + + PlaneIntersectionType XM_CALLCONV + Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-sphere test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, + _Out_ float& Dist) const noexcept; + // Ray-sphere test + + ContainmentType XM_CALLCONV + ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, + _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, + _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test sphere against six planes (see BoundingFrustum::GetPlanes) + + // Static methods + static void CreateMerged(_Out_ BoundingSphere& Out, + _In_ const BoundingSphere& S1, + _In_ const BoundingSphere& S2) noexcept; + + static void CreateFromBoundingBox(_Out_ BoundingSphere& Out, + _In_ const BoundingBox& box) noexcept; + static void CreateFromBoundingBox( + _Out_ BoundingSphere& Out, + _In_ const BoundingOrientedBox& box) noexcept; + + static void CreateFromPoints(_Out_ BoundingSphere& Out, _In_ size_t Count, + _In_reads_bytes_(sizeof(XMFLOAT3) + + Stride * (Count - 1)) + const XMFLOAT3* pPoints, + _In_ size_t Stride) noexcept; + + static void CreateFromFrustum(_Out_ BoundingSphere& Out, + _In_ const BoundingFrustum& fr) noexcept; +}; + +//------------------------------------------------------------------------------------- +// Axis-aligned bounding box +//------------------------------------------------------------------------------------- +struct BoundingBox { + static constexpr size_t CORNER_COUNT = 8; + + XMFLOAT3 Center; // Center of the box. + XMFLOAT3 Extents; // Distance from the center to each side. + + // Creators + BoundingBox() noexcept : Center(0, 0, 0), Extents(1.f, 1.f, 1.f) {} + + BoundingBox(const BoundingBox&) = default; + BoundingBox& operator=(const BoundingBox&) = default; + + BoundingBox(BoundingBox&&) = default; + BoundingBox& operator=(BoundingBox&&) = default; + + constexpr BoundingBox(_In_ const XMFLOAT3& center, + _In_ const XMFLOAT3& extents) noexcept + : Center(center), Extents(extents) {} + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingBox& Out, + _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingBox& Out, _In_ float Scale, + _In_ FXMVECTOR Rotation, + _In_ FXMVECTOR Translation) const noexcept; + + void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; + // Gets the 8 corners of the box + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains( + _In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + // Triangle-Box test + + PlaneIntersectionType XM_CALLCONV + Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-box test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, + _Out_ float& Dist) const noexcept; + // Ray-Box test + + ContainmentType XM_CALLCONV + ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, + _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, + _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test box against six planes (see BoundingFrustum::GetPlanes) + + // Static methods + static void CreateMerged(_Out_ BoundingBox& Out, _In_ const BoundingBox& b1, + _In_ const BoundingBox& b2) noexcept; + + static void CreateFromSphere(_Out_ BoundingBox& Out, + _In_ const BoundingSphere& sh) noexcept; + + static void XM_CALLCONV CreateFromPoints(_Out_ BoundingBox& Out, + _In_ FXMVECTOR pt1, + _In_ FXMVECTOR pt2) noexcept; + static void CreateFromPoints(_Out_ BoundingBox& Out, _In_ size_t Count, + _In_reads_bytes_(sizeof(XMFLOAT3) + + Stride * (Count - 1)) + const XMFLOAT3* pPoints, + _In_ size_t Stride) noexcept; +}; + +//------------------------------------------------------------------------------------- +// Oriented bounding box +//------------------------------------------------------------------------------------- +struct BoundingOrientedBox { + static constexpr size_t CORNER_COUNT = 8; + + XMFLOAT3 Center; // Center of the box. + XMFLOAT3 Extents; // Distance from the center to each side. + XMFLOAT4 + Orientation; // Unit quaternion representing rotation (box -> world). + + // Creators + BoundingOrientedBox() noexcept + : Center(0, 0, 0), Extents(1.f, 1.f, 1.f), Orientation(0, 0, 0, 1.f) {} + + BoundingOrientedBox(const BoundingOrientedBox&) = default; + BoundingOrientedBox& operator=(const BoundingOrientedBox&) = default; + + BoundingOrientedBox(BoundingOrientedBox&&) = default; + BoundingOrientedBox& operator=(BoundingOrientedBox&&) = default; + + constexpr BoundingOrientedBox(_In_ const XMFLOAT3& center, + _In_ const XMFLOAT3& extents, + _In_ const XMFLOAT4& orientation) noexcept + : Center(center), Extents(extents), Orientation(orientation) {} + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingOrientedBox& Out, + _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingOrientedBox& Out, _In_ float Scale, + _In_ FXMVECTOR Rotation, + _In_ FXMVECTOR Translation) const noexcept; + + void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; + // Gets the 8 corners of the box + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sh) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains( + _In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + // Triangle-OrientedBox test + + PlaneIntersectionType XM_CALLCONV + Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-OrientedBox test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, + _Out_ float& Dist) const noexcept; + // Ray-OrientedBox test + + ContainmentType XM_CALLCONV + ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, + _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, + _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test OrientedBox against six planes (see BoundingFrustum::GetPlanes) + + // Static methods + static void CreateFromBoundingBox(_Out_ BoundingOrientedBox& Out, + _In_ const BoundingBox& box) noexcept; + + static void CreateFromPoints(_Out_ BoundingOrientedBox& Out, + _In_ size_t Count, + _In_reads_bytes_(sizeof(XMFLOAT3) + + Stride * (Count - 1)) + const XMFLOAT3* pPoints, + _In_ size_t Stride) noexcept; +}; + +//------------------------------------------------------------------------------------- +// Bounding frustum +//------------------------------------------------------------------------------------- +struct BoundingFrustum { + static constexpr size_t CORNER_COUNT = 8; + + XMFLOAT3 Origin; // Origin of the frustum (and projection). + XMFLOAT4 Orientation; // Quaternion representing rotation. + + float RightSlope; // Positive X (X/Z) + float LeftSlope; // Negative X + float TopSlope; // Positive Y (Y/Z) + float BottomSlope; // Negative Y + float Near, Far; // Z of the near plane and far plane. + + // Creators + BoundingFrustum() noexcept + : Origin(0, 0, 0), + Orientation(0, 0, 0, 1.f), + RightSlope(1.f), + LeftSlope(-1.f), + TopSlope(1.f), + BottomSlope(-1.f), + Near(0), + Far(1.f) {} + + BoundingFrustum(const BoundingFrustum&) = default; + BoundingFrustum& operator=(const BoundingFrustum&) = default; + + BoundingFrustum(BoundingFrustum&&) = default; + BoundingFrustum& operator=(BoundingFrustum&&) = default; + + constexpr BoundingFrustum(_In_ const XMFLOAT3& origin, + _In_ const XMFLOAT4& orientation, + _In_ float rightSlope, _In_ float leftSlope, + _In_ float topSlope, _In_ float bottomSlope, + _In_ float nearPlane, + _In_ float farPlane) noexcept + : Origin(origin), + Orientation(orientation), + RightSlope(rightSlope), + LeftSlope(leftSlope), + TopSlope(topSlope), + BottomSlope(bottomSlope), + Near(nearPlane), + Far(farPlane) {} + BoundingFrustum(_In_ CXMMATRIX Projection, bool rhcoords = false) noexcept; + + // Methods + void XM_CALLCONV Transform(_Out_ BoundingFrustum& Out, + _In_ FXMMATRIX M) const noexcept; + void XM_CALLCONV Transform(_Out_ BoundingFrustum& Out, _In_ float Scale, + _In_ FXMVECTOR Rotation, + _In_ FXMVECTOR Translation) const noexcept; + + void GetCorners(_Out_writes_(8) XMFLOAT3* Corners) const noexcept; + // Gets the 8 corners of the frustum + + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR Point) const noexcept; + ContainmentType XM_CALLCONV Contains(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + ContainmentType Contains(_In_ const BoundingSphere& sp) const noexcept; + ContainmentType Contains(_In_ const BoundingBox& box) const noexcept; + ContainmentType Contains( + _In_ const BoundingOrientedBox& box) const noexcept; + ContainmentType Contains(_In_ const BoundingFrustum& fr) const noexcept; + // Frustum-Frustum test + + bool Intersects(_In_ const BoundingSphere& sh) const noexcept; + bool Intersects(_In_ const BoundingBox& box) const noexcept; + bool Intersects(_In_ const BoundingOrientedBox& box) const noexcept; + bool Intersects(_In_ const BoundingFrustum& fr) const noexcept; + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) const noexcept; + // Triangle-Frustum test + + PlaneIntersectionType XM_CALLCONV + Intersects(_In_ FXMVECTOR Plane) const noexcept; + // Plane-Frustum test + + bool XM_CALLCONV Intersects(_In_ FXMVECTOR rayOrigin, + _In_ FXMVECTOR Direction, + _Out_ float& Dist) const noexcept; + // Ray-Frustum test + + ContainmentType XM_CALLCONV + ContainedBy(_In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, + _In_ FXMVECTOR Plane2, _In_ GXMVECTOR Plane3, + _In_ HXMVECTOR Plane4, _In_ HXMVECTOR Plane5) const noexcept; + // Test frustum against six planes (see BoundingFrustum::GetPlanes) + + void GetPlanes(_Out_opt_ XMVECTOR* NearPlane, _Out_opt_ XMVECTOR* FarPlane, + _Out_opt_ XMVECTOR* RightPlane, + _Out_opt_ XMVECTOR* LeftPlane, _Out_opt_ XMVECTOR* TopPlane, + _Out_opt_ XMVECTOR* BottomPlane) const noexcept; + // Create 6 Planes representation of Frustum + + // Static methods + static void XM_CALLCONV CreateFromMatrix(_Out_ BoundingFrustum& Out, + _In_ FXMMATRIX Projection, + bool rhcoords = false) noexcept; +}; + +//----------------------------------------------------------------------------- +// Triangle intersection testing routines. +//----------------------------------------------------------------------------- +namespace TriangleTests { +bool XM_CALLCONV Intersects(_In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, + _In_ FXMVECTOR V0, _In_ GXMVECTOR V1, + _In_ HXMVECTOR V2, _Out_ float& Dist) noexcept; +// Ray-Triangle + +bool XM_CALLCONV Intersects(_In_ FXMVECTOR A0, _In_ FXMVECTOR A1, + _In_ FXMVECTOR A2, _In_ GXMVECTOR B0, + _In_ HXMVECTOR B1, _In_ HXMVECTOR B2) noexcept; +// Triangle-Triangle + +PlaneIntersectionType XM_CALLCONV Intersects(_In_ FXMVECTOR V0, + _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2, + _In_ GXMVECTOR Plane) noexcept; +// Plane-Triangle + +ContainmentType XM_CALLCONV +ContainedBy(_In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ FXMVECTOR V2, + _In_ GXMVECTOR Plane0, _In_ HXMVECTOR Plane1, _In_ HXMVECTOR Plane2, + _In_ CXMVECTOR Plane3, _In_ CXMVECTOR Plane4, + _In_ CXMVECTOR Plane5) noexcept; +// Test a triangle against six planes at once (see BoundingFrustum::GetPlanes) +} // namespace TriangleTests + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Implementation + * + ****************************************************************************/ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4068 4365 4616 6001) +// C4068/4616: ignore unknown pragmas +// C4365: Off by default noise +// C6001: False positives +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#pragma prefast(disable : 26495, "Union initialization confuses /analyze") +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wfloat-equal" +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" +#endif + +#include "DirectXCollision.inl" + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +} // namespace DirectX diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXCollision.inl b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXCollision.inl similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXCollision.inl rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXCollision.inl index ab8b68396..39bb5ac7c 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXCollision.inl +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXCollision.inl @@ -1,4816 +1,4816 @@ -//------------------------------------------------------------------------------------- -// DirectXCollision.inl -- C++ Collision Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -XMGLOBALCONST XMVECTORF32 g_BoxOffset[8] = -{ - { { { -1.0f, -1.0f, 1.0f, 0.0f } } }, - { { { 1.0f, -1.0f, 1.0f, 0.0f } } }, - { { { 1.0f, 1.0f, 1.0f, 0.0f } } }, - { { { -1.0f, 1.0f, 1.0f, 0.0f } } }, - { { { -1.0f, -1.0f, -1.0f, 0.0f } } }, - { { { 1.0f, -1.0f, -1.0f, 0.0f } } }, - { { { 1.0f, 1.0f, -1.0f, 0.0f } } }, - { { { -1.0f, 1.0f, -1.0f, 0.0f } } }, -}; - -XMGLOBALCONST XMVECTORF32 g_RayEpsilon = { { { 1e-20f, 1e-20f, 1e-20f, 1e-20f } } }; -XMGLOBALCONST XMVECTORF32 g_RayNegEpsilon = { { { -1e-20f, -1e-20f, -1e-20f, -1e-20f } } }; -XMGLOBALCONST XMVECTORF32 g_FltMin = { { { -FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX } } }; -XMGLOBALCONST XMVECTORF32 g_FltMax = { { { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX } } }; - -namespace MathInternal -{ - - //----------------------------------------------------------------------------- - // Return true if any of the elements of a 3 vector are equal to 0xffffffff. - // Slightly more efficient than using XMVector3EqualInt. - //----------------------------------------------------------------------------- - inline bool XMVector3AnyTrue(_In_ FXMVECTOR V) noexcept - { - // Duplicate the fourth element from the first element. - XMVECTOR C = XMVectorSwizzle(V); - - return XMComparisonAnyTrue(XMVector4EqualIntR(C, XMVectorTrueInt())); - } - - - //----------------------------------------------------------------------------- - // Return true if all of the elements of a 3 vector are equal to 0xffffffff. - // Slightly more efficient than using XMVector3EqualInt. - //----------------------------------------------------------------------------- - inline bool XMVector3AllTrue(_In_ FXMVECTOR V) noexcept - { - // Duplicate the fourth element from the first element. - XMVECTOR C = XMVectorSwizzle(V); - - return XMComparisonAllTrue(XMVector4EqualIntR(C, XMVectorTrueInt())); - } - -#if defined(_PREFAST_) || !defined(NDEBUG) - - XMGLOBALCONST XMVECTORF32 g_UnitVectorEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; - XMGLOBALCONST XMVECTORF32 g_UnitQuaternionEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; - XMGLOBALCONST XMVECTORF32 g_UnitPlaneEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; - - //----------------------------------------------------------------------------- - // Return true if the vector is a unit vector (length == 1). - //----------------------------------------------------------------------------- - inline bool XMVector3IsUnit(_In_ FXMVECTOR V) noexcept - { - XMVECTOR Difference = XMVectorSubtract(XMVector3Length(V), XMVectorSplatOne()); - return XMVector4Less(XMVectorAbs(Difference), g_UnitVectorEpsilon); - } - - //----------------------------------------------------------------------------- - // Return true if the quaterion is a unit quaternion. - //----------------------------------------------------------------------------- - inline bool XMQuaternionIsUnit(_In_ FXMVECTOR Q) noexcept - { - XMVECTOR Difference = XMVectorSubtract(XMVector4Length(Q), XMVectorSplatOne()); - return XMVector4Less(XMVectorAbs(Difference), g_UnitQuaternionEpsilon); - } - - //----------------------------------------------------------------------------- - // Return true if the plane is a unit plane. - //----------------------------------------------------------------------------- - inline bool XMPlaneIsUnit(_In_ FXMVECTOR Plane) noexcept - { - XMVECTOR Difference = XMVectorSubtract(XMVector3Length(Plane), XMVectorSplatOne()); - return XMVector4Less(XMVectorAbs(Difference), g_UnitPlaneEpsilon); - } - -#endif // _PREFAST_ || !NDEBUG - - //----------------------------------------------------------------------------- - inline XMVECTOR XMPlaneTransform(_In_ FXMVECTOR Plane, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) noexcept - { - XMVECTOR vNormal = XMVector3Rotate(Plane, Rotation); - XMVECTOR vD = XMVectorSubtract(XMVectorSplatW(Plane), XMVector3Dot(vNormal, Translation)); - - return XMVectorInsert<0, 0, 0, 0, 1>(vNormal, vD); - } - - //----------------------------------------------------------------------------- - // Return the point on the line segement (S1, S2) nearest the point P. - //----------------------------------------------------------------------------- - inline XMVECTOR PointOnLineSegmentNearestPoint(_In_ FXMVECTOR S1, _In_ FXMVECTOR S2, _In_ FXMVECTOR P) noexcept - { - XMVECTOR Dir = XMVectorSubtract(S2, S1); - XMVECTOR Projection = XMVectorSubtract(XMVector3Dot(P, Dir), XMVector3Dot(S1, Dir)); - XMVECTOR LengthSq = XMVector3Dot(Dir, Dir); - - XMVECTOR t = XMVectorMultiply(Projection, XMVectorReciprocal(LengthSq)); - XMVECTOR Point = XMVectorMultiplyAdd(t, Dir, S1); - - // t < 0 - XMVECTOR SelectS1 = XMVectorLess(Projection, XMVectorZero()); - Point = XMVectorSelect(Point, S1, SelectS1); - - // t > 1 - XMVECTOR SelectS2 = XMVectorGreater(Projection, LengthSq); - Point = XMVectorSelect(Point, S2, SelectS2); - - return Point; - } - - //----------------------------------------------------------------------------- - // Test if the point (P) on the plane of the triangle is inside the triangle - // (V0, V1, V2). - //----------------------------------------------------------------------------- - inline XMVECTOR XM_CALLCONV PointOnPlaneInsideTriangle(_In_ FXMVECTOR P, _In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ GXMVECTOR V2) noexcept - { - // Compute the triangle normal. - XMVECTOR N = XMVector3Cross(XMVectorSubtract(V2, V0), XMVectorSubtract(V1, V0)); - - // Compute the cross products of the vector from the base of each edge to - // the point with each edge vector. - XMVECTOR C0 = XMVector3Cross(XMVectorSubtract(P, V0), XMVectorSubtract(V1, V0)); - XMVECTOR C1 = XMVector3Cross(XMVectorSubtract(P, V1), XMVectorSubtract(V2, V1)); - XMVECTOR C2 = XMVector3Cross(XMVectorSubtract(P, V2), XMVectorSubtract(V0, V2)); - - // If the cross product points in the same direction as the normal the the - // point is inside the edge (it is zero if is on the edge). - XMVECTOR Zero = XMVectorZero(); - XMVECTOR Inside0 = XMVectorGreaterOrEqual(XMVector3Dot(C0, N), Zero); - XMVECTOR Inside1 = XMVectorGreaterOrEqual(XMVector3Dot(C1, N), Zero); - XMVECTOR Inside2 = XMVectorGreaterOrEqual(XMVector3Dot(C2, N), Zero); - - // If the point inside all of the edges it is inside. - return XMVectorAndInt(XMVectorAndInt(Inside0, Inside1), Inside2); - } - - //----------------------------------------------------------------------------- - inline bool SolveCubic(_In_ float e, _In_ float f, _In_ float g, _Out_ float* t, _Out_ float* u, _Out_ float* v) noexcept - { - float p, q, h, rc, d, theta, costh3, sinth3; - - p = f - e * e / 3.0f; - q = g - e * f / 3.0f + e * e * e * 2.0f / 27.0f; - h = q * q / 4.0f + p * p * p / 27.0f; - - if (h > 0) - { - *t = *u = *v = 0.f; - return false; // only one real root - } - - if ((h == 0) && (q == 0)) // all the same root - { - *t = -e / 3; - *u = -e / 3; - *v = -e / 3; - - return true; - } - - d = sqrtf(q * q / 4.0f - h); - if (d < 0) - rc = -powf(-d, 1.0f / 3.0f); - else - rc = powf(d, 1.0f / 3.0f); - - theta = XMScalarACos(-q / (2.0f * d)); - costh3 = XMScalarCos(theta / 3.0f); - sinth3 = sqrtf(3.0f) * XMScalarSin(theta / 3.0f); - *t = 2.0f * rc * costh3 - e / 3.0f; - *u = -rc * (costh3 + sinth3) - e / 3.0f; - *v = -rc * (costh3 - sinth3) - e / 3.0f; - - return true; - } - - //----------------------------------------------------------------------------- - inline XMVECTOR CalculateEigenVector(_In_ float m11, _In_ float m12, _In_ float m13, - _In_ float m22, _In_ float m23, _In_ float m33, _In_ float e) noexcept - { - float fTmp[3]; - fTmp[0] = m12 * m23 - m13 * (m22 - e); - fTmp[1] = m13 * m12 - m23 * (m11 - e); - fTmp[2] = (m11 - e) * (m22 - e) - m12 * m12; - - XMVECTOR vTmp = XMLoadFloat3(reinterpret_cast(fTmp)); - - if (XMVector3Equal(vTmp, XMVectorZero())) // planar or linear - { - float f1, f2, f3; - - // we only have one equation - find a valid one - if ((m11 - e != 0) || (m12 != 0) || (m13 != 0)) - { - f1 = m11 - e; f2 = m12; f3 = m13; - } - else if ((m12 != 0) || (m22 - e != 0) || (m23 != 0)) - { - f1 = m12; f2 = m22 - e; f3 = m23; - } - else if ((m13 != 0) || (m23 != 0) || (m33 - e != 0)) - { - f1 = m13; f2 = m23; f3 = m33 - e; - } - else - { - // error, we'll just make something up - we have NO context - f1 = 1.0f; f2 = 0.0f; f3 = 0.0f; - } - - if (f1 == 0) - vTmp = XMVectorSetX(vTmp, 0.0f); - else - vTmp = XMVectorSetX(vTmp, 1.0f); - - if (f2 == 0) - vTmp = XMVectorSetY(vTmp, 0.0f); - else - vTmp = XMVectorSetY(vTmp, 1.0f); - - if (f3 == 0) - { - vTmp = XMVectorSetZ(vTmp, 0.0f); - // recalculate y to make equation work - if (m12 != 0) - vTmp = XMVectorSetY(vTmp, -f1 / f2); - } - else - { - vTmp = XMVectorSetZ(vTmp, (f2 - f1) / f3); - } - } - - if (XMVectorGetX(XMVector3LengthSq(vTmp)) > 1e-5f) - { - return XMVector3Normalize(vTmp); - } - else - { - // Multiply by a value large enough to make the vector non-zero. - vTmp = XMVectorScale(vTmp, 1e5f); - return XMVector3Normalize(vTmp); - } - } - - //----------------------------------------------------------------------------- - inline bool CalculateEigenVectors(_In_ float m11, _In_ float m12, _In_ float m13, - _In_ float m22, _In_ float m23, _In_ float m33, - _In_ float e1, _In_ float e2, _In_ float e3, - _Out_ XMVECTOR* pV1, _Out_ XMVECTOR* pV2, _Out_ XMVECTOR* pV3) noexcept - { - *pV1 = DirectX::MathInternal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e1); - *pV2 = DirectX::MathInternal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e2); - *pV3 = DirectX::MathInternal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e3); - - bool v1z = false; - bool v2z = false; - bool v3z = false; - - XMVECTOR Zero = XMVectorZero(); - - if (XMVector3Equal(*pV1, Zero)) - v1z = true; - - if (XMVector3Equal(*pV2, Zero)) - v2z = true; - - if (XMVector3Equal(*pV3, Zero)) - v3z = true; - - bool e12 = (fabsf(XMVectorGetX(XMVector3Dot(*pV1, *pV2))) > 0.1f); // check for non-orthogonal vectors - bool e13 = (fabsf(XMVectorGetX(XMVector3Dot(*pV1, *pV3))) > 0.1f); - bool e23 = (fabsf(XMVectorGetX(XMVector3Dot(*pV2, *pV3))) > 0.1f); - - if ((v1z && v2z && v3z) || (e12 && e13 && e23) || - (e12 && v3z) || (e13 && v2z) || (e23 && v1z)) // all eigenvectors are 0- any basis set - { - *pV1 = g_XMIdentityR0.v; - *pV2 = g_XMIdentityR1.v; - *pV3 = g_XMIdentityR2.v; - return true; - } - - if (v1z && v2z) - { - XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV3); - if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) - { - vTmp = XMVector3Cross(g_XMIdentityR0, *pV3); - } - *pV1 = XMVector3Normalize(vTmp); - *pV2 = XMVector3Cross(*pV3, *pV1); - return true; - } - - if (v3z && v1z) - { - XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV2); - if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) - { - vTmp = XMVector3Cross(g_XMIdentityR0, *pV2); - } - *pV3 = XMVector3Normalize(vTmp); - *pV1 = XMVector3Cross(*pV2, *pV3); - return true; - } - - if (v2z && v3z) - { - XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV1); - if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) - { - vTmp = XMVector3Cross(g_XMIdentityR0, *pV1); - } - *pV2 = XMVector3Normalize(vTmp); - *pV3 = XMVector3Cross(*pV1, *pV2); - return true; - } - - if ((v1z) || e12) - { - *pV1 = XMVector3Cross(*pV2, *pV3); - return true; - } - - if ((v2z) || e23) - { - *pV2 = XMVector3Cross(*pV3, *pV1); - return true; - } - - if ((v3z) || e13) - { - *pV3 = XMVector3Cross(*pV1, *pV2); - return true; - } - - return true; - } - - //----------------------------------------------------------------------------- - inline bool CalculateEigenVectorsFromCovarianceMatrix(_In_ float Cxx, _In_ float Cyy, _In_ float Czz, - _In_ float Cxy, _In_ float Cxz, _In_ float Cyz, - _Out_ XMVECTOR* pV1, _Out_ XMVECTOR* pV2, _Out_ XMVECTOR* pV3) noexcept - { - // Calculate the eigenvalues by solving a cubic equation. - float e = -(Cxx + Cyy + Czz); - float f = Cxx * Cyy + Cyy * Czz + Czz * Cxx - Cxy * Cxy - Cxz * Cxz - Cyz * Cyz; - float g = Cxy * Cxy * Czz + Cxz * Cxz * Cyy + Cyz * Cyz * Cxx - Cxy * Cyz * Cxz * 2.0f - Cxx * Cyy * Czz; - - float ev1, ev2, ev3; - if (!DirectX::MathInternal::SolveCubic(e, f, g, &ev1, &ev2, &ev3)) - { - // set them to arbitrary orthonormal basis set - *pV1 = g_XMIdentityR0.v; - *pV2 = g_XMIdentityR1.v; - *pV3 = g_XMIdentityR2.v; - return false; - } - - return DirectX::MathInternal::CalculateEigenVectors(Cxx, Cxy, Cxz, Cyy, Cyz, Czz, ev1, ev2, ev3, pV1, pV2, pV3); - } - - //----------------------------------------------------------------------------- - inline void XM_CALLCONV FastIntersectTrianglePlane( - FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, - GXMVECTOR Plane, - XMVECTOR& Outside, XMVECTOR& Inside) noexcept - { - // Plane0 - XMVECTOR Dist0 = XMVector4Dot(V0, Plane); - XMVECTOR Dist1 = XMVector4Dot(V1, Plane); - XMVECTOR Dist2 = XMVector4Dot(V2, Plane); - - XMVECTOR MinDist = XMVectorMin(Dist0, Dist1); - MinDist = XMVectorMin(MinDist, Dist2); - - XMVECTOR MaxDist = XMVectorMax(Dist0, Dist1); - MaxDist = XMVectorMax(MaxDist, Dist2); - - XMVECTOR Zero = XMVectorZero(); - - // Outside the plane? - Outside = XMVectorGreater(MinDist, Zero); - - // Fully inside the plane? - Inside = XMVectorLess(MaxDist, Zero); - } - - //----------------------------------------------------------------------------- - inline void FastIntersectSpherePlane(_In_ FXMVECTOR Center, _In_ FXMVECTOR Radius, _In_ FXMVECTOR Plane, - _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept - { - XMVECTOR Dist = XMVector4Dot(Center, Plane); - - // Outside the plane? - Outside = XMVectorGreater(Dist, Radius); - - // Fully inside the plane? - Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); - } - - //----------------------------------------------------------------------------- - inline void FastIntersectAxisAlignedBoxPlane(_In_ FXMVECTOR Center, _In_ FXMVECTOR Extents, _In_ FXMVECTOR Plane, - _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept - { - // Compute the distance to the center of the box. - XMVECTOR Dist = XMVector4Dot(Center, Plane); - - // Project the axes of the box onto the normal of the plane. Half the - // length of the projection (sometime called the "radius") is equal to - // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) - // where h(i) are extents of the box, n is the plane normal, and b(i) are the - // axes of the box. In this case b(i) = [(1,0,0), (0,1,0), (0,0,1)]. - XMVECTOR Radius = XMVector3Dot(Extents, XMVectorAbs(Plane)); - - // Outside the plane? - Outside = XMVectorGreater(Dist, Radius); - - // Fully inside the plane? - Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); - } - - //----------------------------------------------------------------------------- - inline void XM_CALLCONV FastIntersectOrientedBoxPlane( - _In_ FXMVECTOR Center, _In_ FXMVECTOR Extents, _In_ FXMVECTOR Axis0, - _In_ GXMVECTOR Axis1, - _In_ HXMVECTOR Axis2, _In_ HXMVECTOR Plane, - _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept - { - // Compute the distance to the center of the box. - XMVECTOR Dist = XMVector4Dot(Center, Plane); - - // Project the axes of the box onto the normal of the plane. Half the - // length of the projection (sometime called the "radius") is equal to - // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) - // where h(i) are extents of the box, n is the plane normal, and b(i) are the - // axes of the box. - XMVECTOR Radius = XMVector3Dot(Plane, Axis0); - Radius = XMVectorInsert<0, 0, 1, 0, 0>(Radius, XMVector3Dot(Plane, Axis1)); - Radius = XMVectorInsert<0, 0, 0, 1, 0>(Radius, XMVector3Dot(Plane, Axis2)); - Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); - - // Outside the plane? - Outside = XMVectorGreater(Dist, Radius); - - // Fully inside the plane? - Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); - } - - //----------------------------------------------------------------------------- - inline void XM_CALLCONV FastIntersectFrustumPlane( - _In_ FXMVECTOR Point0, _In_ FXMVECTOR Point1, _In_ FXMVECTOR Point2, - _In_ GXMVECTOR Point3, - _In_ HXMVECTOR Point4, _In_ HXMVECTOR Point5, - _In_ CXMVECTOR Point6, _In_ CXMVECTOR Point7, _In_ CXMVECTOR Plane, - _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept - { - // Find the min/max projection of the frustum onto the plane normal. - XMVECTOR Min, Max, Dist; - - Min = Max = XMVector3Dot(Plane, Point0); - - Dist = XMVector3Dot(Plane, Point1); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - Dist = XMVector3Dot(Plane, Point2); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - Dist = XMVector3Dot(Plane, Point3); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - Dist = XMVector3Dot(Plane, Point4); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - Dist = XMVector3Dot(Plane, Point5); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - Dist = XMVector3Dot(Plane, Point6); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - Dist = XMVector3Dot(Plane, Point7); - Min = XMVectorMin(Min, Dist); - Max = XMVectorMax(Max, Dist); - - XMVECTOR PlaneDist = XMVectorNegate(XMVectorSplatW(Plane)); - - // Outside the plane? - Outside = XMVectorGreater(Min, PlaneDist); - - // Fully inside the plane? - Inside = XMVectorLess(Max, PlaneDist); - } - -} // namespace MathInternal - - -/**************************************************************************** - * - * BoundingSphere - * - ****************************************************************************/ - -//----------------------------------------------------------------------------- -// Transform a sphere by an angle preserving transform. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingSphere::Transform(BoundingSphere& Out, FXMMATRIX M) const noexcept -{ - // Load the center of the sphere. - XMVECTOR vCenter = XMLoadFloat3(&Center); - - // Transform the center of the sphere. - XMVECTOR C = XMVector3Transform(vCenter, M); - - XMVECTOR dX = XMVector3Dot(M.r[0], M.r[0]); - XMVECTOR dY = XMVector3Dot(M.r[1], M.r[1]); - XMVECTOR dZ = XMVector3Dot(M.r[2], M.r[2]); - - XMVECTOR d = XMVectorMax(dX, XMVectorMax(dY, dZ)); - - // Store the center sphere. - XMStoreFloat3(&Out.Center, C); - - // Scale the radius of the pshere. - float Scale = sqrtf(XMVectorGetX(d)); - Out.Radius = Radius * Scale; -} - -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingSphere::Transform(BoundingSphere& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept -{ - // Load the center of the sphere. - XMVECTOR vCenter = XMLoadFloat3(&Center); - - // Transform the center of the sphere. - vCenter = XMVectorAdd(XMVector3Rotate(XMVectorScale(vCenter, Scale), Rotation), Translation); - - // Store the center sphere. - XMStoreFloat3(&Out.Center, vCenter); - - // Scale the radius of the pshere. - Out.Radius = Radius * Scale; -} - - -//----------------------------------------------------------------------------- -// Point in sphere test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingSphere::Contains(FXMVECTOR Point) const noexcept -{ - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - - XMVECTOR DistanceSquared = XMVector3LengthSq(XMVectorSubtract(Point, vCenter)); - XMVECTOR RadiusSquared = XMVectorMultiply(vRadius, vRadius); - - return XMVector3LessOrEqual(DistanceSquared, RadiusSquared) ? CONTAINS : DISJOINT; -} - - -//----------------------------------------------------------------------------- -// Triangle in sphere test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingSphere::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - if (!Intersects(V0, V1, V2)) - return DISJOINT; - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - XMVECTOR RadiusSquared = XMVectorMultiply(vRadius, vRadius); - - XMVECTOR DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V0, vCenter)); - XMVECTOR Inside = XMVectorLessOrEqual(DistanceSquared, RadiusSquared); - - DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V1, vCenter)); - Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(DistanceSquared, RadiusSquared)); - - DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V2, vCenter)); - Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(DistanceSquared, RadiusSquared)); - - return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Sphere in sphere test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingSphere::Contains(const BoundingSphere& sh) const noexcept -{ - XMVECTOR Center1 = XMLoadFloat3(&Center); - float r1 = Radius; - - XMVECTOR Center2 = XMLoadFloat3(&sh.Center); - float r2 = sh.Radius; - - XMVECTOR V = XMVectorSubtract(Center2, Center1); - - XMVECTOR Dist = XMVector3Length(V); - - float d = XMVectorGetX(Dist); - - return (r1 + r2 >= d) ? ((r1 - r2 >= d) ? CONTAINS : INTERSECTS) : DISJOINT; -} - - -//----------------------------------------------------------------------------- -// Axis-aligned box in sphere test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingSphere::Contains(const BoundingBox& box) const noexcept -{ - if (!box.Intersects(*this)) - return DISJOINT; - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); - - XMVECTOR boxCenter = XMLoadFloat3(&box.Center); - XMVECTOR boxExtents = XMLoadFloat3(&box.Extents); - - XMVECTOR InsideAll = XMVectorTrueInt(); - - XMVECTOR offset = XMVectorSubtract(boxCenter, vCenter); - - for (size_t i = 0; i < BoundingBox::CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorMultiplyAdd(boxExtents, g_BoxOffset[i], offset); - XMVECTOR d = XMVector3LengthSq(C); - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); - } - - return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Oriented box in sphere test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingSphere::Contains(const BoundingOrientedBox& box) const noexcept -{ - if (!box.Intersects(*this)) - return DISJOINT; - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); - - XMVECTOR boxCenter = XMLoadFloat3(&box.Center); - XMVECTOR boxExtents = XMLoadFloat3(&box.Extents); - XMVECTOR boxOrientation = XMLoadFloat4(&box.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(boxOrientation)); - - XMVECTOR InsideAll = XMVectorTrueInt(); - - for (size_t i = 0; i < BoundingOrientedBox::CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(boxExtents, g_BoxOffset[i]), boxOrientation), boxCenter); - XMVECTOR d = XMVector3LengthSq(XMVectorSubtract(vCenter, C)); - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); - } - - return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; - -} - - -//----------------------------------------------------------------------------- -// Frustum in sphere test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingSphere::Contains(const BoundingFrustum& fr) const noexcept -{ - if (!fr.Intersects(*this)) - return DISJOINT; - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); - - XMVECTOR vOrigin = XMLoadFloat3(&fr.Origin); - XMVECTOR vOrientation = XMLoadFloat4(&fr.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Build the corners of the frustum. - XMVECTOR vRightTop = XMVectorSet(fr.RightSlope, fr.TopSlope, 1.0f, 0.0f); - XMVECTOR vRightBottom = XMVectorSet(fr.RightSlope, fr.BottomSlope, 1.0f, 0.0f); - XMVECTOR vLeftTop = XMVectorSet(fr.LeftSlope, fr.TopSlope, 1.0f, 0.0f); - XMVECTOR vLeftBottom = XMVectorSet(fr.LeftSlope, fr.BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&fr.Near); - XMVECTOR vFar = XMVectorReplicatePtr(&fr.Far); - - XMVECTOR Corners[BoundingFrustum::CORNER_COUNT]; - Corners[0] = XMVectorMultiply(vRightTop, vNear); - Corners[1] = XMVectorMultiply(vRightBottom, vNear); - Corners[2] = XMVectorMultiply(vLeftTop, vNear); - Corners[3] = XMVectorMultiply(vLeftBottom, vNear); - Corners[4] = XMVectorMultiply(vRightTop, vFar); - Corners[5] = XMVectorMultiply(vRightBottom, vFar); - Corners[6] = XMVectorMultiply(vLeftTop, vFar); - Corners[7] = XMVectorMultiply(vLeftBottom, vFar); - - XMVECTOR InsideAll = XMVectorTrueInt(); - for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorAdd(XMVector3Rotate(Corners[i], vOrientation), vOrigin); - XMVECTOR d = XMVector3LengthSq(XMVectorSubtract(vCenter, C)); - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); - } - - return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Sphere vs. sphere test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingSphere::Intersects(const BoundingSphere& sh) const noexcept -{ - // Load A. - XMVECTOR vCenterA = XMLoadFloat3(&Center); - XMVECTOR vRadiusA = XMVectorReplicatePtr(&Radius); - - // Load B. - XMVECTOR vCenterB = XMLoadFloat3(&sh.Center); - XMVECTOR vRadiusB = XMVectorReplicatePtr(&sh.Radius); - - // Distance squared between centers. - XMVECTOR Delta = XMVectorSubtract(vCenterB, vCenterA); - XMVECTOR DistanceSquared = XMVector3LengthSq(Delta); - - // Sum of the radii squared. - XMVECTOR RadiusSquared = XMVectorAdd(vRadiusA, vRadiusB); - RadiusSquared = XMVectorMultiply(RadiusSquared, RadiusSquared); - - return XMVector3LessOrEqual(DistanceSquared, RadiusSquared); -} - - -//----------------------------------------------------------------------------- -// Box vs. sphere test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingSphere::Intersects(const BoundingBox& box) const noexcept -{ - return box.Intersects(*this); -} - -_Use_decl_annotations_ -inline bool BoundingSphere::Intersects(const BoundingOrientedBox& box) const noexcept -{ - return box.Intersects(*this); -} - - -//----------------------------------------------------------------------------- -// Frustum vs. sphere test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingSphere::Intersects(const BoundingFrustum& fr) const noexcept -{ - return fr.Intersects(*this); -} - - -//----------------------------------------------------------------------------- -// Triangle vs sphere test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - // Load the sphere. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - - // Compute the plane of the triangle (has to be normalized). - XMVECTOR N = XMVector3Normalize(XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0))); - - // Assert that the triangle is not degenerate. - assert(!XMVector3Equal(N, XMVectorZero())); - - // Find the nearest feature on the triangle to the sphere. - XMVECTOR Dist = XMVector3Dot(XMVectorSubtract(vCenter, V0), N); - - // If the center of the sphere is farther from the plane of the triangle than - // the radius of the sphere, then there cannot be an intersection. - XMVECTOR NoIntersection = XMVectorLess(Dist, XMVectorNegate(vRadius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Dist, vRadius)); - - // Project the center of the sphere onto the plane of the triangle. - XMVECTOR Point = XMVectorNegativeMultiplySubtract(N, Dist, vCenter); - - // Is it inside all the edges? If so we intersect because the distance - // to the plane is less than the radius. - XMVECTOR Intersection = DirectX::MathInternal::PointOnPlaneInsideTriangle(Point, V0, V1, V2); - - // Find the nearest point on each edge. - XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); - - // Edge 0,1 - Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(V0, V1, vCenter); - - // If the distance to the center of the sphere to the point is less than - // the radius of the sphere then it must intersect. - Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); - - // Edge 1,2 - Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(V1, V2, vCenter); - - // If the distance to the center of the sphere to the point is less than - // the radius of the sphere then it must intersect. - Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); - - // Edge 2,0 - Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(V2, V0, vCenter); - - // If the distance to the center of the sphere to the point is less than - // the radius of the sphere then it must intersect. - Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); - - return XMVector4EqualInt(XMVectorAndCInt(Intersection, NoIntersection), XMVectorTrueInt()); -} - - -//----------------------------------------------------------------------------- -// Sphere-plane intersection -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline PlaneIntersectionType XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR Plane) const noexcept -{ - assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); - - // Load the sphere. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - - // Set w of the center to one so we can dot4 with a plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - XMVECTOR Outside, Inside; - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane, Outside, Inside); - - // If the sphere is outside any plane it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return FRONT; - - // If the sphere is inside all planes it is inside. - if (XMVector4EqualInt(Inside, XMVectorTrueInt())) - return BACK; - - // The sphere is not inside all planes or outside a plane it intersects. - return INTERSECTING; -} - - -//----------------------------------------------------------------------------- -// Compute the intersection of a ray (Origin, Direction) with a sphere. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept -{ - assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - - // l is the vector from the ray origin to the center of the sphere. - XMVECTOR l = XMVectorSubtract(vCenter, Origin); - - // s is the projection of the l onto the ray direction. - XMVECTOR s = XMVector3Dot(l, Direction); - - XMVECTOR l2 = XMVector3Dot(l, l); - - XMVECTOR r2 = XMVectorMultiply(vRadius, vRadius); - - // m2 is squared distance from the center of the sphere to the projection. - XMVECTOR m2 = XMVectorNegativeMultiplySubtract(s, s, l2); - - XMVECTOR NoIntersection; - - // If the ray origin is outside the sphere and the center of the sphere is - // behind the ray origin there is no intersection. - NoIntersection = XMVectorAndInt(XMVectorLess(s, XMVectorZero()), XMVectorGreater(l2, r2)); - - // If the squared distance from the center of the sphere to the projection - // is greater than the radius squared the ray will miss the sphere. - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(m2, r2)); - - // The ray hits the sphere, compute the nearest intersection point. - XMVECTOR q = XMVectorSqrt(XMVectorSubtract(r2, m2)); - XMVECTOR t1 = XMVectorSubtract(s, q); - XMVECTOR t2 = XMVectorAdd(s, q); - - XMVECTOR OriginInside = XMVectorLessOrEqual(l2, r2); - XMVECTOR t = XMVectorSelect(t1, t2, OriginInside); - - if (XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt())) - { - // Store the x-component to *pDist. - XMStoreFloat(&Dist, t); - return true; - } - - Dist = 0.f; - return false; -} - - -//----------------------------------------------------------------------------- -// Test a sphere vs 6 planes (typically forming a frustum). -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingSphere::ContainedBy( - FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, - GXMVECTOR Plane3, - HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept -{ - // Load the sphere. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); - - // Set w of the center to one so we can dot4 with a plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - XMVECTOR Outside, Inside; - - // Test against each plane. - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane0, Outside, Inside); - - XMVECTOR AnyOutside = Outside; - XMVECTOR AllInside = Inside; - - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane1, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane2, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane3, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane4, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane5, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - // If the sphere is outside any plane it is outside. - if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) - return DISJOINT; - - // If the sphere is inside all planes it is inside. - if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) - return CONTAINS; - - // The sphere is not inside all planes or outside a plane, it may intersect. - return INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Creates a bounding sphere that contains two other bounding spheres -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingSphere::CreateMerged(BoundingSphere& Out, const BoundingSphere& S1, const BoundingSphere& S2) noexcept -{ - XMVECTOR Center1 = XMLoadFloat3(&S1.Center); - float r1 = S1.Radius; - - XMVECTOR Center2 = XMLoadFloat3(&S2.Center); - float r2 = S2.Radius; - - XMVECTOR V = XMVectorSubtract(Center2, Center1); - - XMVECTOR Dist = XMVector3Length(V); - - float d = XMVectorGetX(Dist); - - if (r1 + r2 >= d) - { - if (r1 - r2 >= d) - { - Out = S1; - return; - } - else if (r2 - r1 >= d) - { - Out = S2; - return; - } - } - - XMVECTOR N = XMVectorDivide(V, Dist); - - float t1 = XMMin(-r1, d - r2); - float t2 = XMMax(r1, d + r2); - float t_5 = (t2 - t1) * 0.5f; - - XMVECTOR NCenter = XMVectorAdd(Center1, XMVectorMultiply(N, XMVectorReplicate(t_5 + t1))); - - XMStoreFloat3(&Out.Center, NCenter); - Out.Radius = t_5; -} - - -//----------------------------------------------------------------------------- -// Create sphere enscribing bounding box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingSphere::CreateFromBoundingBox(BoundingSphere& Out, const BoundingBox& box) noexcept -{ - Out.Center = box.Center; - XMVECTOR vExtents = XMLoadFloat3(&box.Extents); - Out.Radius = XMVectorGetX(XMVector3Length(vExtents)); -} - -_Use_decl_annotations_ -inline void BoundingSphere::CreateFromBoundingBox(BoundingSphere& Out, const BoundingOrientedBox& box) noexcept -{ - // Bounding box orientation is irrelevant because a sphere is rotationally invariant - Out.Center = box.Center; - XMVECTOR vExtents = XMLoadFloat3(&box.Extents); - Out.Radius = XMVectorGetX(XMVector3Length(vExtents)); -} - - -//----------------------------------------------------------------------------- -// Find the approximate smallest enclosing bounding sphere for a set of -// points. Exact computation of the smallest enclosing bounding sphere is -// possible but is slower and requires a more complex algorithm. -// The algorithm is based on Jack Ritter, "An Efficient Bounding Sphere", -// Graphics Gems. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingSphere::CreateFromPoints(BoundingSphere& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept -{ - assert(Count > 0); - assert(pPoints); - - // Find the points with minimum and maximum x, y, and z - XMVECTOR MinX, MaxX, MinY, MaxY, MinZ, MaxZ; - - MinX = MaxX = MinY = MaxY = MinZ = MaxZ = XMLoadFloat3(pPoints); - - for (size_t i = 1; i < Count; ++i) - { - XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); - - float px = XMVectorGetX(Point); - float py = XMVectorGetY(Point); - float pz = XMVectorGetZ(Point); - - if (px < XMVectorGetX(MinX)) - MinX = Point; - - if (px > XMVectorGetX(MaxX)) - MaxX = Point; - - if (py < XMVectorGetY(MinY)) - MinY = Point; - - if (py > XMVectorGetY(MaxY)) - MaxY = Point; - - if (pz < XMVectorGetZ(MinZ)) - MinZ = Point; - - if (pz > XMVectorGetZ(MaxZ)) - MaxZ = Point; - } - - // Use the min/max pair that are farthest apart to form the initial sphere. - XMVECTOR DeltaX = XMVectorSubtract(MaxX, MinX); - XMVECTOR DistX = XMVector3Length(DeltaX); - - XMVECTOR DeltaY = XMVectorSubtract(MaxY, MinY); - XMVECTOR DistY = XMVector3Length(DeltaY); - - XMVECTOR DeltaZ = XMVectorSubtract(MaxZ, MinZ); - XMVECTOR DistZ = XMVector3Length(DeltaZ); - - XMVECTOR vCenter; - XMVECTOR vRadius; - - if (XMVector3Greater(DistX, DistY)) - { - if (XMVector3Greater(DistX, DistZ)) - { - // Use min/max x. - vCenter = XMVectorLerp(MaxX, MinX, 0.5f); - vRadius = XMVectorScale(DistX, 0.5f); - } - else - { - // Use min/max z. - vCenter = XMVectorLerp(MaxZ, MinZ, 0.5f); - vRadius = XMVectorScale(DistZ, 0.5f); - } - } - else // Y >= X - { - if (XMVector3Greater(DistY, DistZ)) - { - // Use min/max y. - vCenter = XMVectorLerp(MaxY, MinY, 0.5f); - vRadius = XMVectorScale(DistY, 0.5f); - } - else - { - // Use min/max z. - vCenter = XMVectorLerp(MaxZ, MinZ, 0.5f); - vRadius = XMVectorScale(DistZ, 0.5f); - } - } - - // Add any points not inside the sphere. - for (size_t i = 0; i < Count; ++i) - { - XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); - - XMVECTOR Delta = XMVectorSubtract(Point, vCenter); - - XMVECTOR Dist = XMVector3Length(Delta); - - if (XMVector3Greater(Dist, vRadius)) - { - // Adjust sphere to include the new point. - vRadius = XMVectorScale(XMVectorAdd(vRadius, Dist), 0.5f); - vCenter = XMVectorAdd(vCenter, XMVectorMultiply(XMVectorSubtract(XMVectorReplicate(1.0f), XMVectorDivide(vRadius, Dist)), Delta)); - } - } - - XMStoreFloat3(&Out.Center, vCenter); - XMStoreFloat(&Out.Radius, vRadius); -} - - -//----------------------------------------------------------------------------- -// Create sphere containing frustum -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingSphere::CreateFromFrustum(BoundingSphere& Out, const BoundingFrustum& fr) noexcept -{ - XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; - fr.GetCorners(Corners); - CreateFromPoints(Out, BoundingFrustum::CORNER_COUNT, Corners, sizeof(XMFLOAT3)); -} - - -/**************************************************************************** - * - * BoundingBox - * - ****************************************************************************/ - -//----------------------------------------------------------------------------- -// Transform an axis aligned box by an angle preserving transform. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingBox::Transform(BoundingBox& Out, FXMMATRIX M) const noexcept -{ - // Load center and extents. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - // Compute and transform the corners and find new min/max bounds. - XMVECTOR Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[0], vCenter); - Corner = XMVector3Transform(Corner, M); - - XMVECTOR Min, Max; - Min = Max = Corner; - - for (size_t i = 1; i < CORNER_COUNT; ++i) - { - Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); - Corner = XMVector3Transform(Corner, M); - - Min = XMVectorMin(Min, Corner); - Max = XMVectorMax(Max, Corner); - } - - // Store center and extents. - XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); -} - -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingBox::Transform(BoundingBox& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept -{ - assert(DirectX::MathInternal::XMQuaternionIsUnit(Rotation)); - - // Load center and extents. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - XMVECTOR VectorScale = XMVectorReplicate(Scale); - - // Compute and transform the corners and find new min/max bounds. - XMVECTOR Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[0], vCenter); - Corner = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(Corner, VectorScale), Rotation), Translation); - - XMVECTOR Min, Max; - Min = Max = Corner; - - for (size_t i = 1; i < CORNER_COUNT; ++i) - { - Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); - Corner = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(Corner, VectorScale), Rotation), Translation); - - Min = XMVectorMin(Min, Corner); - Max = XMVectorMax(Max, Corner); - } - - // Store center and extents. - XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); -} - - -//----------------------------------------------------------------------------- -// Get the corner points of the box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingBox::GetCorners(XMFLOAT3* Corners) const noexcept -{ - assert(Corners != nullptr); - - // Load the box - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - for (size_t i = 0; i < CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); - XMStoreFloat3(&Corners[i], C); - } -} - - -//----------------------------------------------------------------------------- -// Point in axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingBox::Contains(FXMVECTOR Point) const noexcept -{ - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - return XMVector3InBounds(XMVectorSubtract(Point, vCenter), vExtents) ? CONTAINS : DISJOINT; -} - - -//----------------------------------------------------------------------------- -// Triangle in axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingBox::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - if (!Intersects(V0, V1, V2)) - return DISJOINT; - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - XMVECTOR d = XMVectorAbs(XMVectorSubtract(V0, vCenter)); - XMVECTOR Inside = XMVectorLessOrEqual(d, vExtents); - - d = XMVectorAbs(XMVectorSubtract(V1, vCenter)); - Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); - - d = XMVectorAbs(XMVectorSubtract(V2, vCenter)); - Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); - - return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Sphere in axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingBox::Contains(const BoundingSphere& sh) const noexcept -{ - XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); - XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); - - XMVECTOR BoxCenter = XMLoadFloat3(&Center); - XMVECTOR BoxExtents = XMLoadFloat3(&Extents); - - XMVECTOR BoxMin = XMVectorSubtract(BoxCenter, BoxExtents); - XMVECTOR BoxMax = XMVectorAdd(BoxCenter, BoxExtents); - - // Find the distance to the nearest point on the box. - // for each i in (x, y, z) - // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 - // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 - - XMVECTOR d = XMVectorZero(); - - // Compute d for each dimension. - XMVECTOR LessThanMin = XMVectorLess(SphereCenter, BoxMin); - XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxMax); - - XMVECTOR MinDelta = XMVectorSubtract(SphereCenter, BoxMin); - XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxMax); - - // Choose value for each dimension based on the comparison. - d = XMVectorSelect(d, MinDelta, LessThanMin); - d = XMVectorSelect(d, MaxDelta, GreaterThanMax); - - // Use a dot-product to square them and sum them together. - XMVECTOR d2 = XMVector3Dot(d, d); - - if (XMVector3Greater(d2, XMVectorMultiply(SphereRadius, SphereRadius))) - return DISJOINT; - - XMVECTOR InsideAll = XMVectorLessOrEqual(XMVectorAdd(BoxMin, SphereRadius), SphereCenter); - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(SphereCenter, XMVectorSubtract(BoxMax, SphereRadius))); - InsideAll = XMVectorAndInt(InsideAll, XMVectorGreater(XMVectorSubtract(BoxMax, BoxMin), SphereRadius)); - - return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Axis-aligned box in axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingBox::Contains(const BoundingBox& box) const noexcept -{ - XMVECTOR CenterA = XMLoadFloat3(&Center); - XMVECTOR ExtentsA = XMLoadFloat3(&Extents); - - XMVECTOR CenterB = XMLoadFloat3(&box.Center); - XMVECTOR ExtentsB = XMLoadFloat3(&box.Extents); - - XMVECTOR MinA = XMVectorSubtract(CenterA, ExtentsA); - XMVECTOR MaxA = XMVectorAdd(CenterA, ExtentsA); - - XMVECTOR MinB = XMVectorSubtract(CenterB, ExtentsB); - XMVECTOR MaxB = XMVectorAdd(CenterB, ExtentsB); - - // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then return false - XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(MinA, MaxB), XMVectorGreater(MinB, MaxA)); - - if (DirectX::MathInternal::XMVector3AnyTrue(Disjoint)) - return DISJOINT; - - // for each i in (x, y, z) if a_min(i) <= b_min(i) and b_max(i) <= a_max(i) then A contains B - XMVECTOR Inside = XMVectorAndInt(XMVectorLessOrEqual(MinA, MinB), XMVectorLessOrEqual(MaxB, MaxA)); - - return DirectX::MathInternal::XMVector3AllTrue(Inside) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Oriented box in axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingBox::Contains(const BoundingOrientedBox& box) const noexcept -{ - if (!box.Intersects(*this)) - return DISJOINT; - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - // Subtract off the AABB center to remove a subtract below - XMVECTOR oCenter = XMVectorSubtract(XMLoadFloat3(&box.Center), vCenter); - - XMVECTOR oExtents = XMLoadFloat3(&box.Extents); - XMVECTOR oOrientation = XMLoadFloat4(&box.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(oOrientation)); - - XMVECTOR Inside = XMVectorTrueInt(); - - for (size_t i = 0; i < BoundingOrientedBox::CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(oExtents, g_BoxOffset[i]), oOrientation), oCenter); - XMVECTOR d = XMVectorAbs(C); - Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); - } - - return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Frustum in axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingBox::Contains(const BoundingFrustum& fr) const noexcept -{ - if (!fr.Intersects(*this)) - return DISJOINT; - - XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; - fr.GetCorners(Corners); - - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - XMVECTOR Inside = XMVectorTrueInt(); - - for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) - { - XMVECTOR Point = XMLoadFloat3(&Corners[i]); - XMVECTOR d = XMVectorAbs(XMVectorSubtract(Point, vCenter)); - Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); - } - - return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Sphere vs axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingBox::Intersects(const BoundingSphere& sh) const noexcept -{ - XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); - XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); - - XMVECTOR BoxCenter = XMLoadFloat3(&Center); - XMVECTOR BoxExtents = XMLoadFloat3(&Extents); - - XMVECTOR BoxMin = XMVectorSubtract(BoxCenter, BoxExtents); - XMVECTOR BoxMax = XMVectorAdd(BoxCenter, BoxExtents); - - // Find the distance to the nearest point on the box. - // for each i in (x, y, z) - // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 - // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 - - XMVECTOR d = XMVectorZero(); - - // Compute d for each dimension. - XMVECTOR LessThanMin = XMVectorLess(SphereCenter, BoxMin); - XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxMax); - - XMVECTOR MinDelta = XMVectorSubtract(SphereCenter, BoxMin); - XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxMax); - - // Choose value for each dimension based on the comparison. - d = XMVectorSelect(d, MinDelta, LessThanMin); - d = XMVectorSelect(d, MaxDelta, GreaterThanMax); - - // Use a dot-product to square them and sum them together. - XMVECTOR d2 = XMVector3Dot(d, d); - - return XMVector3LessOrEqual(d2, XMVectorMultiply(SphereRadius, SphereRadius)); -} - - -//----------------------------------------------------------------------------- -// Axis-aligned box vs. axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingBox::Intersects(const BoundingBox& box) const noexcept -{ - XMVECTOR CenterA = XMLoadFloat3(&Center); - XMVECTOR ExtentsA = XMLoadFloat3(&Extents); - - XMVECTOR CenterB = XMLoadFloat3(&box.Center); - XMVECTOR ExtentsB = XMLoadFloat3(&box.Extents); - - XMVECTOR MinA = XMVectorSubtract(CenterA, ExtentsA); - XMVECTOR MaxA = XMVectorAdd(CenterA, ExtentsA); - - XMVECTOR MinB = XMVectorSubtract(CenterB, ExtentsB); - XMVECTOR MaxB = XMVectorAdd(CenterB, ExtentsB); - - // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then return false - XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(MinA, MaxB), XMVectorGreater(MinB, MaxA)); - - return !DirectX::MathInternal::XMVector3AnyTrue(Disjoint); -} - - -//----------------------------------------------------------------------------- -// Oriented box vs. axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingBox::Intersects(const BoundingOrientedBox& box) const noexcept -{ - return box.Intersects(*this); -} - - -//----------------------------------------------------------------------------- -// Frustum vs. axis-aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingBox::Intersects(const BoundingFrustum& fr) const noexcept -{ - return fr.Intersects(*this); -} - - -//----------------------------------------------------------------------------- -// Triangle vs. axis aligned box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingBox::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - XMVECTOR Zero = XMVectorZero(); - - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - XMVECTOR BoxMin = XMVectorSubtract(vCenter, vExtents); - XMVECTOR BoxMax = XMVectorAdd(vCenter, vExtents); - - // Test the axes of the box (in effect test the AAB against the minimal AAB - // around the triangle). - XMVECTOR TriMin = XMVectorMin(XMVectorMin(V0, V1), V2); - XMVECTOR TriMax = XMVectorMax(XMVectorMax(V0, V1), V2); - - // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then disjoint - XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(TriMin, BoxMax), XMVectorGreater(BoxMin, TriMax)); - if (DirectX::MathInternal::XMVector3AnyTrue(Disjoint)) - return false; - - // Test the plane of the triangle. - XMVECTOR Normal = XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0)); - XMVECTOR Dist = XMVector3Dot(Normal, V0); - - // Assert that the triangle is not degenerate. - assert(!XMVector3Equal(Normal, Zero)); - - // for each i in (x, y, z) if n(i) >= 0 then v_min(i)=b_min(i), v_max(i)=b_max(i) - // else v_min(i)=b_max(i), v_max(i)=b_min(i) - XMVECTOR NormalSelect = XMVectorGreater(Normal, Zero); - XMVECTOR V_Min = XMVectorSelect(BoxMax, BoxMin, NormalSelect); - XMVECTOR V_Max = XMVectorSelect(BoxMin, BoxMax, NormalSelect); - - // if n dot v_min + d > 0 || n dot v_max + d < 0 then disjoint - XMVECTOR MinDist = XMVector3Dot(V_Min, Normal); - XMVECTOR MaxDist = XMVector3Dot(V_Max, Normal); - - XMVECTOR NoIntersection = XMVectorGreater(MinDist, Dist); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(MaxDist, Dist)); - - // Move the box center to zero to simplify the following tests. - XMVECTOR TV0 = XMVectorSubtract(V0, vCenter); - XMVECTOR TV1 = XMVectorSubtract(V1, vCenter); - XMVECTOR TV2 = XMVectorSubtract(V2, vCenter); - - // Test the edge/edge axes (3*3). - XMVECTOR e0 = XMVectorSubtract(TV1, TV0); - XMVECTOR e1 = XMVectorSubtract(TV2, TV1); - XMVECTOR e2 = XMVectorSubtract(TV0, TV2); - - // Make w zero. - e0 = XMVectorInsert<0, 0, 0, 0, 1>(e0, Zero); - e1 = XMVectorInsert<0, 0, 0, 0, 1>(e1, Zero); - e2 = XMVectorInsert<0, 0, 0, 0, 1>(e2, Zero); - - XMVECTOR Axis; - XMVECTOR p0, p1, p2; - XMVECTOR Min, Max; - XMVECTOR Radius; - - // Axis == (1,0,0) x e0 = (0, -e0.z, e0.y) - Axis = XMVectorPermute(e0, XMVectorNegate(e0)); - p0 = XMVector3Dot(TV0, Axis); - // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; - p2 = XMVector3Dot(TV2, Axis); - Min = XMVectorMin(p0, p2); - Max = XMVectorMax(p0, p2); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (1,0,0) x e1 = (0, -e1.z, e1.y) - Axis = XMVectorPermute(e1, XMVectorNegate(e1)); - p0 = XMVector3Dot(TV0, Axis); - p1 = XMVector3Dot(TV1, Axis); - // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; - Min = XMVectorMin(p0, p1); - Max = XMVectorMax(p0, p1); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (1,0,0) x e2 = (0, -e2.z, e2.y) - Axis = XMVectorPermute(e2, XMVectorNegate(e2)); - p0 = XMVector3Dot(TV0, Axis); - p1 = XMVector3Dot(TV1, Axis); - // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; - Min = XMVectorMin(p0, p1); - Max = XMVectorMax(p0, p1); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (0,1,0) x e0 = (e0.z, 0, -e0.x) - Axis = XMVectorPermute(e0, XMVectorNegate(e0)); - p0 = XMVector3Dot(TV0, Axis); - // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; - p2 = XMVector3Dot(TV2, Axis); - Min = XMVectorMin(p0, p2); - Max = XMVectorMax(p0, p2); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (0,1,0) x e1 = (e1.z, 0, -e1.x) - Axis = XMVectorPermute(e1, XMVectorNegate(e1)); - p0 = XMVector3Dot(TV0, Axis); - p1 = XMVector3Dot(TV1, Axis); - // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; - Min = XMVectorMin(p0, p1); - Max = XMVectorMax(p0, p1); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (0,0,1) x e2 = (e2.z, 0, -e2.x) - Axis = XMVectorPermute(e2, XMVectorNegate(e2)); - p0 = XMVector3Dot(TV0, Axis); - p1 = XMVector3Dot(TV1, Axis); - // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; - Min = XMVectorMin(p0, p1); - Max = XMVectorMax(p0, p1); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (0,0,1) x e0 = (-e0.y, e0.x, 0) - Axis = XMVectorPermute(e0, XMVectorNegate(e0)); - p0 = XMVector3Dot(TV0, Axis); - // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; - p2 = XMVector3Dot(TV2, Axis); - Min = XMVectorMin(p0, p2); - Max = XMVectorMax(p0, p2); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (0,0,1) x e1 = (-e1.y, e1.x, 0) - Axis = XMVectorPermute(e1, XMVectorNegate(e1)); - p0 = XMVector3Dot(TV0, Axis); - p1 = XMVector3Dot(TV1, Axis); - // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; - Min = XMVectorMin(p0, p1); - Max = XMVectorMax(p0, p1); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - // Axis == (0,0,1) x e2 = (-e2.y, e2.x, 0) - Axis = XMVectorPermute(e2, XMVectorNegate(e2)); - p0 = XMVector3Dot(TV0, Axis); - p1 = XMVector3Dot(TV1, Axis); - // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; - Min = XMVectorMin(p0, p1); - Max = XMVectorMax(p0, p1); - Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); - - return XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt()); -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline PlaneIntersectionType XM_CALLCONV BoundingBox::Intersects(FXMVECTOR Plane) const noexcept -{ - assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); - - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - // Set w of the center to one so we can dot4 with a plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - XMVECTOR Outside, Inside; - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane, Outside, Inside); - - // If the box is outside any plane it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return FRONT; - - // If the box is inside all planes it is inside. - if (XMVector4EqualInt(Inside, XMVectorTrueInt())) - return BACK; - - // The box is not inside all planes or outside a plane it intersects. - return INTERSECTING; -} - - -//----------------------------------------------------------------------------- -// Compute the intersection of a ray (Origin, Direction) with an axis aligned -// box using the slabs method. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingBox::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept -{ - assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); - - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - // Adjust ray origin to be relative to center of the box. - XMVECTOR TOrigin = XMVectorSubtract(vCenter, Origin); - - // Compute the dot product againt each axis of the box. - // Since the axii are (1,0,0), (0,1,0), (0,0,1) no computation is necessary. - XMVECTOR AxisDotOrigin = TOrigin; - XMVECTOR AxisDotDirection = Direction; - - // if (fabs(AxisDotDirection) <= Epsilon) the ray is nearly parallel to the slab. - XMVECTOR IsParallel = XMVectorLessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon); - - // Test against all three axii simultaneously. - XMVECTOR InverseAxisDotDirection = XMVectorReciprocal(AxisDotDirection); - XMVECTOR t1 = XMVectorMultiply(XMVectorSubtract(AxisDotOrigin, vExtents), InverseAxisDotDirection); - XMVECTOR t2 = XMVectorMultiply(XMVectorAdd(AxisDotOrigin, vExtents), InverseAxisDotDirection); - - // Compute the max of min(t1,t2) and the min of max(t1,t2) ensuring we don't - // use the results from any directions parallel to the slab. - XMVECTOR t_min = XMVectorSelect(XMVectorMin(t1, t2), g_FltMin, IsParallel); - XMVECTOR t_max = XMVectorSelect(XMVectorMax(t1, t2), g_FltMax, IsParallel); - - // t_min.x = maximum( t_min.x, t_min.y, t_min.z ); - // t_max.x = minimum( t_max.x, t_max.y, t_max.z ); - t_min = XMVectorMax(t_min, XMVectorSplatY(t_min)); // x = max(x,y) - t_min = XMVectorMax(t_min, XMVectorSplatZ(t_min)); // x = max(max(x,y),z) - t_max = XMVectorMin(t_max, XMVectorSplatY(t_max)); // x = min(x,y) - t_max = XMVectorMin(t_max, XMVectorSplatZ(t_max)); // x = min(min(x,y),z) - - // if ( t_min > t_max ) return false; - XMVECTOR NoIntersection = XMVectorGreater(XMVectorSplatX(t_min), XMVectorSplatX(t_max)); - - // if ( t_max < 0.0f ) return false; - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorSplatX(t_max), XMVectorZero())); - - // if (IsParallel && (-Extents > AxisDotOrigin || Extents < AxisDotOrigin)) return false; - XMVECTOR ParallelOverlap = XMVectorInBounds(AxisDotOrigin, vExtents); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorAndCInt(IsParallel, ParallelOverlap)); - - if (!DirectX::MathInternal::XMVector3AnyTrue(NoIntersection)) - { - // Store the x-component to *pDist - XMStoreFloat(&Dist, t_min); - return true; - } - - Dist = 0.f; - return false; -} - - -//----------------------------------------------------------------------------- -// Test an axis alinged box vs 6 planes (typically forming a frustum). -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingBox::ContainedBy( - FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, - GXMVECTOR Plane3, - HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept -{ - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - - // Set w of the center to one so we can dot4 with a plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - XMVECTOR Outside, Inside; - - // Test against each plane. - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane0, Outside, Inside); - - XMVECTOR AnyOutside = Outside; - XMVECTOR AllInside = Inside; - - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane1, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane2, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane3, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane4, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane5, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - // If the box is outside any plane it is outside. - if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) - return DISJOINT; - - // If the box is inside all planes it is inside. - if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) - return CONTAINS; - - // The box is not inside all planes or outside a plane, it may intersect. - return INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Create axis-aligned box that contains two other bounding boxes -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingBox::CreateMerged(BoundingBox& Out, const BoundingBox& b1, const BoundingBox& b2) noexcept -{ - XMVECTOR b1Center = XMLoadFloat3(&b1.Center); - XMVECTOR b1Extents = XMLoadFloat3(&b1.Extents); - - XMVECTOR b2Center = XMLoadFloat3(&b2.Center); - XMVECTOR b2Extents = XMLoadFloat3(&b2.Extents); - - XMVECTOR Min = XMVectorSubtract(b1Center, b1Extents); - Min = XMVectorMin(Min, XMVectorSubtract(b2Center, b2Extents)); - - XMVECTOR Max = XMVectorAdd(b1Center, b1Extents); - Max = XMVectorMax(Max, XMVectorAdd(b2Center, b2Extents)); - - assert(XMVector3LessOrEqual(Min, Max)); - - XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); -} - - -//----------------------------------------------------------------------------- -// Create axis-aligned box that contains a bounding sphere -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingBox::CreateFromSphere(BoundingBox& Out, const BoundingSphere& sh) noexcept -{ - XMVECTOR spCenter = XMLoadFloat3(&sh.Center); - XMVECTOR shRadius = XMVectorReplicatePtr(&sh.Radius); - - XMVECTOR Min = XMVectorSubtract(spCenter, shRadius); - XMVECTOR Max = XMVectorAdd(spCenter, shRadius); - - assert(XMVector3LessOrEqual(Min, Max)); - - XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); -} - - -//----------------------------------------------------------------------------- -// Create axis-aligned box from min/max points -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingBox::CreateFromPoints(BoundingBox& Out, FXMVECTOR pt1, FXMVECTOR pt2) noexcept -{ - XMVECTOR Min = XMVectorMin(pt1, pt2); - XMVECTOR Max = XMVectorMax(pt1, pt2); - - // Store center and extents. - XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); -} - - -//----------------------------------------------------------------------------- -// Find the minimum axis aligned bounding box containing a set of points. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingBox::CreateFromPoints(BoundingBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept -{ - assert(Count > 0); - assert(pPoints); - - // Find the minimum and maximum x, y, and z - XMVECTOR vMin, vMax; - - vMin = vMax = XMLoadFloat3(pPoints); - - for (size_t i = 1; i < Count; ++i) - { - XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); - - vMin = XMVectorMin(vMin, Point); - vMax = XMVectorMax(vMax, Point); - } - - // Store center and extents. - XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(vMin, vMax), 0.5f)); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(vMax, vMin), 0.5f)); -} - - -/**************************************************************************** - * - * BoundingOrientedBox - * - ****************************************************************************/ - -//----------------------------------------------------------------------------- -// Transform an oriented box by an angle preserving transform. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingOrientedBox::Transform(BoundingOrientedBox& Out, FXMMATRIX M) const noexcept -{ - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Composite the box rotation and the transform rotation. - XMMATRIX nM; - nM.r[0] = XMVector3Normalize(M.r[0]); - nM.r[1] = XMVector3Normalize(M.r[1]); - nM.r[2] = XMVector3Normalize(M.r[2]); - nM.r[3] = g_XMIdentityR3; - XMVECTOR Rotation = XMQuaternionRotationMatrix(nM); - vOrientation = XMQuaternionMultiply(vOrientation, Rotation); - - // Transform the center. - vCenter = XMVector3Transform(vCenter, M); - - // Scale the box extents. - XMVECTOR dX = XMVector3Length(M.r[0]); - XMVECTOR dY = XMVector3Length(M.r[1]); - XMVECTOR dZ = XMVector3Length(M.r[2]); - - XMVECTOR VectorScale = XMVectorSelect(dY, dX, g_XMSelect1000); - VectorScale = XMVectorSelect(dZ, VectorScale, g_XMSelect1100); - vExtents = XMVectorMultiply(vExtents, VectorScale); - - // Store the box. - XMStoreFloat3(&Out.Center, vCenter); - XMStoreFloat3(&Out.Extents, vExtents); - XMStoreFloat4(&Out.Orientation, vOrientation); -} - -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingOrientedBox::Transform(BoundingOrientedBox& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept -{ - assert(DirectX::MathInternal::XMQuaternionIsUnit(Rotation)); - - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Composite the box rotation and the transform rotation. - vOrientation = XMQuaternionMultiply(vOrientation, Rotation); - - // Transform the center. - XMVECTOR VectorScale = XMVectorReplicate(Scale); - vCenter = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(vCenter, VectorScale), Rotation), Translation); - - // Scale the box extents. - vExtents = XMVectorMultiply(vExtents, VectorScale); - - // Store the box. - XMStoreFloat3(&Out.Center, vCenter); - XMStoreFloat3(&Out.Extents, vExtents); - XMStoreFloat4(&Out.Orientation, vOrientation); -} - - -//----------------------------------------------------------------------------- -// Get the corner points of the box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingOrientedBox::GetCorners(XMFLOAT3* Corners) const noexcept -{ - assert(Corners != nullptr); - - // Load the box - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - for (size_t i = 0; i < CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(vExtents, g_BoxOffset[i]), vOrientation), vCenter); - XMStoreFloat3(&Corners[i], C); - } -} - - -//----------------------------------------------------------------------------- -// Point in oriented box test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingOrientedBox::Contains(FXMVECTOR Point) const noexcept -{ - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Transform the point to be local to the box. - XMVECTOR TPoint = XMVector3InverseRotate(XMVectorSubtract(Point, vCenter), vOrientation); - - return XMVector3InBounds(TPoint, vExtents) ? CONTAINS : DISJOINT; -} - - -//----------------------------------------------------------------------------- -// Triangle in oriented bounding box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingOrientedBox::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - // Load the box center & orientation. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Transform the triangle vertices into the space of the box. - XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vCenter), vOrientation); - XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vCenter), vOrientation); - XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vCenter), vOrientation); - - BoundingBox box; - box.Center = XMFLOAT3(0.0f, 0.0f, 0.0f); - box.Extents = Extents; - - // Use the triangle vs axis aligned box intersection routine. - return box.Contains(TV0, TV1, TV2); -} - - -//----------------------------------------------------------------------------- -// Sphere in oriented bounding box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingOrientedBox::Contains(const BoundingSphere& sh) const noexcept -{ - XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); - XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); - - XMVECTOR BoxCenter = XMLoadFloat3(&Center); - XMVECTOR BoxExtents = XMLoadFloat3(&Extents); - XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); - - // Transform the center of the sphere to be local to the box. - // BoxMin = -BoxExtents - // BoxMax = +BoxExtents - SphereCenter = XMVector3InverseRotate(XMVectorSubtract(SphereCenter, BoxCenter), BoxOrientation); - - // Find the distance to the nearest point on the box. - // for each i in (x, y, z) - // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 - // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 - - XMVECTOR d = XMVectorZero(); - - // Compute d for each dimension. - XMVECTOR LessThanMin = XMVectorLess(SphereCenter, XMVectorNegate(BoxExtents)); - XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxExtents); - - XMVECTOR MinDelta = XMVectorAdd(SphereCenter, BoxExtents); - XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxExtents); - - // Choose value for each dimension based on the comparison. - d = XMVectorSelect(d, MinDelta, LessThanMin); - d = XMVectorSelect(d, MaxDelta, GreaterThanMax); - - // Use a dot-product to square them and sum them together. - XMVECTOR d2 = XMVector3Dot(d, d); - XMVECTOR SphereRadiusSq = XMVectorMultiply(SphereRadius, SphereRadius); - - if (XMVector4Greater(d2, SphereRadiusSq)) - return DISJOINT; - - // See if we are completely inside the box - XMVECTOR SMin = XMVectorSubtract(SphereCenter, SphereRadius); - XMVECTOR SMax = XMVectorAdd(SphereCenter, SphereRadius); - - return (XMVector3InBounds(SMin, BoxExtents) && XMVector3InBounds(SMax, BoxExtents)) ? CONTAINS : INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Axis aligned box vs. oriented box. Constructs an oriented box and uses -// the oriented box vs. oriented box test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingOrientedBox::Contains(const BoundingBox& box) const noexcept -{ - // Make the axis aligned box oriented and do an OBB vs OBB test. - BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); - return Contains(obox); -} - - -//----------------------------------------------------------------------------- -// Oriented bounding box in oriented bounding box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingOrientedBox::Contains(const BoundingOrientedBox& box) const noexcept -{ - if (!Intersects(box)) - return DISJOINT; - - // Load the boxes - XMVECTOR aCenter = XMLoadFloat3(&Center); - XMVECTOR aExtents = XMLoadFloat3(&Extents); - XMVECTOR aOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(aOrientation)); - - XMVECTOR bCenter = XMLoadFloat3(&box.Center); - XMVECTOR bExtents = XMLoadFloat3(&box.Extents); - XMVECTOR bOrientation = XMLoadFloat4(&box.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(bOrientation)); - - XMVECTOR offset = XMVectorSubtract(bCenter, aCenter); - - for (size_t i = 0; i < CORNER_COUNT; ++i) - { - // Cb = rotate( bExtents * corneroffset[i], bOrientation ) + bcenter - // Ca = invrotate( Cb - aCenter, aOrientation ) - - XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(bExtents, g_BoxOffset[i]), bOrientation), offset); - C = XMVector3InverseRotate(C, aOrientation); - - if (!XMVector3InBounds(C, aExtents)) - return INTERSECTS; - } - - return CONTAINS; -} - - -//----------------------------------------------------------------------------- -// Frustum in oriented bounding box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingOrientedBox::Contains(const BoundingFrustum& fr) const noexcept -{ - if (!fr.Intersects(*this)) - return DISJOINT; - - XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; - fr.GetCorners(Corners); - - // Load the box - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) - { - XMVECTOR C = XMVector3InverseRotate(XMVectorSubtract(XMLoadFloat3(&Corners[i]), vCenter), vOrientation); - - if (!XMVector3InBounds(C, vExtents)) - return INTERSECTS; - } - - return CONTAINS; -} - - -//----------------------------------------------------------------------------- -// Sphere vs. oriented box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingOrientedBox::Intersects(const BoundingSphere& sh) const noexcept -{ - XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); - XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); - - XMVECTOR BoxCenter = XMLoadFloat3(&Center); - XMVECTOR BoxExtents = XMLoadFloat3(&Extents); - XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); - - // Transform the center of the sphere to be local to the box. - // BoxMin = -BoxExtents - // BoxMax = +BoxExtents - SphereCenter = XMVector3InverseRotate(XMVectorSubtract(SphereCenter, BoxCenter), BoxOrientation); - - // Find the distance to the nearest point on the box. - // for each i in (x, y, z) - // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 - // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 - - XMVECTOR d = XMVectorZero(); - - // Compute d for each dimension. - XMVECTOR LessThanMin = XMVectorLess(SphereCenter, XMVectorNegate(BoxExtents)); - XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxExtents); - - XMVECTOR MinDelta = XMVectorAdd(SphereCenter, BoxExtents); - XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxExtents); - - // Choose value for each dimension based on the comparison. - d = XMVectorSelect(d, MinDelta, LessThanMin); - d = XMVectorSelect(d, MaxDelta, GreaterThanMax); - - // Use a dot-product to square them and sum them together. - XMVECTOR d2 = XMVector3Dot(d, d); - - return XMVector4LessOrEqual(d2, XMVectorMultiply(SphereRadius, SphereRadius)) ? true : false; -} - - -//----------------------------------------------------------------------------- -// Axis aligned box vs. oriented box. Constructs an oriented box and uses -// the oriented box vs. oriented box test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingOrientedBox::Intersects(const BoundingBox& box) const noexcept -{ - // Make the axis aligned box oriented and do an OBB vs OBB test. - BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); - return Intersects(obox); -} - - -//----------------------------------------------------------------------------- -// Fast oriented box / oriented box intersection test using the separating axis -// theorem. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingOrientedBox::Intersects(const BoundingOrientedBox& box) const noexcept -{ - // Build the 3x3 rotation matrix that defines the orientation of B relative to A. - XMVECTOR A_quat = XMLoadFloat4(&Orientation); - XMVECTOR B_quat = XMLoadFloat4(&box.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(A_quat)); - assert(DirectX::MathInternal::XMQuaternionIsUnit(B_quat)); - - XMVECTOR Q = XMQuaternionMultiply(A_quat, XMQuaternionConjugate(B_quat)); - XMMATRIX R = XMMatrixRotationQuaternion(Q); - - // Compute the translation of B relative to A. - XMVECTOR A_cent = XMLoadFloat3(&Center); - XMVECTOR B_cent = XMLoadFloat3(&box.Center); - XMVECTOR t = XMVector3InverseRotate(XMVectorSubtract(B_cent, A_cent), A_quat); - - // - // h(A) = extents of A. - // h(B) = extents of B. - // - // a(u) = axes of A = (1,0,0), (0,1,0), (0,0,1) - // b(u) = axes of B relative to A = (r00,r10,r20), (r01,r11,r21), (r02,r12,r22) - // - // For each possible separating axis l: - // d(A) = sum (for i = u,v,w) h(A)(i) * abs( a(i) dot l ) - // d(B) = sum (for i = u,v,w) h(B)(i) * abs( b(i) dot l ) - // if abs( t dot l ) > d(A) + d(B) then disjoint - // - - // Load extents of A and B. - XMVECTOR h_A = XMLoadFloat3(&Extents); - XMVECTOR h_B = XMLoadFloat3(&box.Extents); - - // Rows. Note R[0,1,2]X.w = 0. - XMVECTOR R0X = R.r[0]; - XMVECTOR R1X = R.r[1]; - XMVECTOR R2X = R.r[2]; - - R = XMMatrixTranspose(R); - - // Columns. Note RX[0,1,2].w = 0. - XMVECTOR RX0 = R.r[0]; - XMVECTOR RX1 = R.r[1]; - XMVECTOR RX2 = R.r[2]; - - // Absolute value of rows. - XMVECTOR AR0X = XMVectorAbs(R0X); - XMVECTOR AR1X = XMVectorAbs(R1X); - XMVECTOR AR2X = XMVectorAbs(R2X); - - // Absolute value of columns. - XMVECTOR ARX0 = XMVectorAbs(RX0); - XMVECTOR ARX1 = XMVectorAbs(RX1); - XMVECTOR ARX2 = XMVectorAbs(RX2); - - // Test each of the 15 possible seperating axii. - XMVECTOR d, d_A, d_B; - - // l = a(u) = (1, 0, 0) - // t dot l = t.x - // d(A) = h(A).x - // d(B) = h(B) dot abs(r00, r01, r02) - d = XMVectorSplatX(t); - d_A = XMVectorSplatX(h_A); - d_B = XMVector3Dot(h_B, AR0X); - XMVECTOR NoIntersection = XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B)); - - // l = a(v) = (0, 1, 0) - // t dot l = t.y - // d(A) = h(A).y - // d(B) = h(B) dot abs(r10, r11, r12) - d = XMVectorSplatY(t); - d_A = XMVectorSplatY(h_A); - d_B = XMVector3Dot(h_B, AR1X); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(w) = (0, 0, 1) - // t dot l = t.z - // d(A) = h(A).z - // d(B) = h(B) dot abs(r20, r21, r22) - d = XMVectorSplatZ(t); - d_A = XMVectorSplatZ(h_A); - d_B = XMVector3Dot(h_B, AR2X); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = b(u) = (r00, r10, r20) - // d(A) = h(A) dot abs(r00, r10, r20) - // d(B) = h(B).x - d = XMVector3Dot(t, RX0); - d_A = XMVector3Dot(h_A, ARX0); - d_B = XMVectorSplatX(h_B); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = b(v) = (r01, r11, r21) - // d(A) = h(A) dot abs(r01, r11, r21) - // d(B) = h(B).y - d = XMVector3Dot(t, RX1); - d_A = XMVector3Dot(h_A, ARX1); - d_B = XMVectorSplatY(h_B); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = b(w) = (r02, r12, r22) - // d(A) = h(A) dot abs(r02, r12, r22) - // d(B) = h(B).z - d = XMVector3Dot(t, RX2); - d_A = XMVector3Dot(h_A, ARX2); - d_B = XMVectorSplatZ(h_B); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(u) x b(u) = (0, -r20, r10) - // d(A) = h(A) dot abs(0, r20, r10) - // d(B) = h(B) dot abs(0, r02, r01) - d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(u) x b(v) = (0, -r21, r11) - // d(A) = h(A) dot abs(0, r21, r11) - // d(B) = h(B) dot abs(r02, 0, r00) - d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(u) x b(w) = (0, -r22, r12) - // d(A) = h(A) dot abs(0, r22, r12) - // d(B) = h(B) dot abs(r01, r00, 0) - d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(v) x b(u) = (r20, 0, -r00) - // d(A) = h(A) dot abs(r20, 0, r00) - // d(B) = h(B) dot abs(0, r12, r11) - d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(v) x b(v) = (r21, 0, -r01) - // d(A) = h(A) dot abs(r21, 0, r01) - // d(B) = h(B) dot abs(r12, 0, r10) - d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(v) x b(w) = (r22, 0, -r02) - // d(A) = h(A) dot abs(r22, 0, r02) - // d(B) = h(B) dot abs(r11, r10, 0) - d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(w) x b(u) = (-r10, r00, 0) - // d(A) = h(A) dot abs(r10, r00, 0) - // d(B) = h(B) dot abs(0, r22, r21) - d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(w) x b(v) = (-r11, r01, 0) - // d(A) = h(A) dot abs(r11, r01, 0) - // d(B) = h(B) dot abs(r22, 0, r20) - d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // l = a(w) x b(w) = (-r12, r02, 0) - // d(A) = h(A) dot abs(r12, r02, 0) - // d(B) = h(B) dot abs(r21, r20, 0) - d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); - d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); - d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); - NoIntersection = XMVectorOrInt(NoIntersection, - XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); - - // No seperating axis found, boxes must intersect. - return XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt()) ? true : false; -} - - -//----------------------------------------------------------------------------- -// Frustum vs. oriented box test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingOrientedBox::Intersects(const BoundingFrustum& fr) const noexcept -{ - return fr.Intersects(*this); -} - - -//----------------------------------------------------------------------------- -// Triangle vs. oriented box test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - // Load the box center & orientation. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Transform the triangle vertices into the space of the box. - XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vCenter), vOrientation); - XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vCenter), vOrientation); - XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vCenter), vOrientation); - - BoundingBox box; - box.Center = XMFLOAT3(0.0f, 0.0f, 0.0f); - box.Extents = Extents; - - // Use the triangle vs axis aligned box intersection routine. - return box.Intersects(TV0, TV1, TV2); -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline PlaneIntersectionType XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR Plane) const noexcept -{ - assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); - - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); - - // Set w of the center to one so we can dot4 with a plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - // Build the 3x3 rotation matrix that defines the box axes. - XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); - - XMVECTOR Outside, Inside; - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane, Outside, Inside); - - // If the box is outside any plane it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return FRONT; - - // If the box is inside all planes it is inside. - if (XMVector4EqualInt(Inside, XMVectorTrueInt())) - return BACK; - - // The box is not inside all planes or outside a plane it intersects. - return INTERSECTING; -} - - -//----------------------------------------------------------------------------- -// Compute the intersection of a ray (Origin, Direction) with an oriented box -// using the slabs method. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept -{ - assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); - - static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; - static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; - - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Get the boxes normalized side directions. - XMMATRIX R = XMMatrixRotationQuaternion(vOrientation); - - // Adjust ray origin to be relative to center of the box. - XMVECTOR TOrigin = XMVectorSubtract(vCenter, Origin); - - // Compute the dot product againt each axis of the box. - XMVECTOR AxisDotOrigin = XMVector3Dot(R.r[0], TOrigin); - AxisDotOrigin = XMVectorSelect(AxisDotOrigin, XMVector3Dot(R.r[1], TOrigin), SelectY); - AxisDotOrigin = XMVectorSelect(AxisDotOrigin, XMVector3Dot(R.r[2], TOrigin), SelectZ); - - XMVECTOR AxisDotDirection = XMVector3Dot(R.r[0], Direction); - AxisDotDirection = XMVectorSelect(AxisDotDirection, XMVector3Dot(R.r[1], Direction), SelectY); - AxisDotDirection = XMVectorSelect(AxisDotDirection, XMVector3Dot(R.r[2], Direction), SelectZ); - - // if (fabs(AxisDotDirection) <= Epsilon) the ray is nearly parallel to the slab. - XMVECTOR IsParallel = XMVectorLessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon); - - // Test against all three axes simultaneously. - XMVECTOR InverseAxisDotDirection = XMVectorReciprocal(AxisDotDirection); - XMVECTOR t1 = XMVectorMultiply(XMVectorSubtract(AxisDotOrigin, vExtents), InverseAxisDotDirection); - XMVECTOR t2 = XMVectorMultiply(XMVectorAdd(AxisDotOrigin, vExtents), InverseAxisDotDirection); - - // Compute the max of min(t1,t2) and the min of max(t1,t2) ensuring we don't - // use the results from any directions parallel to the slab. - XMVECTOR t_min = XMVectorSelect(XMVectorMin(t1, t2), g_FltMin, IsParallel); - XMVECTOR t_max = XMVectorSelect(XMVectorMax(t1, t2), g_FltMax, IsParallel); - - // t_min.x = maximum( t_min.x, t_min.y, t_min.z ); - // t_max.x = minimum( t_max.x, t_max.y, t_max.z ); - t_min = XMVectorMax(t_min, XMVectorSplatY(t_min)); // x = max(x,y) - t_min = XMVectorMax(t_min, XMVectorSplatZ(t_min)); // x = max(std::max(x,y),z) - t_max = XMVectorMin(t_max, XMVectorSplatY(t_max)); // x = min(x,y) - t_max = XMVectorMin(t_max, XMVectorSplatZ(t_max)); // x = min(std::min(x,y),z) - - // if ( t_min > t_max ) return false; - XMVECTOR NoIntersection = XMVectorGreater(XMVectorSplatX(t_min), XMVectorSplatX(t_max)); - - // if ( t_max < 0.0f ) return false; - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorSplatX(t_max), XMVectorZero())); - - // if (IsParallel && (-Extents > AxisDotOrigin || Extents < AxisDotOrigin)) return false; - XMVECTOR ParallelOverlap = XMVectorInBounds(AxisDotOrigin, vExtents); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorAndCInt(IsParallel, ParallelOverlap)); - - if (!DirectX::MathInternal::XMVector3AnyTrue(NoIntersection)) - { - // Store the x-component to *pDist - XMStoreFloat(&Dist, t_min); - return true; - } - - Dist = 0.f; - return false; -} - - -//----------------------------------------------------------------------------- -// Test an oriented box vs 6 planes (typically forming a frustum). -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingOrientedBox::ContainedBy( - FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, - GXMVECTOR Plane3, - HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept -{ - // Load the box. - XMVECTOR vCenter = XMLoadFloat3(&Center); - XMVECTOR vExtents = XMLoadFloat3(&Extents); - XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); - - // Set w of the center to one so we can dot4 with a plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - // Build the 3x3 rotation matrix that defines the box axes. - XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); - - XMVECTOR Outside, Inside; - - // Test against each plane. - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane0, Outside, Inside); - - XMVECTOR AnyOutside = Outside; - XMVECTOR AllInside = Inside; - - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane1, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane2, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane3, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane4, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane5, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - // If the box is outside any plane it is outside. - if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) - return DISJOINT; - - // If the box is inside all planes it is inside. - if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) - return CONTAINS; - - // The box is not inside all planes or outside a plane, it may intersect. - return INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Create oriented bounding box from axis-aligned bounding box -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingOrientedBox::CreateFromBoundingBox(BoundingOrientedBox& Out, const BoundingBox& box) noexcept -{ - Out.Center = box.Center; - Out.Extents = box.Extents; - Out.Orientation = XMFLOAT4(0.f, 0.f, 0.f, 1.f); -} - - -//----------------------------------------------------------------------------- -// Find the approximate minimum oriented bounding box containing a set of -// points. Exact computation of minimum oriented bounding box is possible but -// is slower and requires a more complex algorithm. -// The algorithm works by computing the inertia tensor of the points and then -// using the eigenvectors of the intertia tensor as the axes of the box. -// Computing the intertia tensor of the convex hull of the points will usually -// result in better bounding box but the computation is more complex. -// Exact computation of the minimum oriented bounding box is possible but the -// best know algorithm is O(N^3) and is significanly more complex to implement. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingOrientedBox::CreateFromPoints(BoundingOrientedBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept -{ - assert(Count > 0); - assert(pPoints != nullptr); - - XMVECTOR CenterOfMass = XMVectorZero(); - - // Compute the center of mass and inertia tensor of the points. - for (size_t i = 0; i < Count; ++i) - { - XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); - - CenterOfMass = XMVectorAdd(CenterOfMass, Point); - } - - CenterOfMass = XMVectorMultiply(CenterOfMass, XMVectorReciprocal(XMVectorReplicate(float(Count)))); - - // Compute the inertia tensor of the points around the center of mass. - // Using the center of mass is not strictly necessary, but will hopefully - // improve the stability of finding the eigenvectors. - XMVECTOR XX_YY_ZZ = XMVectorZero(); - XMVECTOR XY_XZ_YZ = XMVectorZero(); - - for (size_t i = 0; i < Count; ++i) - { - XMVECTOR Point = XMVectorSubtract(XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)), CenterOfMass); - - XX_YY_ZZ = XMVectorAdd(XX_YY_ZZ, XMVectorMultiply(Point, Point)); - - XMVECTOR XXY = XMVectorSwizzle(Point); - XMVECTOR YZZ = XMVectorSwizzle(Point); - - XY_XZ_YZ = XMVectorAdd(XY_XZ_YZ, XMVectorMultiply(XXY, YZZ)); - } - - XMVECTOR v1, v2, v3; - - // Compute the eigenvectors of the inertia tensor. - DirectX::MathInternal::CalculateEigenVectorsFromCovarianceMatrix(XMVectorGetX(XX_YY_ZZ), XMVectorGetY(XX_YY_ZZ), - XMVectorGetZ(XX_YY_ZZ), - XMVectorGetX(XY_XZ_YZ), XMVectorGetY(XY_XZ_YZ), - XMVectorGetZ(XY_XZ_YZ), - &v1, &v2, &v3); - - // Put them in a matrix. - XMMATRIX R; - - R.r[0] = XMVectorSetW(v1, 0.f); - R.r[1] = XMVectorSetW(v2, 0.f); - R.r[2] = XMVectorSetW(v3, 0.f); - R.r[3] = g_XMIdentityR3.v; - - // Multiply by -1 to convert the matrix into a right handed coordinate - // system (Det ~= 1) in case the eigenvectors form a left handed - // coordinate system (Det ~= -1) because XMQuaternionRotationMatrix only - // works on right handed matrices. - XMVECTOR Det = XMMatrixDeterminant(R); - - if (XMVector4Less(Det, XMVectorZero())) - { - R.r[0] = XMVectorMultiply(R.r[0], g_XMNegativeOne.v); - R.r[1] = XMVectorMultiply(R.r[1], g_XMNegativeOne.v); - R.r[2] = XMVectorMultiply(R.r[2], g_XMNegativeOne.v); - } - - // Get the rotation quaternion from the matrix. - XMVECTOR vOrientation = XMQuaternionRotationMatrix(R); - - // Make sure it is normal (in case the vectors are slightly non-orthogonal). - vOrientation = XMQuaternionNormalize(vOrientation); - - // Rebuild the rotation matrix from the quaternion. - R = XMMatrixRotationQuaternion(vOrientation); - - // Build the rotation into the rotated space. - XMMATRIX InverseR = XMMatrixTranspose(R); - - // Find the minimum OBB using the eigenvectors as the axes. - XMVECTOR vMin, vMax; - - vMin = vMax = XMVector3TransformNormal(XMLoadFloat3(pPoints), InverseR); - - for (size_t i = 1; i < Count; ++i) - { - XMVECTOR Point = XMVector3TransformNormal(XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)), - InverseR); - - vMin = XMVectorMin(vMin, Point); - vMax = XMVectorMax(vMax, Point); - } - - // Rotate the center into world space. - XMVECTOR vCenter = XMVectorScale(XMVectorAdd(vMin, vMax), 0.5f); - vCenter = XMVector3TransformNormal(vCenter, R); - - // Store center, extents, and orientation. - XMStoreFloat3(&Out.Center, vCenter); - XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(vMax, vMin), 0.5f)); - XMStoreFloat4(&Out.Orientation, vOrientation); -} - - -/**************************************************************************** - * - * BoundingFrustum - * - ****************************************************************************/ - -_Use_decl_annotations_ -inline BoundingFrustum::BoundingFrustum(CXMMATRIX Projection, bool rhcoords) noexcept -{ - CreateFromMatrix(*this, Projection, rhcoords); -} - - -//----------------------------------------------------------------------------- -// Transform a frustum by an angle preserving transform. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingFrustum::Transform(BoundingFrustum& Out, FXMMATRIX M) const noexcept -{ - // Load the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Composite the frustum rotation and the transform rotation - XMMATRIX nM; - nM.r[0] = XMVector3Normalize(M.r[0]); - nM.r[1] = XMVector3Normalize(M.r[1]); - nM.r[2] = XMVector3Normalize(M.r[2]); - nM.r[3] = g_XMIdentityR3; - XMVECTOR Rotation = XMQuaternionRotationMatrix(nM); - vOrientation = XMQuaternionMultiply(vOrientation, Rotation); - - // Transform the center. - vOrigin = XMVector3Transform(vOrigin, M); - - // Store the frustum. - XMStoreFloat3(&Out.Origin, vOrigin); - XMStoreFloat4(&Out.Orientation, vOrientation); - - // Scale the near and far distances (the slopes remain the same). - XMVECTOR dX = XMVector3Dot(M.r[0], M.r[0]); - XMVECTOR dY = XMVector3Dot(M.r[1], M.r[1]); - XMVECTOR dZ = XMVector3Dot(M.r[2], M.r[2]); - - XMVECTOR d = XMVectorMax(dX, XMVectorMax(dY, dZ)); - float Scale = sqrtf(XMVectorGetX(d)); - - Out.Near = Near * Scale; - Out.Far = Far * Scale; - - // Copy the slopes. - Out.RightSlope = RightSlope; - Out.LeftSlope = LeftSlope; - Out.TopSlope = TopSlope; - Out.BottomSlope = BottomSlope; -} - -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingFrustum::Transform(BoundingFrustum& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept -{ - assert(DirectX::MathInternal::XMQuaternionIsUnit(Rotation)); - - // Load the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Composite the frustum rotation and the transform rotation. - vOrientation = XMQuaternionMultiply(vOrientation, Rotation); - - // Transform the origin. - vOrigin = XMVectorAdd(XMVector3Rotate(XMVectorScale(vOrigin, Scale), Rotation), Translation); - - // Store the frustum. - XMStoreFloat3(&Out.Origin, vOrigin); - XMStoreFloat4(&Out.Orientation, vOrientation); - - // Scale the near and far distances (the slopes remain the same). - Out.Near = Near * Scale; - Out.Far = Far * Scale; - - // Copy the slopes. - Out.RightSlope = RightSlope; - Out.LeftSlope = LeftSlope; - Out.TopSlope = TopSlope; - Out.BottomSlope = BottomSlope; -} - - -//----------------------------------------------------------------------------- -// Get the corner points of the frustum -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingFrustum::GetCorners(XMFLOAT3* Corners) const noexcept -{ - assert(Corners != nullptr); - - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Build the corners of the frustum. - XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&Near); - XMVECTOR vFar = XMVectorReplicatePtr(&Far); - - // Returns 8 corners position of bounding frustum. - // Near Far - // 0----1 4----5 - // | | | | - // | | | | - // 3----2 7----6 - - XMVECTOR vCorners[CORNER_COUNT]; - vCorners[0] = XMVectorMultiply(vLeftTop, vNear); - vCorners[1] = XMVectorMultiply(vRightTop, vNear); - vCorners[2] = XMVectorMultiply(vRightBottom, vNear); - vCorners[3] = XMVectorMultiply(vLeftBottom, vNear); - vCorners[4] = XMVectorMultiply(vLeftTop, vFar); - vCorners[5] = XMVectorMultiply(vRightTop, vFar); - vCorners[6] = XMVectorMultiply(vRightBottom, vFar); - vCorners[7] = XMVectorMultiply(vLeftBottom, vFar); - - for (size_t i = 0; i < CORNER_COUNT; ++i) - { - XMVECTOR C = XMVectorAdd(XMVector3Rotate(vCorners[i], vOrientation), vOrigin); - XMStoreFloat3(&Corners[i], C); - } -} - - -//----------------------------------------------------------------------------- -// Point in frustum test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingFrustum::Contains(FXMVECTOR Point) const noexcept -{ - // Build frustum planes. - XMVECTOR Planes[6]; - Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - - // Load origin and orientation. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Transform point into local space of frustum. - XMVECTOR TPoint = XMVector3InverseRotate(XMVectorSubtract(Point, vOrigin), vOrientation); - - // Set w to one. - TPoint = XMVectorInsert<0, 0, 0, 0, 1>(TPoint, XMVectorSplatOne()); - - XMVECTOR Zero = XMVectorZero(); - XMVECTOR Outside = Zero; - - // Test point against each plane of the frustum. - for (size_t i = 0; i < 6; ++i) - { - XMVECTOR Dot = XMVector4Dot(TPoint, Planes[i]); - Outside = XMVectorOrInt(Outside, XMVectorGreater(Dot, Zero)); - } - - return XMVector4NotEqualInt(Outside, XMVectorTrueInt()) ? CONTAINS : DISJOINT; -} - - -//----------------------------------------------------------------------------- -// Triangle vs frustum test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingFrustum::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Create 6 planes (do it inline to encourage use of registers) - XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); - NearPlane = XMPlaneNormalize(NearPlane); - - XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); - FarPlane = XMPlaneNormalize(FarPlane); - - XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); - RightPlane = XMPlaneNormalize(RightPlane); - - XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); - LeftPlane = XMPlaneNormalize(LeftPlane); - - XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); - TopPlane = XMPlaneNormalize(TopPlane); - - XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); - BottomPlane = XMPlaneNormalize(BottomPlane); - - return TriangleTests::ContainedBy(V0, V1, V2, NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingFrustum::Contains(const BoundingSphere& sh) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Create 6 planes (do it inline to encourage use of registers) - XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); - NearPlane = XMPlaneNormalize(NearPlane); - - XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); - FarPlane = XMPlaneNormalize(FarPlane); - - XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); - RightPlane = XMPlaneNormalize(RightPlane); - - XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); - LeftPlane = XMPlaneNormalize(LeftPlane); - - XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); - TopPlane = XMPlaneNormalize(TopPlane); - - XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); - BottomPlane = XMPlaneNormalize(BottomPlane); - - return sh.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingFrustum::Contains(const BoundingBox& box) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Create 6 planes (do it inline to encourage use of registers) - XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); - NearPlane = XMPlaneNormalize(NearPlane); - - XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); - FarPlane = XMPlaneNormalize(FarPlane); - - XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); - RightPlane = XMPlaneNormalize(RightPlane); - - XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); - LeftPlane = XMPlaneNormalize(LeftPlane); - - XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); - TopPlane = XMPlaneNormalize(TopPlane); - - XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); - BottomPlane = XMPlaneNormalize(BottomPlane); - - return box.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingFrustum::Contains(const BoundingOrientedBox& box) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Create 6 planes (do it inline to encourage use of registers) - XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); - NearPlane = XMPlaneNormalize(NearPlane); - - XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); - FarPlane = XMPlaneNormalize(FarPlane); - - XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); - RightPlane = XMPlaneNormalize(RightPlane); - - XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); - LeftPlane = XMPlaneNormalize(LeftPlane); - - XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); - TopPlane = XMPlaneNormalize(TopPlane); - - XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); - BottomPlane = XMPlaneNormalize(BottomPlane); - - return box.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType BoundingFrustum::Contains(const BoundingFrustum& fr) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - // Create 6 planes (do it inline to encourage use of registers) - XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); - NearPlane = XMPlaneNormalize(NearPlane); - - XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); - FarPlane = XMPlaneNormalize(FarPlane); - - XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); - RightPlane = XMPlaneNormalize(RightPlane); - - XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); - LeftPlane = XMPlaneNormalize(LeftPlane); - - XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); - TopPlane = XMPlaneNormalize(TopPlane); - - XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); - BottomPlane = XMPlaneNormalize(BottomPlane); - - return fr.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); -} - - -//----------------------------------------------------------------------------- -// Exact sphere vs frustum test. The algorithm first checks the sphere against -// the planes of the frustum, then if the plane checks were indeterminate finds -// the nearest feature (plane, line, point) on the frustum to the center of the -// sphere and compares the distance to the nearest feature to the radius of the -// sphere -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingFrustum::Intersects(const BoundingSphere& sh) const noexcept -{ - XMVECTOR Zero = XMVectorZero(); - - // Build the frustum planes. - XMVECTOR Planes[6]; - Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - - // Normalize the planes so we can compare to the sphere radius. - Planes[2] = XMVector3Normalize(Planes[2]); - Planes[3] = XMVector3Normalize(Planes[3]); - Planes[4] = XMVector3Normalize(Planes[4]); - Planes[5] = XMVector3Normalize(Planes[5]); - - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Load the sphere. - XMVECTOR vCenter = XMLoadFloat3(&sh.Center); - XMVECTOR vRadius = XMVectorReplicatePtr(&sh.Radius); - - // Transform the center of the sphere into the local space of frustum. - vCenter = XMVector3InverseRotate(XMVectorSubtract(vCenter, vOrigin), vOrientation); - - // Set w of the center to one so we can dot4 with the plane. - vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); - - // Check against each plane of the frustum. - XMVECTOR Outside = XMVectorFalseInt(); - XMVECTOR InsideAll = XMVectorTrueInt(); - XMVECTOR CenterInsideAll = XMVectorTrueInt(); - - XMVECTOR Dist[6]; - - for (size_t i = 0; i < 6; ++i) - { - Dist[i] = XMVector4Dot(vCenter, Planes[i]); - - // Outside the plane? - Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist[i], vRadius)); - - // Fully inside the plane? - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Dist[i], XMVectorNegate(vRadius))); - - // Check if the center is inside the plane. - CenterInsideAll = XMVectorAndInt(CenterInsideAll, XMVectorLessOrEqual(Dist[i], Zero)); - } - - // If the sphere is outside any of the planes it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If the sphere is inside all planes it is fully inside. - if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) - return true; - - // If the center of the sphere is inside all planes and the sphere intersects - // one or more planes then it must intersect. - if (XMVector4EqualInt(CenterInsideAll, XMVectorTrueInt())) - return true; - - // The sphere may be outside the frustum or intersecting the frustum. - // Find the nearest feature (face, edge, or corner) on the frustum - // to the sphere. - - // The faces adjacent to each face are: - static const size_t adjacent_faces[6][4] = - { - { 2, 3, 4, 5 }, // 0 - { 2, 3, 4, 5 }, // 1 - { 0, 1, 4, 5 }, // 2 - { 0, 1, 4, 5 }, // 3 - { 0, 1, 2, 3 }, // 4 - { 0, 1, 2, 3 } - }; // 5 - - XMVECTOR Intersects = XMVectorFalseInt(); - - // Check to see if the nearest feature is one of the planes. - for (size_t i = 0; i < 6; ++i) - { - // Find the nearest point on the plane to the center of the sphere. - XMVECTOR Point = XMVectorNegativeMultiplySubtract(Planes[i], Dist[i], vCenter); - - // Set w of the point to one. - Point = XMVectorInsert<0, 0, 0, 0, 1>(Point, XMVectorSplatOne()); - - // If the point is inside the face (inside the adjacent planes) then - // this plane is the nearest feature. - XMVECTOR InsideFace = XMVectorTrueInt(); - - for (size_t j = 0; j < 4; j++) - { - size_t plane_index = adjacent_faces[i][j]; - - InsideFace = XMVectorAndInt(InsideFace, - XMVectorLessOrEqual(XMVector4Dot(Point, Planes[plane_index]), Zero)); - } - - // Since we have already checked distance from the plane we know that the - // sphere must intersect if this plane is the nearest feature. - Intersects = XMVectorOrInt(Intersects, - XMVectorAndInt(XMVectorGreater(Dist[i], Zero), InsideFace)); - } - - if (XMVector4EqualInt(Intersects, XMVectorTrueInt())) - return true; - - // Build the corners of the frustum. - XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&Near); - XMVECTOR vFar = XMVectorReplicatePtr(&Far); - - XMVECTOR Corners[CORNER_COUNT]; - Corners[0] = XMVectorMultiply(vRightTop, vNear); - Corners[1] = XMVectorMultiply(vRightBottom, vNear); - Corners[2] = XMVectorMultiply(vLeftTop, vNear); - Corners[3] = XMVectorMultiply(vLeftBottom, vNear); - Corners[4] = XMVectorMultiply(vRightTop, vFar); - Corners[5] = XMVectorMultiply(vRightBottom, vFar); - Corners[6] = XMVectorMultiply(vLeftTop, vFar); - Corners[7] = XMVectorMultiply(vLeftBottom, vFar); - - // The Edges are: - static const size_t edges[12][2] = - { - { 0, 1 }, { 2, 3 }, { 0, 2 }, { 1, 3 }, // Near plane - { 4, 5 }, { 6, 7 }, { 4, 6 }, { 5, 7 }, // Far plane - { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }, - }; // Near to far - - XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); - - // Check to see if the nearest feature is one of the edges (or corners). - for (size_t i = 0; i < 12; ++i) - { - size_t ei0 = edges[i][0]; - size_t ei1 = edges[i][1]; - - // Find the nearest point on the edge to the center of the sphere. - // The corners of the frustum are included as the endpoints of the edges. - XMVECTOR Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(Corners[ei0], Corners[ei1], vCenter); - - XMVECTOR Delta = XMVectorSubtract(vCenter, Point); - - XMVECTOR DistSq = XMVector3Dot(Delta, Delta); - - // If the distance to the center of the sphere to the point is less than - // the radius of the sphere then it must intersect. - Intersects = XMVectorOrInt(Intersects, XMVectorLessOrEqual(DistSq, RadiusSq)); - } - - if (XMVector4EqualInt(Intersects, XMVectorTrueInt())) - return true; - - // The sphere must be outside the frustum. - return false; -} - - -//----------------------------------------------------------------------------- -// Exact axis aligned box vs frustum test. Constructs an oriented box and uses -// the oriented box vs frustum test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingFrustum::Intersects(const BoundingBox& box) const noexcept -{ - // Make the axis aligned box oriented and do an OBB vs frustum test. - BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); - return Intersects(obox); -} - - -//----------------------------------------------------------------------------- -// Exact oriented box vs frustum test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingFrustum::Intersects(const BoundingOrientedBox& box) const noexcept -{ - static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; - static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; - - XMVECTOR Zero = XMVectorZero(); - - // Build the frustum planes. - XMVECTOR Planes[6]; - Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR FrustumOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(FrustumOrientation)); - - // Load the box. - XMVECTOR Center = XMLoadFloat3(&box.Center); - XMVECTOR Extents = XMLoadFloat3(&box.Extents); - XMVECTOR BoxOrientation = XMLoadFloat4(&box.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); - - // Transform the oriented box into the space of the frustum in order to - // minimize the number of transforms we have to do. - Center = XMVector3InverseRotate(XMVectorSubtract(Center, vOrigin), FrustumOrientation); - BoxOrientation = XMQuaternionMultiply(BoxOrientation, XMQuaternionConjugate(FrustumOrientation)); - - // Set w of the center to one so we can dot4 with the plane. - Center = XMVectorInsert<0, 0, 0, 0, 1>(Center, XMVectorSplatOne()); - - // Build the 3x3 rotation matrix that defines the box axes. - XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); - - // Check against each plane of the frustum. - XMVECTOR Outside = XMVectorFalseInt(); - XMVECTOR InsideAll = XMVectorTrueInt(); - XMVECTOR CenterInsideAll = XMVectorTrueInt(); - - for (size_t i = 0; i < 6; ++i) - { - // Compute the distance to the center of the box. - XMVECTOR Dist = XMVector4Dot(Center, Planes[i]); - - // Project the axes of the box onto the normal of the plane. Half the - // length of the projection (sometime called the "radius") is equal to - // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) - // where h(i) are extents of the box, n is the plane normal, and b(i) are the - // axes of the box. - XMVECTOR Radius = XMVector3Dot(Planes[i], R.r[0]); - Radius = XMVectorSelect(Radius, XMVector3Dot(Planes[i], R.r[1]), SelectY); - Radius = XMVectorSelect(Radius, XMVector3Dot(Planes[i], R.r[2]), SelectZ); - Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); - - // Outside the plane? - Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist, Radius)); - - // Fully inside the plane? - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Dist, XMVectorNegate(Radius))); - - // Check if the center is inside the plane. - CenterInsideAll = XMVectorAndInt(CenterInsideAll, XMVectorLessOrEqual(Dist, Zero)); - } - - // If the box is outside any of the planes it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If the box is inside all planes it is fully inside. - if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) - return true; - - // If the center of the box is inside all planes and the box intersects - // one or more planes then it must intersect. - if (XMVector4EqualInt(CenterInsideAll, XMVectorTrueInt())) - return true; - - // Build the corners of the frustum. - XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&Near); - XMVECTOR vFar = XMVectorReplicatePtr(&Far); - - XMVECTOR Corners[CORNER_COUNT]; - Corners[0] = XMVectorMultiply(vRightTop, vNear); - Corners[1] = XMVectorMultiply(vRightBottom, vNear); - Corners[2] = XMVectorMultiply(vLeftTop, vNear); - Corners[3] = XMVectorMultiply(vLeftBottom, vNear); - Corners[4] = XMVectorMultiply(vRightTop, vFar); - Corners[5] = XMVectorMultiply(vRightBottom, vFar); - Corners[6] = XMVectorMultiply(vLeftTop, vFar); - Corners[7] = XMVectorMultiply(vLeftBottom, vFar); - - // Test against box axes (3) - { - // Find the min/max values of the projection of the frustum onto each axis. - XMVECTOR FrustumMin, FrustumMax; - - FrustumMin = XMVector3Dot(Corners[0], R.r[0]); - FrustumMin = XMVectorSelect(FrustumMin, XMVector3Dot(Corners[0], R.r[1]), SelectY); - FrustumMin = XMVectorSelect(FrustumMin, XMVector3Dot(Corners[0], R.r[2]), SelectZ); - FrustumMax = FrustumMin; - - for (size_t i = 1; i < BoundingOrientedBox::CORNER_COUNT; ++i) - { - XMVECTOR Temp = XMVector3Dot(Corners[i], R.r[0]); - Temp = XMVectorSelect(Temp, XMVector3Dot(Corners[i], R.r[1]), SelectY); - Temp = XMVectorSelect(Temp, XMVector3Dot(Corners[i], R.r[2]), SelectZ); - - FrustumMin = XMVectorMin(FrustumMin, Temp); - FrustumMax = XMVectorMax(FrustumMax, Temp); - } - - // Project the center of the box onto the axes. - XMVECTOR BoxDist = XMVector3Dot(Center, R.r[0]); - BoxDist = XMVectorSelect(BoxDist, XMVector3Dot(Center, R.r[1]), SelectY); - BoxDist = XMVectorSelect(BoxDist, XMVector3Dot(Center, R.r[2]), SelectZ); - - // The projection of the box onto the axis is just its Center and Extents. - // if (min > box_max || max < box_min) reject; - XMVECTOR Result = XMVectorOrInt(XMVectorGreater(FrustumMin, XMVectorAdd(BoxDist, Extents)), - XMVectorLess(FrustumMax, XMVectorSubtract(BoxDist, Extents))); - - if (DirectX::MathInternal::XMVector3AnyTrue(Result)) - return false; - } - - // Test against edge/edge axes (3*6). - XMVECTOR FrustumEdgeAxis[6]; - - FrustumEdgeAxis[0] = vRightTop; - FrustumEdgeAxis[1] = vRightBottom; - FrustumEdgeAxis[2] = vLeftTop; - FrustumEdgeAxis[3] = vLeftBottom; - FrustumEdgeAxis[4] = XMVectorSubtract(vRightTop, vLeftTop); - FrustumEdgeAxis[5] = XMVectorSubtract(vLeftBottom, vLeftTop); - - for (size_t i = 0; i < 3; ++i) - { - for (size_t j = 0; j < 6; j++) - { - // Compute the axis we are going to test. - XMVECTOR Axis = XMVector3Cross(R.r[i], FrustumEdgeAxis[j]); - - // Find the min/max values of the projection of the frustum onto the axis. - XMVECTOR FrustumMin, FrustumMax; - - FrustumMin = FrustumMax = XMVector3Dot(Axis, Corners[0]); - - for (size_t k = 1; k < CORNER_COUNT; k++) - { - XMVECTOR Temp = XMVector3Dot(Axis, Corners[k]); - FrustumMin = XMVectorMin(FrustumMin, Temp); - FrustumMax = XMVectorMax(FrustumMax, Temp); - } - - // Project the center of the box onto the axis. - XMVECTOR Dist = XMVector3Dot(Center, Axis); - - // Project the axes of the box onto the axis to find the "radius" of the box. - XMVECTOR Radius = XMVector3Dot(Axis, R.r[0]); - Radius = XMVectorSelect(Radius, XMVector3Dot(Axis, R.r[1]), SelectY); - Radius = XMVectorSelect(Radius, XMVector3Dot(Axis, R.r[2]), SelectZ); - Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); - - // if (center > max + radius || center < min - radius) reject; - Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist, XMVectorAdd(FrustumMax, Radius))); - Outside = XMVectorOrInt(Outside, XMVectorLess(Dist, XMVectorSubtract(FrustumMin, Radius))); - } - } - - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If we did not find a separating plane then the box must intersect the frustum. - return true; -} - - -//----------------------------------------------------------------------------- -// Exact frustum vs frustum test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool BoundingFrustum::Intersects(const BoundingFrustum& fr) const noexcept -{ - // Load origin and orientation of frustum B. - XMVECTOR OriginB = XMLoadFloat3(&Origin); - XMVECTOR OrientationB = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(OrientationB)); - - // Build the planes of frustum B. - XMVECTOR AxisB[6]; - AxisB[0] = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f); - AxisB[1] = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); - AxisB[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - AxisB[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - AxisB[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - AxisB[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - - XMVECTOR PlaneDistB[6]; - PlaneDistB[0] = XMVectorNegate(XMVectorReplicatePtr(&Near)); - PlaneDistB[1] = XMVectorReplicatePtr(&Far); - PlaneDistB[2] = XMVectorZero(); - PlaneDistB[3] = XMVectorZero(); - PlaneDistB[4] = XMVectorZero(); - PlaneDistB[5] = XMVectorZero(); - - // Load origin and orientation of frustum A. - XMVECTOR OriginA = XMLoadFloat3(&fr.Origin); - XMVECTOR OrientationA = XMLoadFloat4(&fr.Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(OrientationA)); - - // Transform frustum A into the space of the frustum B in order to - // minimize the number of transforms we have to do. - OriginA = XMVector3InverseRotate(XMVectorSubtract(OriginA, OriginB), OrientationB); - OrientationA = XMQuaternionMultiply(OrientationA, XMQuaternionConjugate(OrientationB)); - - // Build the corners of frustum A (in the local space of B). - XMVECTOR RightTopA = XMVectorSet(fr.RightSlope, fr.TopSlope, 1.0f, 0.0f); - XMVECTOR RightBottomA = XMVectorSet(fr.RightSlope, fr.BottomSlope, 1.0f, 0.0f); - XMVECTOR LeftTopA = XMVectorSet(fr.LeftSlope, fr.TopSlope, 1.0f, 0.0f); - XMVECTOR LeftBottomA = XMVectorSet(fr.LeftSlope, fr.BottomSlope, 1.0f, 0.0f); - XMVECTOR NearA = XMVectorReplicatePtr(&fr.Near); - XMVECTOR FarA = XMVectorReplicatePtr(&fr.Far); - - RightTopA = XMVector3Rotate(RightTopA, OrientationA); - RightBottomA = XMVector3Rotate(RightBottomA, OrientationA); - LeftTopA = XMVector3Rotate(LeftTopA, OrientationA); - LeftBottomA = XMVector3Rotate(LeftBottomA, OrientationA); - - XMVECTOR CornersA[CORNER_COUNT]; - CornersA[0] = XMVectorMultiplyAdd(RightTopA, NearA, OriginA); - CornersA[1] = XMVectorMultiplyAdd(RightBottomA, NearA, OriginA); - CornersA[2] = XMVectorMultiplyAdd(LeftTopA, NearA, OriginA); - CornersA[3] = XMVectorMultiplyAdd(LeftBottomA, NearA, OriginA); - CornersA[4] = XMVectorMultiplyAdd(RightTopA, FarA, OriginA); - CornersA[5] = XMVectorMultiplyAdd(RightBottomA, FarA, OriginA); - CornersA[6] = XMVectorMultiplyAdd(LeftTopA, FarA, OriginA); - CornersA[7] = XMVectorMultiplyAdd(LeftBottomA, FarA, OriginA); - - // Check frustum A against each plane of frustum B. - XMVECTOR Outside = XMVectorFalseInt(); - XMVECTOR InsideAll = XMVectorTrueInt(); - - for (size_t i = 0; i < 6; ++i) - { - // Find the min/max projection of the frustum onto the plane normal. - XMVECTOR Min, Max; - - Min = Max = XMVector3Dot(AxisB[i], CornersA[0]); - - for (size_t j = 1; j < CORNER_COUNT; j++) - { - XMVECTOR Temp = XMVector3Dot(AxisB[i], CornersA[j]); - Min = XMVectorMin(Min, Temp); - Max = XMVectorMax(Max, Temp); - } - - // Outside the plane? - Outside = XMVectorOrInt(Outside, XMVectorGreater(Min, PlaneDistB[i])); - - // Fully inside the plane? - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Max, PlaneDistB[i])); - } - - // If the frustum A is outside any of the planes of frustum B it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If frustum A is inside all planes of frustum B it is fully inside. - if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) - return true; - - // Build the corners of frustum B. - XMVECTOR RightTopB = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR RightBottomB = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR LeftTopB = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR LeftBottomB = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR NearB = XMVectorReplicatePtr(&Near); - XMVECTOR FarB = XMVectorReplicatePtr(&Far); - - XMVECTOR CornersB[BoundingFrustum::CORNER_COUNT]; - CornersB[0] = XMVectorMultiply(RightTopB, NearB); - CornersB[1] = XMVectorMultiply(RightBottomB, NearB); - CornersB[2] = XMVectorMultiply(LeftTopB, NearB); - CornersB[3] = XMVectorMultiply(LeftBottomB, NearB); - CornersB[4] = XMVectorMultiply(RightTopB, FarB); - CornersB[5] = XMVectorMultiply(RightBottomB, FarB); - CornersB[6] = XMVectorMultiply(LeftTopB, FarB); - CornersB[7] = XMVectorMultiply(LeftBottomB, FarB); - - // Build the planes of frustum A (in the local space of B). - XMVECTOR AxisA[6]; - XMVECTOR PlaneDistA[6]; - - AxisA[0] = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f); - AxisA[1] = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); - AxisA[2] = XMVectorSet(1.0f, 0.0f, -fr.RightSlope, 0.0f); - AxisA[3] = XMVectorSet(-1.0f, 0.0f, fr.LeftSlope, 0.0f); - AxisA[4] = XMVectorSet(0.0f, 1.0f, -fr.TopSlope, 0.0f); - AxisA[5] = XMVectorSet(0.0f, -1.0f, fr.BottomSlope, 0.0f); - - AxisA[0] = XMVector3Rotate(AxisA[0], OrientationA); - AxisA[1] = XMVectorNegate(AxisA[0]); - AxisA[2] = XMVector3Rotate(AxisA[2], OrientationA); - AxisA[3] = XMVector3Rotate(AxisA[3], OrientationA); - AxisA[4] = XMVector3Rotate(AxisA[4], OrientationA); - AxisA[5] = XMVector3Rotate(AxisA[5], OrientationA); - - PlaneDistA[0] = XMVector3Dot(AxisA[0], CornersA[0]); // Re-use corner on near plane. - PlaneDistA[1] = XMVector3Dot(AxisA[1], CornersA[4]); // Re-use corner on far plane. - PlaneDistA[2] = XMVector3Dot(AxisA[2], OriginA); - PlaneDistA[3] = XMVector3Dot(AxisA[3], OriginA); - PlaneDistA[4] = XMVector3Dot(AxisA[4], OriginA); - PlaneDistA[5] = XMVector3Dot(AxisA[5], OriginA); - - // Check each axis of frustum A for a seperating plane (5). - for (size_t i = 0; i < 6; ++i) - { - // Find the minimum projection of the frustum onto the plane normal. - XMVECTOR Min; - - Min = XMVector3Dot(AxisA[i], CornersB[0]); - - for (size_t j = 1; j < CORNER_COUNT; j++) - { - XMVECTOR Temp = XMVector3Dot(AxisA[i], CornersB[j]); - Min = XMVectorMin(Min, Temp); - } - - // Outside the plane? - Outside = XMVectorOrInt(Outside, XMVectorGreater(Min, PlaneDistA[i])); - } - - // If the frustum B is outside any of the planes of frustum A it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // Check edge/edge axes (6 * 6). - XMVECTOR FrustumEdgeAxisA[6]; - FrustumEdgeAxisA[0] = RightTopA; - FrustumEdgeAxisA[1] = RightBottomA; - FrustumEdgeAxisA[2] = LeftTopA; - FrustumEdgeAxisA[3] = LeftBottomA; - FrustumEdgeAxisA[4] = XMVectorSubtract(RightTopA, LeftTopA); - FrustumEdgeAxisA[5] = XMVectorSubtract(LeftBottomA, LeftTopA); - - XMVECTOR FrustumEdgeAxisB[6]; - FrustumEdgeAxisB[0] = RightTopB; - FrustumEdgeAxisB[1] = RightBottomB; - FrustumEdgeAxisB[2] = LeftTopB; - FrustumEdgeAxisB[3] = LeftBottomB; - FrustumEdgeAxisB[4] = XMVectorSubtract(RightTopB, LeftTopB); - FrustumEdgeAxisB[5] = XMVectorSubtract(LeftBottomB, LeftTopB); - - for (size_t i = 0; i < 6; ++i) - { - for (size_t j = 0; j < 6; j++) - { - // Compute the axis we are going to test. - XMVECTOR Axis = XMVector3Cross(FrustumEdgeAxisA[i], FrustumEdgeAxisB[j]); - - // Find the min/max values of the projection of both frustums onto the axis. - XMVECTOR MinA, MaxA; - XMVECTOR MinB, MaxB; - - MinA = MaxA = XMVector3Dot(Axis, CornersA[0]); - MinB = MaxB = XMVector3Dot(Axis, CornersB[0]); - - for (size_t k = 1; k < CORNER_COUNT; k++) - { - XMVECTOR TempA = XMVector3Dot(Axis, CornersA[k]); - MinA = XMVectorMin(MinA, TempA); - MaxA = XMVectorMax(MaxA, TempA); - - XMVECTOR TempB = XMVector3Dot(Axis, CornersB[k]); - MinB = XMVectorMin(MinB, TempB); - MaxB = XMVectorMax(MaxB, TempB); - } - - // if (MinA > MaxB || MinB > MaxA) reject - Outside = XMVectorOrInt(Outside, XMVectorGreater(MinA, MaxB)); - Outside = XMVectorOrInt(Outside, XMVectorGreater(MinB, MaxA)); - } - } - - // If there is a seperating plane, then the frustums do not intersect. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If we did not find a separating plane then the frustums intersect. - return true; -} - - -//----------------------------------------------------------------------------- -// Triangle vs frustum test. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept -{ - // Build the frustum planes (NOTE: D is negated from the usual). - XMVECTOR Planes[6]; - Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, -Near); - Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, Far); - Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Transform triangle into the local space of frustum. - XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vOrigin), vOrientation); - XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vOrigin), vOrientation); - XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vOrigin), vOrientation); - - // Test each vertex of the triangle against the frustum planes. - XMVECTOR Outside = XMVectorFalseInt(); - XMVECTOR InsideAll = XMVectorTrueInt(); - - for (size_t i = 0; i < 6; ++i) - { - XMVECTOR Dist0 = XMVector3Dot(TV0, Planes[i]); - XMVECTOR Dist1 = XMVector3Dot(TV1, Planes[i]); - XMVECTOR Dist2 = XMVector3Dot(TV2, Planes[i]); - - XMVECTOR MinDist = XMVectorMin(Dist0, Dist1); - MinDist = XMVectorMin(MinDist, Dist2); - XMVECTOR MaxDist = XMVectorMax(Dist0, Dist1); - MaxDist = XMVectorMax(MaxDist, Dist2); - - XMVECTOR PlaneDist = XMVectorSplatW(Planes[i]); - - // Outside the plane? - Outside = XMVectorOrInt(Outside, XMVectorGreater(MinDist, PlaneDist)); - - // Fully inside the plane? - InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(MaxDist, PlaneDist)); - } - - // If the triangle is outside any of the planes it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If the triangle is inside all planes it is fully inside. - if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) - return true; - - // Build the corners of the frustum. - XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&Near); - XMVECTOR vFar = XMVectorReplicatePtr(&Far); - - XMVECTOR Corners[CORNER_COUNT]; - Corners[0] = XMVectorMultiply(vRightTop, vNear); - Corners[1] = XMVectorMultiply(vRightBottom, vNear); - Corners[2] = XMVectorMultiply(vLeftTop, vNear); - Corners[3] = XMVectorMultiply(vLeftBottom, vNear); - Corners[4] = XMVectorMultiply(vRightTop, vFar); - Corners[5] = XMVectorMultiply(vRightBottom, vFar); - Corners[6] = XMVectorMultiply(vLeftTop, vFar); - Corners[7] = XMVectorMultiply(vLeftBottom, vFar); - - // Test the plane of the triangle. - XMVECTOR Normal = XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0)); - XMVECTOR Dist = XMVector3Dot(Normal, V0); - - XMVECTOR MinDist, MaxDist; - MinDist = MaxDist = XMVector3Dot(Corners[0], Normal); - for (size_t i = 1; i < CORNER_COUNT; ++i) - { - XMVECTOR Temp = XMVector3Dot(Corners[i], Normal); - MinDist = XMVectorMin(MinDist, Temp); - MaxDist = XMVectorMax(MaxDist, Temp); - } - - Outside = XMVectorOrInt(XMVectorGreater(MinDist, Dist), XMVectorLess(MaxDist, Dist)); - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // Check the edge/edge axes (3*6). - XMVECTOR TriangleEdgeAxis[3]; - TriangleEdgeAxis[0] = XMVectorSubtract(V1, V0); - TriangleEdgeAxis[1] = XMVectorSubtract(V2, V1); - TriangleEdgeAxis[2] = XMVectorSubtract(V0, V2); - - XMVECTOR FrustumEdgeAxis[6]; - FrustumEdgeAxis[0] = vRightTop; - FrustumEdgeAxis[1] = vRightBottom; - FrustumEdgeAxis[2] = vLeftTop; - FrustumEdgeAxis[3] = vLeftBottom; - FrustumEdgeAxis[4] = XMVectorSubtract(vRightTop, vLeftTop); - FrustumEdgeAxis[5] = XMVectorSubtract(vLeftBottom, vLeftTop); - - for (size_t i = 0; i < 3; ++i) - { - for (size_t j = 0; j < 6; j++) - { - // Compute the axis we are going to test. - XMVECTOR Axis = XMVector3Cross(TriangleEdgeAxis[i], FrustumEdgeAxis[j]); - - // Find the min/max of the projection of the triangle onto the axis. - XMVECTOR MinA, MaxA; - - XMVECTOR Dist0 = XMVector3Dot(V0, Axis); - XMVECTOR Dist1 = XMVector3Dot(V1, Axis); - XMVECTOR Dist2 = XMVector3Dot(V2, Axis); - - MinA = XMVectorMin(Dist0, Dist1); - MinA = XMVectorMin(MinA, Dist2); - MaxA = XMVectorMax(Dist0, Dist1); - MaxA = XMVectorMax(MaxA, Dist2); - - // Find the min/max of the projection of the frustum onto the axis. - XMVECTOR MinB, MaxB; - - MinB = MaxB = XMVector3Dot(Axis, Corners[0]); - - for (size_t k = 1; k < CORNER_COUNT; k++) - { - XMVECTOR Temp = XMVector3Dot(Axis, Corners[k]); - MinB = XMVectorMin(MinB, Temp); - MaxB = XMVectorMax(MaxB, Temp); - } - - // if (MinA > MaxB || MinB > MaxA) reject; - Outside = XMVectorOrInt(Outside, XMVectorGreater(MinA, MaxB)); - Outside = XMVectorOrInt(Outside, XMVectorGreater(MinB, MaxA)); - } - } - - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return false; - - // If we did not find a separating plane then the triangle must intersect the frustum. - return true; -} - - -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline PlaneIntersectionType XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR Plane) const noexcept -{ - assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); - - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Set w of the origin to one so we can dot4 with a plane. - vOrigin = XMVectorInsert<0, 0, 0, 0, 1>(vOrigin, XMVectorSplatOne()); - - // Build the corners of the frustum (in world space). - XMVECTOR RightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR RightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR LeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR LeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&Near); - XMVECTOR vFar = XMVectorReplicatePtr(&Far); - - RightTop = XMVector3Rotate(RightTop, vOrientation); - RightBottom = XMVector3Rotate(RightBottom, vOrientation); - LeftTop = XMVector3Rotate(LeftTop, vOrientation); - LeftBottom = XMVector3Rotate(LeftBottom, vOrientation); - - XMVECTOR Corners0 = XMVectorMultiplyAdd(RightTop, vNear, vOrigin); - XMVECTOR Corners1 = XMVectorMultiplyAdd(RightBottom, vNear, vOrigin); - XMVECTOR Corners2 = XMVectorMultiplyAdd(LeftTop, vNear, vOrigin); - XMVECTOR Corners3 = XMVectorMultiplyAdd(LeftBottom, vNear, vOrigin); - XMVECTOR Corners4 = XMVectorMultiplyAdd(RightTop, vFar, vOrigin); - XMVECTOR Corners5 = XMVectorMultiplyAdd(RightBottom, vFar, vOrigin); - XMVECTOR Corners6 = XMVectorMultiplyAdd(LeftTop, vFar, vOrigin); - XMVECTOR Corners7 = XMVectorMultiplyAdd(LeftBottom, vFar, vOrigin); - - XMVECTOR Outside, Inside; - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane, Outside, Inside); - - // If the frustum is outside any plane it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return FRONT; - - // If the frustum is inside all planes it is inside. - if (XMVector4EqualInt(Inside, XMVectorTrueInt())) - return BACK; - - // The frustum is not inside all planes or outside a plane it intersects. - return INTERSECTING; -} - - -//----------------------------------------------------------------------------- -// Ray vs. frustum test -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline bool XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR rayOrigin, FXMVECTOR Direction, float& Dist) const noexcept -{ - // If ray starts inside the frustum, return a distance of 0 for the hit - if (Contains(rayOrigin) == CONTAINS) - { - Dist = 0.0f; - return true; - } - - // Build the frustum planes. - XMVECTOR Planes[6]; - Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - - // Load origin and orientation of the frustum. - XMVECTOR frOrigin = XMLoadFloat3(&Origin); - XMVECTOR frOrientation = XMLoadFloat4(&Orientation); - - // This algorithm based on "Fast Ray-Convex Polyhedron Intersectin," in James Arvo, ed., Graphics Gems II pp. 247-250 - float tnear = -FLT_MAX; - float tfar = FLT_MAX; - - for (size_t i = 0; i < 6; ++i) - { - XMVECTOR Plane = DirectX::MathInternal::XMPlaneTransform(Planes[i], frOrientation, frOrigin); - Plane = XMPlaneNormalize(Plane); - - XMVECTOR AxisDotOrigin = XMPlaneDotCoord(Plane, rayOrigin); - XMVECTOR AxisDotDirection = XMVector3Dot(Plane, Direction); - - if (XMVector3LessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon)) - { - // Ray is parallel to plane - check if ray origin is inside plane's - if (XMVector3Greater(AxisDotOrigin, g_XMZero)) - { - // Ray origin is outside half-space. - Dist = 0.f; - return false; - } - } - else - { - // Ray not parallel - get distance to plane. - float vd = XMVectorGetX(AxisDotDirection); - float vn = XMVectorGetX(AxisDotOrigin); - float t = -vn / vd; - if (vd < 0.0f) - { - // Front face - T is a near point. - if (t > tfar) - { - Dist = 0.f; - return false; - } - if (t > tnear) - { - // Hit near face. - tnear = t; - } - } - else - { - // back face - T is far point. - if (t < tnear) - { - Dist = 0.f; - return false; - } - if (t < tfar) - { - // Hit far face. - tfar = t; - } - } - } - } - - // Survived all tests. - // Note: if ray originates on polyhedron, may want to change 0.0f to some - // epsilon to avoid intersecting the originating face. - float distance = (tnear >= 0.0f) ? tnear : tfar; - if (distance >= 0.0f) - { - Dist = distance; - return true; - } - - Dist = 0.f; - return false; -} - - -//----------------------------------------------------------------------------- -// Test a frustum vs 6 planes (typically forming another frustum). -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline ContainmentType XM_CALLCONV BoundingFrustum::ContainedBy( - FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, - GXMVECTOR Plane3, - HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); - - // Set w of the origin to one so we can dot4 with a plane. - vOrigin = XMVectorInsert<0, 0, 0, 0, 1>(vOrigin, XMVectorSplatOne()); - - // Build the corners of the frustum (in world space). - XMVECTOR RightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR RightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR LeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); - XMVECTOR LeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); - XMVECTOR vNear = XMVectorReplicatePtr(&Near); - XMVECTOR vFar = XMVectorReplicatePtr(&Far); - - RightTop = XMVector3Rotate(RightTop, vOrientation); - RightBottom = XMVector3Rotate(RightBottom, vOrientation); - LeftTop = XMVector3Rotate(LeftTop, vOrientation); - LeftBottom = XMVector3Rotate(LeftBottom, vOrientation); - - XMVECTOR Corners0 = XMVectorMultiplyAdd(RightTop, vNear, vOrigin); - XMVECTOR Corners1 = XMVectorMultiplyAdd(RightBottom, vNear, vOrigin); - XMVECTOR Corners2 = XMVectorMultiplyAdd(LeftTop, vNear, vOrigin); - XMVECTOR Corners3 = XMVectorMultiplyAdd(LeftBottom, vNear, vOrigin); - XMVECTOR Corners4 = XMVectorMultiplyAdd(RightTop, vFar, vOrigin); - XMVECTOR Corners5 = XMVectorMultiplyAdd(RightBottom, vFar, vOrigin); - XMVECTOR Corners6 = XMVectorMultiplyAdd(LeftTop, vFar, vOrigin); - XMVECTOR Corners7 = XMVectorMultiplyAdd(LeftBottom, vFar, vOrigin); - - XMVECTOR Outside, Inside; - - // Test against each plane. - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane0, Outside, Inside); - - XMVECTOR AnyOutside = Outside; - XMVECTOR AllInside = Inside; - - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane1, Outside, Inside); - - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane2, Outside, Inside); - - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane3, Outside, Inside); - - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane4, Outside, Inside); - - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, - Corners4, Corners5, Corners6, Corners7, - Plane5, Outside, Inside); - - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - // If the frustum is outside any plane it is outside. - if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) - return DISJOINT; - - // If the frustum is inside all planes it is inside. - if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) - return CONTAINS; - - // The frustum is not inside all planes or outside a plane, it may intersect. - return INTERSECTS; -} - - -//----------------------------------------------------------------------------- -// Build the 6 frustum planes from a frustum. -// -// The intended use for these routines is for fast culling to a view frustum. -// When the volume being tested against a view frustum is small relative to the -// view frustum it is usually either inside all six planes of the frustum -// (CONTAINS) or outside one of the planes of the frustum (DISJOINT). If neither -// of these cases is true then it may or may not be intersecting the frustum -// (INTERSECTS) -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void BoundingFrustum::GetPlanes(XMVECTOR* NearPlane, XMVECTOR* FarPlane, XMVECTOR* RightPlane, - XMVECTOR* LeftPlane, XMVECTOR* TopPlane, XMVECTOR* BottomPlane) const noexcept -{ - // Load origin and orientation of the frustum. - XMVECTOR vOrigin = XMLoadFloat3(&Origin); - XMVECTOR vOrientation = XMLoadFloat4(&Orientation); - - if (NearPlane) - { - XMVECTOR vNearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); - vNearPlane = DirectX::MathInternal::XMPlaneTransform(vNearPlane, vOrientation, vOrigin); - *NearPlane = XMPlaneNormalize(vNearPlane); - } - - if (FarPlane) - { - XMVECTOR vFarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); - vFarPlane = DirectX::MathInternal::XMPlaneTransform(vFarPlane, vOrientation, vOrigin); - *FarPlane = XMPlaneNormalize(vFarPlane); - } - - if (RightPlane) - { - XMVECTOR vRightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); - vRightPlane = DirectX::MathInternal::XMPlaneTransform(vRightPlane, vOrientation, vOrigin); - *RightPlane = XMPlaneNormalize(vRightPlane); - } - - if (LeftPlane) - { - XMVECTOR vLeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); - vLeftPlane = DirectX::MathInternal::XMPlaneTransform(vLeftPlane, vOrientation, vOrigin); - *LeftPlane = XMPlaneNormalize(vLeftPlane); - } - - if (TopPlane) - { - XMVECTOR vTopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); - vTopPlane = DirectX::MathInternal::XMPlaneTransform(vTopPlane, vOrientation, vOrigin); - *TopPlane = XMPlaneNormalize(vTopPlane); - } - - if (BottomPlane) - { - XMVECTOR vBottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); - vBottomPlane = DirectX::MathInternal::XMPlaneTransform(vBottomPlane, vOrientation, vOrigin); - *BottomPlane = XMPlaneNormalize(vBottomPlane); - } -} - - -//----------------------------------------------------------------------------- -// Build a frustum from a persepective projection matrix. The matrix may only -// contain a projection; any rotation, translation or scale will cause the -// constructed frustum to be incorrect. -//----------------------------------------------------------------------------- -_Use_decl_annotations_ -inline void XM_CALLCONV BoundingFrustum::CreateFromMatrix(BoundingFrustum& Out, FXMMATRIX Projection, bool rhcoords) noexcept -{ - // Corners of the projection frustum in NDC space. - static XMVECTORF32 NDCPoints[6] = - { - { { { 1.0f, 0.0f, 1.0f, 1.0f } } }, // right (at far plane) - { { { -1.0f, 0.0f, 1.0f, 1.0f } } }, // left - { { { 0.0f, 1.0f, 1.0f, 1.0f } } }, // top - { { { 0.0f, -1.0f, 1.0f, 1.0f } } }, // bottom - - { { { 0.0f, 0.0f, 0.0f, 1.0f } } }, // near - { { { 0.0f, 0.0f, 1.0f, 1.0f } } } // far - }; - - XMVECTOR Determinant; - XMMATRIX matInverse = XMMatrixInverse(&Determinant, Projection); - - // Compute the frustum corners in world space. - XMVECTOR Points[6]; - - for (size_t i = 0; i < 6; ++i) - { - // Transform point. - Points[i] = XMVector4Transform(NDCPoints[i], matInverse); - } - - Out.Origin = XMFLOAT3(0.0f, 0.0f, 0.0f); - Out.Orientation = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); - - // Compute the slopes. - Points[0] = XMVectorMultiply(Points[0], XMVectorReciprocal(XMVectorSplatZ(Points[0]))); - Points[1] = XMVectorMultiply(Points[1], XMVectorReciprocal(XMVectorSplatZ(Points[1]))); - Points[2] = XMVectorMultiply(Points[2], XMVectorReciprocal(XMVectorSplatZ(Points[2]))); - Points[3] = XMVectorMultiply(Points[3], XMVectorReciprocal(XMVectorSplatZ(Points[3]))); - - Out.RightSlope = XMVectorGetX(Points[0]); - Out.LeftSlope = XMVectorGetX(Points[1]); - Out.TopSlope = XMVectorGetY(Points[2]); - Out.BottomSlope = XMVectorGetY(Points[3]); - - // Compute near and far. - Points[4] = XMVectorMultiply(Points[4], XMVectorReciprocal(XMVectorSplatW(Points[4]))); - Points[5] = XMVectorMultiply(Points[5], XMVectorReciprocal(XMVectorSplatW(Points[5]))); - - if (rhcoords) - { - Out.Near = XMVectorGetZ(Points[5]); - Out.Far = XMVectorGetZ(Points[4]); - } - else - { - Out.Near = XMVectorGetZ(Points[4]); - Out.Far = XMVectorGetZ(Points[5]); - } -} - - -/**************************************************************************** - * - * TriangleTests - * - ****************************************************************************/ - -namespace TriangleTests -{ - - //----------------------------------------------------------------------------- - // Compute the intersection of a ray (Origin, Direction) with a triangle - // (V0, V1, V2). Return true if there is an intersection and also set *pDist - // to the distance along the ray to the intersection. - // - // The algorithm is based on Moller, Tomas and Trumbore, "Fast, Minimum Storage - // Ray-Triangle Intersection", Journal of Graphics Tools, vol. 2, no. 1, - // pp 21-28, 1997. - //----------------------------------------------------------------------------- - _Use_decl_annotations_ - inline bool XM_CALLCONV Intersects( - FXMVECTOR Origin, FXMVECTOR Direction, FXMVECTOR V0, - GXMVECTOR V1, - HXMVECTOR V2, float& Dist) noexcept - { - assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); - - XMVECTOR Zero = XMVectorZero(); - - XMVECTOR e1 = XMVectorSubtract(V1, V0); - XMVECTOR e2 = XMVectorSubtract(V2, V0); - - // p = Direction ^ e2; - XMVECTOR p = XMVector3Cross(Direction, e2); - - // det = e1 * p; - XMVECTOR det = XMVector3Dot(e1, p); - - XMVECTOR u, v, t; - - if (XMVector3GreaterOrEqual(det, g_RayEpsilon)) - { - // Determinate is positive (front side of the triangle). - XMVECTOR s = XMVectorSubtract(Origin, V0); - - // u = s * p; - u = XMVector3Dot(s, p); - - XMVECTOR NoIntersection = XMVectorLess(u, Zero); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(u, det)); - - // q = s ^ e1; - XMVECTOR q = XMVector3Cross(s, e1); - - // v = Direction * q; - v = XMVector3Dot(Direction, q); - - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(v, Zero)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(XMVectorAdd(u, v), det)); - - // t = e2 * q; - t = XMVector3Dot(e2, q); - - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(t, Zero)); - - if (XMVector4EqualInt(NoIntersection, XMVectorTrueInt())) - { - Dist = 0.f; - return false; - } - } - else if (XMVector3LessOrEqual(det, g_RayNegEpsilon)) - { - // Determinate is negative (back side of the triangle). - XMVECTOR s = XMVectorSubtract(Origin, V0); - - // u = s * p; - u = XMVector3Dot(s, p); - - XMVECTOR NoIntersection = XMVectorGreater(u, Zero); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(u, det)); - - // q = s ^ e1; - XMVECTOR q = XMVector3Cross(s, e1); - - // v = Direction * q; - v = XMVector3Dot(Direction, q); - - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(v, Zero)); - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorAdd(u, v), det)); - - // t = e2 * q; - t = XMVector3Dot(e2, q); - - NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(t, Zero)); - - if (XMVector4EqualInt(NoIntersection, XMVectorTrueInt())) - { - Dist = 0.f; - return false; - } - } - else - { - // Parallel ray. - Dist = 0.f; - return false; - } - - t = XMVectorDivide(t, det); - - // (u / det) and (v / dev) are the barycentric cooridinates of the intersection. - - // Store the x-component to *pDist - XMStoreFloat(&Dist, t); - - return true; - } - - - //----------------------------------------------------------------------------- - // Test if two triangles intersect. - // - // The final test of algorithm is based on Shen, Heng, and Tang, "A Fast - // Triangle-Triangle Overlap Test Using Signed Distances", Journal of Graphics - // Tools, vol. 8, no. 1, pp 17-23, 2003 and Guigue and Devillers, "Fast and - // Robust Triangle-Triangle Overlap Test Using Orientation Predicates", Journal - // of Graphics Tools, vol. 8, no. 1, pp 25-32, 2003. - // - // The final test could be considered an edge-edge separating plane test with - // the 9 possible cases narrowed down to the only two pairs of edges that can - // actaully result in a seperation. - //----------------------------------------------------------------------------- - _Use_decl_annotations_ - inline bool XM_CALLCONV Intersects(FXMVECTOR A0, FXMVECTOR A1, FXMVECTOR A2, GXMVECTOR B0, HXMVECTOR B1, HXMVECTOR B2) noexcept - { - static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; - static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; - static const XMVECTORU32 Select0111 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_1 } } }; - static const XMVECTORU32 Select1011 = { { { XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1 } } }; - static const XMVECTORU32 Select1101 = { { { XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1 } } }; - - XMVECTOR Zero = XMVectorZero(); - - // Compute the normal of triangle A. - XMVECTOR N1 = XMVector3Cross(XMVectorSubtract(A1, A0), XMVectorSubtract(A2, A0)); - - // Assert that the triangle is not degenerate. - assert(!XMVector3Equal(N1, Zero)); - - // Test points of B against the plane of A. - XMVECTOR BDist = XMVector3Dot(N1, XMVectorSubtract(B0, A0)); - BDist = XMVectorSelect(BDist, XMVector3Dot(N1, XMVectorSubtract(B1, A0)), SelectY); - BDist = XMVectorSelect(BDist, XMVector3Dot(N1, XMVectorSubtract(B2, A0)), SelectZ); - - // Ensure robustness with co-planar triangles by zeroing small distances. - uint32_t BDistIsZeroCR; - XMVECTOR BDistIsZero = XMVectorGreaterR(&BDistIsZeroCR, g_RayEpsilon, XMVectorAbs(BDist)); - BDist = XMVectorSelect(BDist, Zero, BDistIsZero); - - uint32_t BDistIsLessCR; - XMVECTOR BDistIsLess = XMVectorGreaterR(&BDistIsLessCR, Zero, BDist); - - uint32_t BDistIsGreaterCR; - XMVECTOR BDistIsGreater = XMVectorGreaterR(&BDistIsGreaterCR, BDist, Zero); - - // If all the points are on the same side we don't intersect. - if (XMComparisonAllTrue(BDistIsLessCR) || XMComparisonAllTrue(BDistIsGreaterCR)) - return false; - - // Compute the normal of triangle B. - XMVECTOR N2 = XMVector3Cross(XMVectorSubtract(B1, B0), XMVectorSubtract(B2, B0)); - - // Assert that the triangle is not degenerate. - assert(!XMVector3Equal(N2, Zero)); - - // Test points of A against the plane of B. - XMVECTOR ADist = XMVector3Dot(N2, XMVectorSubtract(A0, B0)); - ADist = XMVectorSelect(ADist, XMVector3Dot(N2, XMVectorSubtract(A1, B0)), SelectY); - ADist = XMVectorSelect(ADist, XMVector3Dot(N2, XMVectorSubtract(A2, B0)), SelectZ); - - // Ensure robustness with co-planar triangles by zeroing small distances. - uint32_t ADistIsZeroCR; - XMVECTOR ADistIsZero = XMVectorGreaterR(&ADistIsZeroCR, g_RayEpsilon, XMVectorAbs(ADist)); - ADist = XMVectorSelect(ADist, Zero, ADistIsZero); - - uint32_t ADistIsLessCR; - XMVECTOR ADistIsLess = XMVectorGreaterR(&ADistIsLessCR, Zero, ADist); - - uint32_t ADistIsGreaterCR; - XMVECTOR ADistIsGreater = XMVectorGreaterR(&ADistIsGreaterCR, ADist, Zero); - - // If all the points are on the same side we don't intersect. - if (XMComparisonAllTrue(ADistIsLessCR) || XMComparisonAllTrue(ADistIsGreaterCR)) - return false; - - // Special case for co-planar triangles. - if (XMComparisonAllTrue(ADistIsZeroCR) || XMComparisonAllTrue(BDistIsZeroCR)) - { - XMVECTOR Axis, Dist, MinDist; - - // Compute an axis perpindicular to the edge (points out). - Axis = XMVector3Cross(N1, XMVectorSubtract(A1, A0)); - Dist = XMVector3Dot(Axis, A0); - - // Test points of B against the axis. - MinDist = XMVector3Dot(B0, Axis); - MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); - MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); - if (XMVector4GreaterOrEqual(MinDist, Dist)) - return false; - - // Edge (A1, A2) - Axis = XMVector3Cross(N1, XMVectorSubtract(A2, A1)); - Dist = XMVector3Dot(Axis, A1); - - MinDist = XMVector3Dot(B0, Axis); - MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); - MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); - if (XMVector4GreaterOrEqual(MinDist, Dist)) - return false; - - // Edge (A2, A0) - Axis = XMVector3Cross(N1, XMVectorSubtract(A0, A2)); - Dist = XMVector3Dot(Axis, A2); - - MinDist = XMVector3Dot(B0, Axis); - MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); - MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); - if (XMVector4GreaterOrEqual(MinDist, Dist)) - return false; - - // Edge (B0, B1) - Axis = XMVector3Cross(N2, XMVectorSubtract(B1, B0)); - Dist = XMVector3Dot(Axis, B0); - - MinDist = XMVector3Dot(A0, Axis); - MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); - MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); - if (XMVector4GreaterOrEqual(MinDist, Dist)) - return false; - - // Edge (B1, B2) - Axis = XMVector3Cross(N2, XMVectorSubtract(B2, B1)); - Dist = XMVector3Dot(Axis, B1); - - MinDist = XMVector3Dot(A0, Axis); - MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); - MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); - if (XMVector4GreaterOrEqual(MinDist, Dist)) - return false; - - // Edge (B2,B0) - Axis = XMVector3Cross(N2, XMVectorSubtract(B0, B2)); - Dist = XMVector3Dot(Axis, B2); - - MinDist = XMVector3Dot(A0, Axis); - MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); - MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); - if (XMVector4GreaterOrEqual(MinDist, Dist)) - return false; - - return true; - } - - // - // Find the single vertex of A and B (ie the vertex on the opposite side - // of the plane from the other two) and reorder the edges so we can compute - // the signed edge/edge distances. - // - // if ( (V0 >= 0 && V1 < 0 && V2 < 0) || - // (V0 > 0 && V1 <= 0 && V2 <= 0) || - // (V0 <= 0 && V1 > 0 && V2 > 0) || - // (V0 < 0 && V1 >= 0 && V2 >= 0) ) then V0 is singular; - // - // If our singular vertex is not on the positive side of the plane we reverse - // the triangle winding so that the overlap comparisons will compare the - // correct edges with the correct signs. - // - XMVECTOR ADistIsLessEqual = XMVectorOrInt(ADistIsLess, ADistIsZero); - XMVECTOR ADistIsGreaterEqual = XMVectorOrInt(ADistIsGreater, ADistIsZero); - - XMVECTOR AA0, AA1, AA2; - bool bPositiveA; - - if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select0111)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select0111))) - { - // A0 is singular, crossing from positive to negative. - AA0 = A0; AA1 = A1; AA2 = A2; - bPositiveA = true; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select0111)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select0111))) - { - // A0 is singular, crossing from negative to positive. - AA0 = A0; AA1 = A2; AA2 = A1; - bPositiveA = false; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select1011)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select1011))) - { - // A1 is singular, crossing from positive to negative. - AA0 = A1; AA1 = A2; AA2 = A0; - bPositiveA = true; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select1011)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select1011))) - { - // A1 is singular, crossing from negative to positive. - AA0 = A1; AA1 = A0; AA2 = A2; - bPositiveA = false; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select1101)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select1101))) - { - // A2 is singular, crossing from positive to negative. - AA0 = A2; AA1 = A0; AA2 = A1; - bPositiveA = true; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select1101)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select1101))) - { - // A2 is singular, crossing from negative to positive. - AA0 = A2; AA1 = A1; AA2 = A0; - bPositiveA = false; - } - else - { - assert(false); - return false; - } - - XMVECTOR BDistIsLessEqual = XMVectorOrInt(BDistIsLess, BDistIsZero); - XMVECTOR BDistIsGreaterEqual = XMVectorOrInt(BDistIsGreater, BDistIsZero); - - XMVECTOR BB0, BB1, BB2; - bool bPositiveB; - - if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select0111)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select0111))) - { - // B0 is singular, crossing from positive to negative. - BB0 = B0; BB1 = B1; BB2 = B2; - bPositiveB = true; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select0111)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select0111))) - { - // B0 is singular, crossing from negative to positive. - BB0 = B0; BB1 = B2; BB2 = B1; - bPositiveB = false; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select1011)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select1011))) - { - // B1 is singular, crossing from positive to negative. - BB0 = B1; BB1 = B2; BB2 = B0; - bPositiveB = true; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select1011)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select1011))) - { - // B1 is singular, crossing from negative to positive. - BB0 = B1; BB1 = B0; BB2 = B2; - bPositiveB = false; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select1101)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select1101))) - { - // B2 is singular, crossing from positive to negative. - BB0 = B2; BB1 = B0; BB2 = B1; - bPositiveB = true; - } - else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select1101)) || - DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select1101))) - { - // B2 is singular, crossing from negative to positive. - BB0 = B2; BB1 = B1; BB2 = B0; - bPositiveB = false; - } - else - { - assert(false); - return false; - } - - XMVECTOR Delta0, Delta1; - - // Reverse the direction of the test depending on whether the singular vertices are - // the same sign or different signs. - if (bPositiveA ^ bPositiveB) - { - Delta0 = XMVectorSubtract(BB0, AA0); - Delta1 = XMVectorSubtract(AA0, BB0); - } - else - { - Delta0 = XMVectorSubtract(AA0, BB0); - Delta1 = XMVectorSubtract(BB0, AA0); - } - - // Check if the triangles overlap on the line of intersection between the - // planes of the two triangles by finding the signed line distances. - XMVECTOR Dist0 = XMVector3Dot(Delta0, XMVector3Cross(XMVectorSubtract(BB2, BB0), XMVectorSubtract(AA2, AA0))); - if (XMVector4Greater(Dist0, Zero)) - return false; - - XMVECTOR Dist1 = XMVector3Dot(Delta1, XMVector3Cross(XMVectorSubtract(BB1, BB0), XMVectorSubtract(AA1, AA0))); - if (XMVector4Greater(Dist1, Zero)) - return false; - - return true; - } - - - //----------------------------------------------------------------------------- - // Ray-triangle test - //----------------------------------------------------------------------------- - _Use_decl_annotations_ - inline PlaneIntersectionType XM_CALLCONV Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, GXMVECTOR Plane) noexcept - { - XMVECTOR One = XMVectorSplatOne(); - - assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); - - // Set w of the points to one so we can dot4 with a plane. - XMVECTOR TV0 = XMVectorInsert<0, 0, 0, 0, 1>(V0, One); - XMVECTOR TV1 = XMVectorInsert<0, 0, 0, 0, 1>(V1, One); - XMVECTOR TV2 = XMVectorInsert<0, 0, 0, 0, 1>(V2, One); - - XMVECTOR Outside, Inside; - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane, Outside, Inside); - - // If the triangle is outside any plane it is outside. - if (XMVector4EqualInt(Outside, XMVectorTrueInt())) - return FRONT; - - // If the triangle is inside all planes it is inside. - if (XMVector4EqualInt(Inside, XMVectorTrueInt())) - return BACK; - - // The triangle is not inside all planes or outside a plane it intersects. - return INTERSECTING; - } - - - //----------------------------------------------------------------------------- - // Test a triangle vs 6 planes (typically forming a frustum). - //----------------------------------------------------------------------------- - _Use_decl_annotations_ - inline ContainmentType XM_CALLCONV ContainedBy( - FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, - GXMVECTOR Plane0, - HXMVECTOR Plane1, HXMVECTOR Plane2, - CXMVECTOR Plane3, CXMVECTOR Plane4, CXMVECTOR Plane5) noexcept - { - XMVECTOR One = XMVectorSplatOne(); - - // Set w of the points to one so we can dot4 with a plane. - XMVECTOR TV0 = XMVectorInsert<0, 0, 0, 0, 1>(V0, One); - XMVECTOR TV1 = XMVectorInsert<0, 0, 0, 0, 1>(V1, One); - XMVECTOR TV2 = XMVectorInsert<0, 0, 0, 0, 1>(V2, One); - - XMVECTOR Outside, Inside; - - // Test against each plane. - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane0, Outside, Inside); - - XMVECTOR AnyOutside = Outside; - XMVECTOR AllInside = Inside; - - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane1, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane2, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane3, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane4, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane5, Outside, Inside); - AnyOutside = XMVectorOrInt(AnyOutside, Outside); - AllInside = XMVectorAndInt(AllInside, Inside); - - // If the triangle is outside any plane it is outside. - if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) - return DISJOINT; - - // If the triangle is inside all planes it is inside. - if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) - return CONTAINS; - - // The triangle is not inside all planes or outside a plane, it may intersect. - return INTERSECTS; - } - -} // namespace TriangleTests - +//------------------------------------------------------------------------------------- +// DirectXCollision.inl -- C++ Collision Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +XMGLOBALCONST XMVECTORF32 g_BoxOffset[8] = +{ + { { { -1.0f, -1.0f, 1.0f, 0.0f } } }, + { { { 1.0f, -1.0f, 1.0f, 0.0f } } }, + { { { 1.0f, 1.0f, 1.0f, 0.0f } } }, + { { { -1.0f, 1.0f, 1.0f, 0.0f } } }, + { { { -1.0f, -1.0f, -1.0f, 0.0f } } }, + { { { 1.0f, -1.0f, -1.0f, 0.0f } } }, + { { { 1.0f, 1.0f, -1.0f, 0.0f } } }, + { { { -1.0f, 1.0f, -1.0f, 0.0f } } }, +}; + +XMGLOBALCONST XMVECTORF32 g_RayEpsilon = { { { 1e-20f, 1e-20f, 1e-20f, 1e-20f } } }; +XMGLOBALCONST XMVECTORF32 g_RayNegEpsilon = { { { -1e-20f, -1e-20f, -1e-20f, -1e-20f } } }; +XMGLOBALCONST XMVECTORF32 g_FltMin = { { { -FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX } } }; +XMGLOBALCONST XMVECTORF32 g_FltMax = { { { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX } } }; + +namespace MathInternal +{ + + //----------------------------------------------------------------------------- + // Return true if any of the elements of a 3 vector are equal to 0xffffffff. + // Slightly more efficient than using XMVector3EqualInt. + //----------------------------------------------------------------------------- + inline bool XMVector3AnyTrue(_In_ FXMVECTOR V) noexcept + { + // Duplicate the fourth element from the first element. + XMVECTOR C = XMVectorSwizzle(V); + + return XMComparisonAnyTrue(XMVector4EqualIntR(C, XMVectorTrueInt())); + } + + + //----------------------------------------------------------------------------- + // Return true if all of the elements of a 3 vector are equal to 0xffffffff. + // Slightly more efficient than using XMVector3EqualInt. + //----------------------------------------------------------------------------- + inline bool XMVector3AllTrue(_In_ FXMVECTOR V) noexcept + { + // Duplicate the fourth element from the first element. + XMVECTOR C = XMVectorSwizzle(V); + + return XMComparisonAllTrue(XMVector4EqualIntR(C, XMVectorTrueInt())); + } + +#if defined(_PREFAST_) || !defined(NDEBUG) + + XMGLOBALCONST XMVECTORF32 g_UnitVectorEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; + XMGLOBALCONST XMVECTORF32 g_UnitQuaternionEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; + XMGLOBALCONST XMVECTORF32 g_UnitPlaneEpsilon = { { { 1.0e-4f, 1.0e-4f, 1.0e-4f, 1.0e-4f } } }; + + //----------------------------------------------------------------------------- + // Return true if the vector is a unit vector (length == 1). + //----------------------------------------------------------------------------- + inline bool XMVector3IsUnit(_In_ FXMVECTOR V) noexcept + { + XMVECTOR Difference = XMVectorSubtract(XMVector3Length(V), XMVectorSplatOne()); + return XMVector4Less(XMVectorAbs(Difference), g_UnitVectorEpsilon); + } + + //----------------------------------------------------------------------------- + // Return true if the quaterion is a unit quaternion. + //----------------------------------------------------------------------------- + inline bool XMQuaternionIsUnit(_In_ FXMVECTOR Q) noexcept + { + XMVECTOR Difference = XMVectorSubtract(XMVector4Length(Q), XMVectorSplatOne()); + return XMVector4Less(XMVectorAbs(Difference), g_UnitQuaternionEpsilon); + } + + //----------------------------------------------------------------------------- + // Return true if the plane is a unit plane. + //----------------------------------------------------------------------------- + inline bool XMPlaneIsUnit(_In_ FXMVECTOR Plane) noexcept + { + XMVECTOR Difference = XMVectorSubtract(XMVector3Length(Plane), XMVectorSplatOne()); + return XMVector4Less(XMVectorAbs(Difference), g_UnitPlaneEpsilon); + } + +#endif // _PREFAST_ || !NDEBUG + + //----------------------------------------------------------------------------- + inline XMVECTOR XMPlaneTransform(_In_ FXMVECTOR Plane, _In_ FXMVECTOR Rotation, _In_ FXMVECTOR Translation) noexcept + { + XMVECTOR vNormal = XMVector3Rotate(Plane, Rotation); + XMVECTOR vD = XMVectorSubtract(XMVectorSplatW(Plane), XMVector3Dot(vNormal, Translation)); + + return XMVectorInsert<0, 0, 0, 0, 1>(vNormal, vD); + } + + //----------------------------------------------------------------------------- + // Return the point on the line segement (S1, S2) nearest the point P. + //----------------------------------------------------------------------------- + inline XMVECTOR PointOnLineSegmentNearestPoint(_In_ FXMVECTOR S1, _In_ FXMVECTOR S2, _In_ FXMVECTOR P) noexcept + { + XMVECTOR Dir = XMVectorSubtract(S2, S1); + XMVECTOR Projection = XMVectorSubtract(XMVector3Dot(P, Dir), XMVector3Dot(S1, Dir)); + XMVECTOR LengthSq = XMVector3Dot(Dir, Dir); + + XMVECTOR t = XMVectorMultiply(Projection, XMVectorReciprocal(LengthSq)); + XMVECTOR Point = XMVectorMultiplyAdd(t, Dir, S1); + + // t < 0 + XMVECTOR SelectS1 = XMVectorLess(Projection, XMVectorZero()); + Point = XMVectorSelect(Point, S1, SelectS1); + + // t > 1 + XMVECTOR SelectS2 = XMVectorGreater(Projection, LengthSq); + Point = XMVectorSelect(Point, S2, SelectS2); + + return Point; + } + + //----------------------------------------------------------------------------- + // Test if the point (P) on the plane of the triangle is inside the triangle + // (V0, V1, V2). + //----------------------------------------------------------------------------- + inline XMVECTOR XM_CALLCONV PointOnPlaneInsideTriangle(_In_ FXMVECTOR P, _In_ FXMVECTOR V0, _In_ FXMVECTOR V1, _In_ GXMVECTOR V2) noexcept + { + // Compute the triangle normal. + XMVECTOR N = XMVector3Cross(XMVectorSubtract(V2, V0), XMVectorSubtract(V1, V0)); + + // Compute the cross products of the vector from the base of each edge to + // the point with each edge vector. + XMVECTOR C0 = XMVector3Cross(XMVectorSubtract(P, V0), XMVectorSubtract(V1, V0)); + XMVECTOR C1 = XMVector3Cross(XMVectorSubtract(P, V1), XMVectorSubtract(V2, V1)); + XMVECTOR C2 = XMVector3Cross(XMVectorSubtract(P, V2), XMVectorSubtract(V0, V2)); + + // If the cross product points in the same direction as the normal the the + // point is inside the edge (it is zero if is on the edge). + XMVECTOR Zero = XMVectorZero(); + XMVECTOR Inside0 = XMVectorGreaterOrEqual(XMVector3Dot(C0, N), Zero); + XMVECTOR Inside1 = XMVectorGreaterOrEqual(XMVector3Dot(C1, N), Zero); + XMVECTOR Inside2 = XMVectorGreaterOrEqual(XMVector3Dot(C2, N), Zero); + + // If the point inside all of the edges it is inside. + return XMVectorAndInt(XMVectorAndInt(Inside0, Inside1), Inside2); + } + + //----------------------------------------------------------------------------- + inline bool SolveCubic(_In_ float e, _In_ float f, _In_ float g, _Out_ float* t, _Out_ float* u, _Out_ float* v) noexcept + { + float p, q, h, rc, d, theta, costh3, sinth3; + + p = f - e * e / 3.0f; + q = g - e * f / 3.0f + e * e * e * 2.0f / 27.0f; + h = q * q / 4.0f + p * p * p / 27.0f; + + if (h > 0) + { + *t = *u = *v = 0.f; + return false; // only one real root + } + + if ((h == 0) && (q == 0)) // all the same root + { + *t = -e / 3; + *u = -e / 3; + *v = -e / 3; + + return true; + } + + d = sqrtf(q * q / 4.0f - h); + if (d < 0) + rc = -powf(-d, 1.0f / 3.0f); + else + rc = powf(d, 1.0f / 3.0f); + + theta = XMScalarACos(-q / (2.0f * d)); + costh3 = XMScalarCos(theta / 3.0f); + sinth3 = sqrtf(3.0f) * XMScalarSin(theta / 3.0f); + *t = 2.0f * rc * costh3 - e / 3.0f; + *u = -rc * (costh3 + sinth3) - e / 3.0f; + *v = -rc * (costh3 - sinth3) - e / 3.0f; + + return true; + } + + //----------------------------------------------------------------------------- + inline XMVECTOR CalculateEigenVector(_In_ float m11, _In_ float m12, _In_ float m13, + _In_ float m22, _In_ float m23, _In_ float m33, _In_ float e) noexcept + { + float fTmp[3]; + fTmp[0] = m12 * m23 - m13 * (m22 - e); + fTmp[1] = m13 * m12 - m23 * (m11 - e); + fTmp[2] = (m11 - e) * (m22 - e) - m12 * m12; + + XMVECTOR vTmp = XMLoadFloat3(reinterpret_cast(fTmp)); + + if (XMVector3Equal(vTmp, XMVectorZero())) // planar or linear + { + float f1, f2, f3; + + // we only have one equation - find a valid one + if ((m11 - e != 0) || (m12 != 0) || (m13 != 0)) + { + f1 = m11 - e; f2 = m12; f3 = m13; + } + else if ((m12 != 0) || (m22 - e != 0) || (m23 != 0)) + { + f1 = m12; f2 = m22 - e; f3 = m23; + } + else if ((m13 != 0) || (m23 != 0) || (m33 - e != 0)) + { + f1 = m13; f2 = m23; f3 = m33 - e; + } + else + { + // error, we'll just make something up - we have NO context + f1 = 1.0f; f2 = 0.0f; f3 = 0.0f; + } + + if (f1 == 0) + vTmp = XMVectorSetX(vTmp, 0.0f); + else + vTmp = XMVectorSetX(vTmp, 1.0f); + + if (f2 == 0) + vTmp = XMVectorSetY(vTmp, 0.0f); + else + vTmp = XMVectorSetY(vTmp, 1.0f); + + if (f3 == 0) + { + vTmp = XMVectorSetZ(vTmp, 0.0f); + // recalculate y to make equation work + if (m12 != 0) + vTmp = XMVectorSetY(vTmp, -f1 / f2); + } + else + { + vTmp = XMVectorSetZ(vTmp, (f2 - f1) / f3); + } + } + + if (XMVectorGetX(XMVector3LengthSq(vTmp)) > 1e-5f) + { + return XMVector3Normalize(vTmp); + } + else + { + // Multiply by a value large enough to make the vector non-zero. + vTmp = XMVectorScale(vTmp, 1e5f); + return XMVector3Normalize(vTmp); + } + } + + //----------------------------------------------------------------------------- + inline bool CalculateEigenVectors(_In_ float m11, _In_ float m12, _In_ float m13, + _In_ float m22, _In_ float m23, _In_ float m33, + _In_ float e1, _In_ float e2, _In_ float e3, + _Out_ XMVECTOR* pV1, _Out_ XMVECTOR* pV2, _Out_ XMVECTOR* pV3) noexcept + { + *pV1 = DirectX::MathInternal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e1); + *pV2 = DirectX::MathInternal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e2); + *pV3 = DirectX::MathInternal::CalculateEigenVector(m11, m12, m13, m22, m23, m33, e3); + + bool v1z = false; + bool v2z = false; + bool v3z = false; + + XMVECTOR Zero = XMVectorZero(); + + if (XMVector3Equal(*pV1, Zero)) + v1z = true; + + if (XMVector3Equal(*pV2, Zero)) + v2z = true; + + if (XMVector3Equal(*pV3, Zero)) + v3z = true; + + bool e12 = (fabsf(XMVectorGetX(XMVector3Dot(*pV1, *pV2))) > 0.1f); // check for non-orthogonal vectors + bool e13 = (fabsf(XMVectorGetX(XMVector3Dot(*pV1, *pV3))) > 0.1f); + bool e23 = (fabsf(XMVectorGetX(XMVector3Dot(*pV2, *pV3))) > 0.1f); + + if ((v1z && v2z && v3z) || (e12 && e13 && e23) || + (e12 && v3z) || (e13 && v2z) || (e23 && v1z)) // all eigenvectors are 0- any basis set + { + *pV1 = g_XMIdentityR0.v; + *pV2 = g_XMIdentityR1.v; + *pV3 = g_XMIdentityR2.v; + return true; + } + + if (v1z && v2z) + { + XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV3); + if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) + { + vTmp = XMVector3Cross(g_XMIdentityR0, *pV3); + } + *pV1 = XMVector3Normalize(vTmp); + *pV2 = XMVector3Cross(*pV3, *pV1); + return true; + } + + if (v3z && v1z) + { + XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV2); + if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) + { + vTmp = XMVector3Cross(g_XMIdentityR0, *pV2); + } + *pV3 = XMVector3Normalize(vTmp); + *pV1 = XMVector3Cross(*pV2, *pV3); + return true; + } + + if (v2z && v3z) + { + XMVECTOR vTmp = XMVector3Cross(g_XMIdentityR1, *pV1); + if (XMVectorGetX(XMVector3LengthSq(vTmp)) < 1e-5f) + { + vTmp = XMVector3Cross(g_XMIdentityR0, *pV1); + } + *pV2 = XMVector3Normalize(vTmp); + *pV3 = XMVector3Cross(*pV1, *pV2); + return true; + } + + if ((v1z) || e12) + { + *pV1 = XMVector3Cross(*pV2, *pV3); + return true; + } + + if ((v2z) || e23) + { + *pV2 = XMVector3Cross(*pV3, *pV1); + return true; + } + + if ((v3z) || e13) + { + *pV3 = XMVector3Cross(*pV1, *pV2); + return true; + } + + return true; + } + + //----------------------------------------------------------------------------- + inline bool CalculateEigenVectorsFromCovarianceMatrix(_In_ float Cxx, _In_ float Cyy, _In_ float Czz, + _In_ float Cxy, _In_ float Cxz, _In_ float Cyz, + _Out_ XMVECTOR* pV1, _Out_ XMVECTOR* pV2, _Out_ XMVECTOR* pV3) noexcept + { + // Calculate the eigenvalues by solving a cubic equation. + float e = -(Cxx + Cyy + Czz); + float f = Cxx * Cyy + Cyy * Czz + Czz * Cxx - Cxy * Cxy - Cxz * Cxz - Cyz * Cyz; + float g = Cxy * Cxy * Czz + Cxz * Cxz * Cyy + Cyz * Cyz * Cxx - Cxy * Cyz * Cxz * 2.0f - Cxx * Cyy * Czz; + + float ev1, ev2, ev3; + if (!DirectX::MathInternal::SolveCubic(e, f, g, &ev1, &ev2, &ev3)) + { + // set them to arbitrary orthonormal basis set + *pV1 = g_XMIdentityR0.v; + *pV2 = g_XMIdentityR1.v; + *pV3 = g_XMIdentityR2.v; + return false; + } + + return DirectX::MathInternal::CalculateEigenVectors(Cxx, Cxy, Cxz, Cyy, Cyz, Czz, ev1, ev2, ev3, pV1, pV2, pV3); + } + + //----------------------------------------------------------------------------- + inline void XM_CALLCONV FastIntersectTrianglePlane( + FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, + GXMVECTOR Plane, + XMVECTOR& Outside, XMVECTOR& Inside) noexcept + { + // Plane0 + XMVECTOR Dist0 = XMVector4Dot(V0, Plane); + XMVECTOR Dist1 = XMVector4Dot(V1, Plane); + XMVECTOR Dist2 = XMVector4Dot(V2, Plane); + + XMVECTOR MinDist = XMVectorMin(Dist0, Dist1); + MinDist = XMVectorMin(MinDist, Dist2); + + XMVECTOR MaxDist = XMVectorMax(Dist0, Dist1); + MaxDist = XMVectorMax(MaxDist, Dist2); + + XMVECTOR Zero = XMVectorZero(); + + // Outside the plane? + Outside = XMVectorGreater(MinDist, Zero); + + // Fully inside the plane? + Inside = XMVectorLess(MaxDist, Zero); + } + + //----------------------------------------------------------------------------- + inline void FastIntersectSpherePlane(_In_ FXMVECTOR Center, _In_ FXMVECTOR Radius, _In_ FXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + XMVECTOR Dist = XMVector4Dot(Center, Plane); + + // Outside the plane? + Outside = XMVectorGreater(Dist, Radius); + + // Fully inside the plane? + Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); + } + + //----------------------------------------------------------------------------- + inline void FastIntersectAxisAlignedBoxPlane(_In_ FXMVECTOR Center, _In_ FXMVECTOR Extents, _In_ FXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + // Compute the distance to the center of the box. + XMVECTOR Dist = XMVector4Dot(Center, Plane); + + // Project the axes of the box onto the normal of the plane. Half the + // length of the projection (sometime called the "radius") is equal to + // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) + // where h(i) are extents of the box, n is the plane normal, and b(i) are the + // axes of the box. In this case b(i) = [(1,0,0), (0,1,0), (0,0,1)]. + XMVECTOR Radius = XMVector3Dot(Extents, XMVectorAbs(Plane)); + + // Outside the plane? + Outside = XMVectorGreater(Dist, Radius); + + // Fully inside the plane? + Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); + } + + //----------------------------------------------------------------------------- + inline void XM_CALLCONV FastIntersectOrientedBoxPlane( + _In_ FXMVECTOR Center, _In_ FXMVECTOR Extents, _In_ FXMVECTOR Axis0, + _In_ GXMVECTOR Axis1, + _In_ HXMVECTOR Axis2, _In_ HXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + // Compute the distance to the center of the box. + XMVECTOR Dist = XMVector4Dot(Center, Plane); + + // Project the axes of the box onto the normal of the plane. Half the + // length of the projection (sometime called the "radius") is equal to + // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) + // where h(i) are extents of the box, n is the plane normal, and b(i) are the + // axes of the box. + XMVECTOR Radius = XMVector3Dot(Plane, Axis0); + Radius = XMVectorInsert<0, 0, 1, 0, 0>(Radius, XMVector3Dot(Plane, Axis1)); + Radius = XMVectorInsert<0, 0, 0, 1, 0>(Radius, XMVector3Dot(Plane, Axis2)); + Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); + + // Outside the plane? + Outside = XMVectorGreater(Dist, Radius); + + // Fully inside the plane? + Inside = XMVectorLess(Dist, XMVectorNegate(Radius)); + } + + //----------------------------------------------------------------------------- + inline void XM_CALLCONV FastIntersectFrustumPlane( + _In_ FXMVECTOR Point0, _In_ FXMVECTOR Point1, _In_ FXMVECTOR Point2, + _In_ GXMVECTOR Point3, + _In_ HXMVECTOR Point4, _In_ HXMVECTOR Point5, + _In_ CXMVECTOR Point6, _In_ CXMVECTOR Point7, _In_ CXMVECTOR Plane, + _Out_ XMVECTOR& Outside, _Out_ XMVECTOR& Inside) noexcept + { + // Find the min/max projection of the frustum onto the plane normal. + XMVECTOR Min, Max, Dist; + + Min = Max = XMVector3Dot(Plane, Point0); + + Dist = XMVector3Dot(Plane, Point1); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point2); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point3); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point4); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point5); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point6); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + Dist = XMVector3Dot(Plane, Point7); + Min = XMVectorMin(Min, Dist); + Max = XMVectorMax(Max, Dist); + + XMVECTOR PlaneDist = XMVectorNegate(XMVectorSplatW(Plane)); + + // Outside the plane? + Outside = XMVectorGreater(Min, PlaneDist); + + // Fully inside the plane? + Inside = XMVectorLess(Max, PlaneDist); + } + +} // namespace MathInternal + + +/**************************************************************************** + * + * BoundingSphere + * + ****************************************************************************/ + +//----------------------------------------------------------------------------- +// Transform a sphere by an angle preserving transform. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingSphere::Transform(BoundingSphere& Out, FXMMATRIX M) const noexcept +{ + // Load the center of the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + + // Transform the center of the sphere. + XMVECTOR C = XMVector3Transform(vCenter, M); + + XMVECTOR dX = XMVector3Dot(M.r[0], M.r[0]); + XMVECTOR dY = XMVector3Dot(M.r[1], M.r[1]); + XMVECTOR dZ = XMVector3Dot(M.r[2], M.r[2]); + + XMVECTOR d = XMVectorMax(dX, XMVectorMax(dY, dZ)); + + // Store the center sphere. + XMStoreFloat3(&Out.Center, C); + + // Scale the radius of the pshere. + float Scale = sqrtf(XMVectorGetX(d)); + Out.Radius = Radius * Scale; +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingSphere::Transform(BoundingSphere& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + // Load the center of the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + + // Transform the center of the sphere. + vCenter = XMVectorAdd(XMVector3Rotate(XMVectorScale(vCenter, Scale), Rotation), Translation); + + // Store the center sphere. + XMStoreFloat3(&Out.Center, vCenter); + + // Scale the radius of the pshere. + Out.Radius = Radius * Scale; +} + + +//----------------------------------------------------------------------------- +// Point in sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingSphere::Contains(FXMVECTOR Point) const noexcept +{ + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + XMVECTOR DistanceSquared = XMVector3LengthSq(XMVectorSubtract(Point, vCenter)); + XMVECTOR RadiusSquared = XMVectorMultiply(vRadius, vRadius); + + return XMVector3LessOrEqual(DistanceSquared, RadiusSquared) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingSphere::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + if (!Intersects(V0, V1, V2)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSquared = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V0, vCenter)); + XMVECTOR Inside = XMVectorLessOrEqual(DistanceSquared, RadiusSquared); + + DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V1, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(DistanceSquared, RadiusSquared)); + + DistanceSquared = XMVector3LengthSq(XMVectorSubtract(V2, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(DistanceSquared, RadiusSquared)); + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere in sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingSphere& sh) const noexcept +{ + XMVECTOR Center1 = XMLoadFloat3(&Center); + float r1 = Radius; + + XMVECTOR Center2 = XMLoadFloat3(&sh.Center); + float r2 = sh.Radius; + + XMVECTOR V = XMVectorSubtract(Center2, Center1); + + XMVECTOR Dist = XMVector3Length(V); + + float d = XMVectorGetX(Dist); + + return (r1 + r2 >= d) ? ((r1 - r2 >= d) ? CONTAINS : INTERSECTS) : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Axis-aligned box in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingBox& box) const noexcept +{ + if (!box.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR boxCenter = XMLoadFloat3(&box.Center); + XMVECTOR boxExtents = XMLoadFloat3(&box.Extents); + + XMVECTOR InsideAll = XMVectorTrueInt(); + + XMVECTOR offset = XMVectorSubtract(boxCenter, vCenter); + + for (size_t i = 0; i < BoundingBox::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorMultiplyAdd(boxExtents, g_BoxOffset[i], offset); + XMVECTOR d = XMVector3LengthSq(C); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); + } + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Oriented box in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingOrientedBox& box) const noexcept +{ + if (!box.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR boxCenter = XMLoadFloat3(&box.Center); + XMVECTOR boxExtents = XMLoadFloat3(&box.Extents); + XMVECTOR boxOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(boxOrientation)); + + XMVECTOR InsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < BoundingOrientedBox::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(boxExtents, g_BoxOffset[i]), boxOrientation), boxCenter); + XMVECTOR d = XMVector3LengthSq(XMVectorSubtract(vCenter, C)); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); + } + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; + +} + + +//----------------------------------------------------------------------------- +// Frustum in sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingSphere::Contains(const BoundingFrustum& fr) const noexcept +{ + if (!fr.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + XMVECTOR vOrigin = XMLoadFloat3(&fr.Origin); + XMVECTOR vOrientation = XMLoadFloat4(&fr.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(fr.RightSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(fr.RightSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(fr.LeftSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(fr.LeftSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&fr.Near); + XMVECTOR vFar = XMVectorReplicatePtr(&fr.Far); + + XMVECTOR Corners[BoundingFrustum::CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + XMVECTOR InsideAll = XMVectorTrueInt(); + for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(Corners[i], vOrientation), vOrigin); + XMVECTOR d = XMVector3LengthSq(XMVectorSubtract(vCenter, C)); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(d, RadiusSq)); + } + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere vs. sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingSphere& sh) const noexcept +{ + // Load A. + XMVECTOR vCenterA = XMLoadFloat3(&Center); + XMVECTOR vRadiusA = XMVectorReplicatePtr(&Radius); + + // Load B. + XMVECTOR vCenterB = XMLoadFloat3(&sh.Center); + XMVECTOR vRadiusB = XMVectorReplicatePtr(&sh.Radius); + + // Distance squared between centers. + XMVECTOR Delta = XMVectorSubtract(vCenterB, vCenterA); + XMVECTOR DistanceSquared = XMVector3LengthSq(Delta); + + // Sum of the radii squared. + XMVECTOR RadiusSquared = XMVectorAdd(vRadiusA, vRadiusB); + RadiusSquared = XMVectorMultiply(RadiusSquared, RadiusSquared); + + return XMVector3LessOrEqual(DistanceSquared, RadiusSquared); +} + + +//----------------------------------------------------------------------------- +// Box vs. sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingBox& box) const noexcept +{ + return box.Intersects(*this); +} + +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingOrientedBox& box) const noexcept +{ + return box.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Frustum vs. sphere test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingSphere::Intersects(const BoundingFrustum& fr) const noexcept +{ + return fr.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Triangle vs sphere test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // Compute the plane of the triangle (has to be normalized). + XMVECTOR N = XMVector3Normalize(XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0))); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(N, XMVectorZero())); + + // Find the nearest feature on the triangle to the sphere. + XMVECTOR Dist = XMVector3Dot(XMVectorSubtract(vCenter, V0), N); + + // If the center of the sphere is farther from the plane of the triangle than + // the radius of the sphere, then there cannot be an intersection. + XMVECTOR NoIntersection = XMVectorLess(Dist, XMVectorNegate(vRadius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Dist, vRadius)); + + // Project the center of the sphere onto the plane of the triangle. + XMVECTOR Point = XMVectorNegativeMultiplySubtract(N, Dist, vCenter); + + // Is it inside all the edges? If so we intersect because the distance + // to the plane is less than the radius. + XMVECTOR Intersection = DirectX::MathInternal::PointOnPlaneInsideTriangle(Point, V0, V1, V2); + + // Find the nearest point on each edge. + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + // Edge 0,1 + Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(V0, V1, vCenter); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); + + // Edge 1,2 + Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(V1, V2, vCenter); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); + + // Edge 2,0 + Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(V2, V0, vCenter); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersection = XMVectorOrInt(Intersection, XMVectorLessOrEqual(XMVector3LengthSq(XMVectorSubtract(vCenter, Point)), RadiusSq)); + + return XMVector4EqualInt(XMVectorAndCInt(Intersection, NoIntersection), XMVectorTrueInt()); +} + + +//----------------------------------------------------------------------------- +// Sphere-plane intersection +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); + + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane, Outside, Inside); + + // If the sphere is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the sphere is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The sphere is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Compute the intersection of a ray (Origin, Direction) with a sphere. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingSphere::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept +{ + assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // l is the vector from the ray origin to the center of the sphere. + XMVECTOR l = XMVectorSubtract(vCenter, Origin); + + // s is the projection of the l onto the ray direction. + XMVECTOR s = XMVector3Dot(l, Direction); + + XMVECTOR l2 = XMVector3Dot(l, l); + + XMVECTOR r2 = XMVectorMultiply(vRadius, vRadius); + + // m2 is squared distance from the center of the sphere to the projection. + XMVECTOR m2 = XMVectorNegativeMultiplySubtract(s, s, l2); + + XMVECTOR NoIntersection; + + // If the ray origin is outside the sphere and the center of the sphere is + // behind the ray origin there is no intersection. + NoIntersection = XMVectorAndInt(XMVectorLess(s, XMVectorZero()), XMVectorGreater(l2, r2)); + + // If the squared distance from the center of the sphere to the projection + // is greater than the radius squared the ray will miss the sphere. + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(m2, r2)); + + // The ray hits the sphere, compute the nearest intersection point. + XMVECTOR q = XMVectorSqrt(XMVectorSubtract(r2, m2)); + XMVECTOR t1 = XMVectorSubtract(s, q); + XMVECTOR t2 = XMVectorAdd(s, q); + + XMVECTOR OriginInside = XMVectorLessOrEqual(l2, r2); + XMVECTOR t = XMVectorSelect(t1, t2, OriginInside); + + if (XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt())) + { + // Store the x-component to *pDist. + XMStoreFloat(&Dist, t); + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test a sphere vs 6 planes (typically forming a frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingSphere::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&Radius); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectSpherePlane(vCenter, vRadius, Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the sphere is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the sphere is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The sphere is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Creates a bounding sphere that contains two other bounding spheres +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateMerged(BoundingSphere& Out, const BoundingSphere& S1, const BoundingSphere& S2) noexcept +{ + XMVECTOR Center1 = XMLoadFloat3(&S1.Center); + float r1 = S1.Radius; + + XMVECTOR Center2 = XMLoadFloat3(&S2.Center); + float r2 = S2.Radius; + + XMVECTOR V = XMVectorSubtract(Center2, Center1); + + XMVECTOR Dist = XMVector3Length(V); + + float d = XMVectorGetX(Dist); + + if (r1 + r2 >= d) + { + if (r1 - r2 >= d) + { + Out = S1; + return; + } + else if (r2 - r1 >= d) + { + Out = S2; + return; + } + } + + XMVECTOR N = XMVectorDivide(V, Dist); + + float t1 = XMMin(-r1, d - r2); + float t2 = XMMax(r1, d + r2); + float t_5 = (t2 - t1) * 0.5f; + + XMVECTOR NCenter = XMVectorAdd(Center1, XMVectorMultiply(N, XMVectorReplicate(t_5 + t1))); + + XMStoreFloat3(&Out.Center, NCenter); + Out.Radius = t_5; +} + + +//----------------------------------------------------------------------------- +// Create sphere enscribing bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromBoundingBox(BoundingSphere& Out, const BoundingBox& box) noexcept +{ + Out.Center = box.Center; + XMVECTOR vExtents = XMLoadFloat3(&box.Extents); + Out.Radius = XMVectorGetX(XMVector3Length(vExtents)); +} + +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromBoundingBox(BoundingSphere& Out, const BoundingOrientedBox& box) noexcept +{ + // Bounding box orientation is irrelevant because a sphere is rotationally invariant + Out.Center = box.Center; + XMVECTOR vExtents = XMLoadFloat3(&box.Extents); + Out.Radius = XMVectorGetX(XMVector3Length(vExtents)); +} + + +//----------------------------------------------------------------------------- +// Find the approximate smallest enclosing bounding sphere for a set of +// points. Exact computation of the smallest enclosing bounding sphere is +// possible but is slower and requires a more complex algorithm. +// The algorithm is based on Jack Ritter, "An Efficient Bounding Sphere", +// Graphics Gems. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromPoints(BoundingSphere& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept +{ + assert(Count > 0); + assert(pPoints); + + // Find the points with minimum and maximum x, y, and z + XMVECTOR MinX, MaxX, MinY, MaxY, MinZ, MaxZ; + + MinX = MaxX = MinY = MaxY = MinZ = MaxZ = XMLoadFloat3(pPoints); + + for (size_t i = 1; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + float px = XMVectorGetX(Point); + float py = XMVectorGetY(Point); + float pz = XMVectorGetZ(Point); + + if (px < XMVectorGetX(MinX)) + MinX = Point; + + if (px > XMVectorGetX(MaxX)) + MaxX = Point; + + if (py < XMVectorGetY(MinY)) + MinY = Point; + + if (py > XMVectorGetY(MaxY)) + MaxY = Point; + + if (pz < XMVectorGetZ(MinZ)) + MinZ = Point; + + if (pz > XMVectorGetZ(MaxZ)) + MaxZ = Point; + } + + // Use the min/max pair that are farthest apart to form the initial sphere. + XMVECTOR DeltaX = XMVectorSubtract(MaxX, MinX); + XMVECTOR DistX = XMVector3Length(DeltaX); + + XMVECTOR DeltaY = XMVectorSubtract(MaxY, MinY); + XMVECTOR DistY = XMVector3Length(DeltaY); + + XMVECTOR DeltaZ = XMVectorSubtract(MaxZ, MinZ); + XMVECTOR DistZ = XMVector3Length(DeltaZ); + + XMVECTOR vCenter; + XMVECTOR vRadius; + + if (XMVector3Greater(DistX, DistY)) + { + if (XMVector3Greater(DistX, DistZ)) + { + // Use min/max x. + vCenter = XMVectorLerp(MaxX, MinX, 0.5f); + vRadius = XMVectorScale(DistX, 0.5f); + } + else + { + // Use min/max z. + vCenter = XMVectorLerp(MaxZ, MinZ, 0.5f); + vRadius = XMVectorScale(DistZ, 0.5f); + } + } + else // Y >= X + { + if (XMVector3Greater(DistY, DistZ)) + { + // Use min/max y. + vCenter = XMVectorLerp(MaxY, MinY, 0.5f); + vRadius = XMVectorScale(DistY, 0.5f); + } + else + { + // Use min/max z. + vCenter = XMVectorLerp(MaxZ, MinZ, 0.5f); + vRadius = XMVectorScale(DistZ, 0.5f); + } + } + + // Add any points not inside the sphere. + for (size_t i = 0; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + XMVECTOR Delta = XMVectorSubtract(Point, vCenter); + + XMVECTOR Dist = XMVector3Length(Delta); + + if (XMVector3Greater(Dist, vRadius)) + { + // Adjust sphere to include the new point. + vRadius = XMVectorScale(XMVectorAdd(vRadius, Dist), 0.5f); + vCenter = XMVectorAdd(vCenter, XMVectorMultiply(XMVectorSubtract(XMVectorReplicate(1.0f), XMVectorDivide(vRadius, Dist)), Delta)); + } + } + + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat(&Out.Radius, vRadius); +} + + +//----------------------------------------------------------------------------- +// Create sphere containing frustum +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingSphere::CreateFromFrustum(BoundingSphere& Out, const BoundingFrustum& fr) noexcept +{ + XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; + fr.GetCorners(Corners); + CreateFromPoints(Out, BoundingFrustum::CORNER_COUNT, Corners, sizeof(XMFLOAT3)); +} + + +/**************************************************************************** + * + * BoundingBox + * + ****************************************************************************/ + +//----------------------------------------------------------------------------- +// Transform an axis aligned box by an angle preserving transform. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingBox::Transform(BoundingBox& Out, FXMMATRIX M) const noexcept +{ + // Load center and extents. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Compute and transform the corners and find new min/max bounds. + XMVECTOR Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[0], vCenter); + Corner = XMVector3Transform(Corner, M); + + XMVECTOR Min, Max; + Min = Max = Corner; + + for (size_t i = 1; i < CORNER_COUNT; ++i) + { + Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); + Corner = XMVector3Transform(Corner, M); + + Min = XMVectorMin(Min, Corner); + Max = XMVectorMax(Max, Corner); + } + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingBox::Transform(BoundingBox& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + assert(DirectX::MathInternal::XMQuaternionIsUnit(Rotation)); + + // Load center and extents. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR VectorScale = XMVectorReplicate(Scale); + + // Compute and transform the corners and find new min/max bounds. + XMVECTOR Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[0], vCenter); + Corner = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(Corner, VectorScale), Rotation), Translation); + + XMVECTOR Min, Max; + Min = Max = Corner; + + for (size_t i = 1; i < CORNER_COUNT; ++i) + { + Corner = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); + Corner = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(Corner, VectorScale), Rotation), Translation); + + Min = XMVectorMin(Min, Corner); + Max = XMVectorMax(Max, Corner); + } + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Get the corner points of the box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::GetCorners(XMFLOAT3* Corners) const noexcept +{ + assert(Corners != nullptr); + + // Load the box + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorMultiplyAdd(vExtents, g_BoxOffset[i], vCenter); + XMStoreFloat3(&Corners[i], C); + } +} + + +//----------------------------------------------------------------------------- +// Point in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingBox::Contains(FXMVECTOR Point) const noexcept +{ + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + return XMVector3InBounds(XMVectorSubtract(Point, vCenter), vExtents) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingBox::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + if (!Intersects(V0, V1, V2)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR d = XMVectorAbs(XMVectorSubtract(V0, vCenter)); + XMVECTOR Inside = XMVectorLessOrEqual(d, vExtents); + + d = XMVectorAbs(XMVectorSubtract(V1, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + + d = XMVectorAbs(XMVectorSubtract(V2, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + + XMVECTOR BoxMin = XMVectorSubtract(BoxCenter, BoxExtents); + XMVECTOR BoxMax = XMVectorAdd(BoxCenter, BoxExtents); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, BoxMin); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxMax); + + XMVECTOR MinDelta = XMVectorSubtract(SphereCenter, BoxMin); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxMax); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + + if (XMVector3Greater(d2, XMVectorMultiply(SphereRadius, SphereRadius))) + return DISJOINT; + + XMVECTOR InsideAll = XMVectorLessOrEqual(XMVectorAdd(BoxMin, SphereRadius), SphereCenter); + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(SphereCenter, XMVectorSubtract(BoxMax, SphereRadius))); + InsideAll = XMVectorAndInt(InsideAll, XMVectorGreater(XMVectorSubtract(BoxMax, BoxMin), SphereRadius)); + + return (XMVector3EqualInt(InsideAll, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Axis-aligned box in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingBox& box) const noexcept +{ + XMVECTOR CenterA = XMLoadFloat3(&Center); + XMVECTOR ExtentsA = XMLoadFloat3(&Extents); + + XMVECTOR CenterB = XMLoadFloat3(&box.Center); + XMVECTOR ExtentsB = XMLoadFloat3(&box.Extents); + + XMVECTOR MinA = XMVectorSubtract(CenterA, ExtentsA); + XMVECTOR MaxA = XMVectorAdd(CenterA, ExtentsA); + + XMVECTOR MinB = XMVectorSubtract(CenterB, ExtentsB); + XMVECTOR MaxB = XMVectorAdd(CenterB, ExtentsB); + + // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then return false + XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(MinA, MaxB), XMVectorGreater(MinB, MaxA)); + + if (DirectX::MathInternal::XMVector3AnyTrue(Disjoint)) + return DISJOINT; + + // for each i in (x, y, z) if a_min(i) <= b_min(i) and b_max(i) <= a_max(i) then A contains B + XMVECTOR Inside = XMVectorAndInt(XMVectorLessOrEqual(MinA, MinB), XMVectorLessOrEqual(MaxB, MaxA)); + + return DirectX::MathInternal::XMVector3AllTrue(Inside) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Oriented box in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingOrientedBox& box) const noexcept +{ + if (!box.Intersects(*this)) + return DISJOINT; + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Subtract off the AABB center to remove a subtract below + XMVECTOR oCenter = XMVectorSubtract(XMLoadFloat3(&box.Center), vCenter); + + XMVECTOR oExtents = XMLoadFloat3(&box.Extents); + XMVECTOR oOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(oOrientation)); + + XMVECTOR Inside = XMVectorTrueInt(); + + for (size_t i = 0; i < BoundingOrientedBox::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(oExtents, g_BoxOffset[i]), oOrientation), oCenter); + XMVECTOR d = XMVectorAbs(C); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + } + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Frustum in axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingBox::Contains(const BoundingFrustum& fr) const noexcept +{ + if (!fr.Intersects(*this)) + return DISJOINT; + + XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; + fr.GetCorners(Corners); + + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR Inside = XMVectorTrueInt(); + + for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) + { + XMVECTOR Point = XMLoadFloat3(&Corners[i]); + XMVECTOR d = XMVectorAbs(XMVectorSubtract(Point, vCenter)); + Inside = XMVectorAndInt(Inside, XMVectorLessOrEqual(d, vExtents)); + } + + return (XMVector3EqualInt(Inside, XMVectorTrueInt())) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Sphere vs axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + + XMVECTOR BoxMin = XMVectorSubtract(BoxCenter, BoxExtents); + XMVECTOR BoxMax = XMVectorAdd(BoxCenter, BoxExtents); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, BoxMin); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxMax); + + XMVECTOR MinDelta = XMVectorSubtract(SphereCenter, BoxMin); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxMax); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + + return XMVector3LessOrEqual(d2, XMVectorMultiply(SphereRadius, SphereRadius)); +} + + +//----------------------------------------------------------------------------- +// Axis-aligned box vs. axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingBox& box) const noexcept +{ + XMVECTOR CenterA = XMLoadFloat3(&Center); + XMVECTOR ExtentsA = XMLoadFloat3(&Extents); + + XMVECTOR CenterB = XMLoadFloat3(&box.Center); + XMVECTOR ExtentsB = XMLoadFloat3(&box.Extents); + + XMVECTOR MinA = XMVectorSubtract(CenterA, ExtentsA); + XMVECTOR MaxA = XMVectorAdd(CenterA, ExtentsA); + + XMVECTOR MinB = XMVectorSubtract(CenterB, ExtentsB); + XMVECTOR MaxB = XMVectorAdd(CenterB, ExtentsB); + + // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then return false + XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(MinA, MaxB), XMVectorGreater(MinB, MaxA)); + + return !DirectX::MathInternal::XMVector3AnyTrue(Disjoint); +} + + +//----------------------------------------------------------------------------- +// Oriented box vs. axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingOrientedBox& box) const noexcept +{ + return box.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Frustum vs. axis-aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingBox::Intersects(const BoundingFrustum& fr) const noexcept +{ + return fr.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Triangle vs. axis aligned box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingBox::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + XMVECTOR Zero = XMVectorZero(); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + XMVECTOR BoxMin = XMVectorSubtract(vCenter, vExtents); + XMVECTOR BoxMax = XMVectorAdd(vCenter, vExtents); + + // Test the axes of the box (in effect test the AAB against the minimal AAB + // around the triangle). + XMVECTOR TriMin = XMVectorMin(XMVectorMin(V0, V1), V2); + XMVECTOR TriMax = XMVectorMax(XMVectorMax(V0, V1), V2); + + // for each i in (x, y, z) if a_min(i) > b_max(i) or b_min(i) > a_max(i) then disjoint + XMVECTOR Disjoint = XMVectorOrInt(XMVectorGreater(TriMin, BoxMax), XMVectorGreater(BoxMin, TriMax)); + if (DirectX::MathInternal::XMVector3AnyTrue(Disjoint)) + return false; + + // Test the plane of the triangle. + XMVECTOR Normal = XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0)); + XMVECTOR Dist = XMVector3Dot(Normal, V0); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(Normal, Zero)); + + // for each i in (x, y, z) if n(i) >= 0 then v_min(i)=b_min(i), v_max(i)=b_max(i) + // else v_min(i)=b_max(i), v_max(i)=b_min(i) + XMVECTOR NormalSelect = XMVectorGreater(Normal, Zero); + XMVECTOR V_Min = XMVectorSelect(BoxMax, BoxMin, NormalSelect); + XMVECTOR V_Max = XMVectorSelect(BoxMin, BoxMax, NormalSelect); + + // if n dot v_min + d > 0 || n dot v_max + d < 0 then disjoint + XMVECTOR MinDist = XMVector3Dot(V_Min, Normal); + XMVECTOR MaxDist = XMVector3Dot(V_Max, Normal); + + XMVECTOR NoIntersection = XMVectorGreater(MinDist, Dist); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(MaxDist, Dist)); + + // Move the box center to zero to simplify the following tests. + XMVECTOR TV0 = XMVectorSubtract(V0, vCenter); + XMVECTOR TV1 = XMVectorSubtract(V1, vCenter); + XMVECTOR TV2 = XMVectorSubtract(V2, vCenter); + + // Test the edge/edge axes (3*3). + XMVECTOR e0 = XMVectorSubtract(TV1, TV0); + XMVECTOR e1 = XMVectorSubtract(TV2, TV1); + XMVECTOR e2 = XMVectorSubtract(TV0, TV2); + + // Make w zero. + e0 = XMVectorInsert<0, 0, 0, 0, 1>(e0, Zero); + e1 = XMVectorInsert<0, 0, 0, 0, 1>(e1, Zero); + e2 = XMVectorInsert<0, 0, 0, 0, 1>(e2, Zero); + + XMVECTOR Axis; + XMVECTOR p0, p1, p2; + XMVECTOR Min, Max; + XMVECTOR Radius; + + // Axis == (1,0,0) x e0 = (0, -e0.z, e0.y) + Axis = XMVectorPermute(e0, XMVectorNegate(e0)); + p0 = XMVector3Dot(TV0, Axis); + // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; + p2 = XMVector3Dot(TV2, Axis); + Min = XMVectorMin(p0, p2); + Max = XMVectorMax(p0, p2); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (1,0,0) x e1 = (0, -e1.z, e1.y) + Axis = XMVectorPermute(e1, XMVectorNegate(e1)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (1,0,0) x e2 = (0, -e2.z, e2.y) + Axis = XMVectorPermute(e2, XMVectorNegate(e2)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,1,0) x e0 = (e0.z, 0, -e0.x) + Axis = XMVectorPermute(e0, XMVectorNegate(e0)); + p0 = XMVector3Dot(TV0, Axis); + // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; + p2 = XMVector3Dot(TV2, Axis); + Min = XMVectorMin(p0, p2); + Max = XMVectorMax(p0, p2); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,1,0) x e1 = (e1.z, 0, -e1.x) + Axis = XMVectorPermute(e1, XMVectorNegate(e1)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e2 = (e2.z, 0, -e2.x) + Axis = XMVectorPermute(e2, XMVectorNegate(e2)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e0 = (-e0.y, e0.x, 0) + Axis = XMVectorPermute(e0, XMVectorNegate(e0)); + p0 = XMVector3Dot(TV0, Axis); + // p1 = XMVector3Dot( V1, Axis ); // p1 = p0; + p2 = XMVector3Dot(TV2, Axis); + Min = XMVectorMin(p0, p2); + Max = XMVectorMax(p0, p2); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e1 = (-e1.y, e1.x, 0) + Axis = XMVectorPermute(e1, XMVectorNegate(e1)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p1; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + // Axis == (0,0,1) x e2 = (-e2.y, e2.x, 0) + Axis = XMVectorPermute(e2, XMVectorNegate(e2)); + p0 = XMVector3Dot(TV0, Axis); + p1 = XMVector3Dot(TV1, Axis); + // p2 = XMVector3Dot( V2, Axis ); // p2 = p0; + Min = XMVectorMin(p0, p1); + Max = XMVectorMax(p0, p1); + Radius = XMVector3Dot(vExtents, XMVectorAbs(Axis)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(Min, Radius)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(Max, XMVectorNegate(Radius))); + + return XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt()); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingBox::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane, Outside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The box is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Compute the intersection of a ray (Origin, Direction) with an axis aligned +// box using the slabs method. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingBox::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept +{ + assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Adjust ray origin to be relative to center of the box. + XMVECTOR TOrigin = XMVectorSubtract(vCenter, Origin); + + // Compute the dot product againt each axis of the box. + // Since the axii are (1,0,0), (0,1,0), (0,0,1) no computation is necessary. + XMVECTOR AxisDotOrigin = TOrigin; + XMVECTOR AxisDotDirection = Direction; + + // if (fabs(AxisDotDirection) <= Epsilon) the ray is nearly parallel to the slab. + XMVECTOR IsParallel = XMVectorLessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon); + + // Test against all three axii simultaneously. + XMVECTOR InverseAxisDotDirection = XMVectorReciprocal(AxisDotDirection); + XMVECTOR t1 = XMVectorMultiply(XMVectorSubtract(AxisDotOrigin, vExtents), InverseAxisDotDirection); + XMVECTOR t2 = XMVectorMultiply(XMVectorAdd(AxisDotOrigin, vExtents), InverseAxisDotDirection); + + // Compute the max of min(t1,t2) and the min of max(t1,t2) ensuring we don't + // use the results from any directions parallel to the slab. + XMVECTOR t_min = XMVectorSelect(XMVectorMin(t1, t2), g_FltMin, IsParallel); + XMVECTOR t_max = XMVectorSelect(XMVectorMax(t1, t2), g_FltMax, IsParallel); + + // t_min.x = maximum( t_min.x, t_min.y, t_min.z ); + // t_max.x = minimum( t_max.x, t_max.y, t_max.z ); + t_min = XMVectorMax(t_min, XMVectorSplatY(t_min)); // x = max(x,y) + t_min = XMVectorMax(t_min, XMVectorSplatZ(t_min)); // x = max(max(x,y),z) + t_max = XMVectorMin(t_max, XMVectorSplatY(t_max)); // x = min(x,y) + t_max = XMVectorMin(t_max, XMVectorSplatZ(t_max)); // x = min(min(x,y),z) + + // if ( t_min > t_max ) return false; + XMVECTOR NoIntersection = XMVectorGreater(XMVectorSplatX(t_min), XMVectorSplatX(t_max)); + + // if ( t_max < 0.0f ) return false; + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorSplatX(t_max), XMVectorZero())); + + // if (IsParallel && (-Extents > AxisDotOrigin || Extents < AxisDotOrigin)) return false; + XMVECTOR ParallelOverlap = XMVectorInBounds(AxisDotOrigin, vExtents); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorAndCInt(IsParallel, ParallelOverlap)); + + if (!DirectX::MathInternal::XMVector3AnyTrue(NoIntersection)) + { + // Store the x-component to *pDist + XMStoreFloat(&Dist, t_min); + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test an axis alinged box vs 6 planes (typically forming a frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingBox::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectAxisAlignedBoxPlane(vCenter, vExtents, Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The box is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Create axis-aligned box that contains two other bounding boxes +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::CreateMerged(BoundingBox& Out, const BoundingBox& b1, const BoundingBox& b2) noexcept +{ + XMVECTOR b1Center = XMLoadFloat3(&b1.Center); + XMVECTOR b1Extents = XMLoadFloat3(&b1.Extents); + + XMVECTOR b2Center = XMLoadFloat3(&b2.Center); + XMVECTOR b2Extents = XMLoadFloat3(&b2.Extents); + + XMVECTOR Min = XMVectorSubtract(b1Center, b1Extents); + Min = XMVectorMin(Min, XMVectorSubtract(b2Center, b2Extents)); + + XMVECTOR Max = XMVectorAdd(b1Center, b1Extents); + Max = XMVectorMax(Max, XMVectorAdd(b2Center, b2Extents)); + + assert(XMVector3LessOrEqual(Min, Max)); + + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Create axis-aligned box that contains a bounding sphere +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::CreateFromSphere(BoundingBox& Out, const BoundingSphere& sh) noexcept +{ + XMVECTOR spCenter = XMLoadFloat3(&sh.Center); + XMVECTOR shRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR Min = XMVectorSubtract(spCenter, shRadius); + XMVECTOR Max = XMVectorAdd(spCenter, shRadius); + + assert(XMVector3LessOrEqual(Min, Max)); + + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Create axis-aligned box from min/max points +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingBox::CreateFromPoints(BoundingBox& Out, FXMVECTOR pt1, FXMVECTOR pt2) noexcept +{ + XMVECTOR Min = XMVectorMin(pt1, pt2); + XMVECTOR Max = XMVectorMax(pt1, pt2); + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(Min, Max), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(Max, Min), 0.5f)); +} + + +//----------------------------------------------------------------------------- +// Find the minimum axis aligned bounding box containing a set of points. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingBox::CreateFromPoints(BoundingBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept +{ + assert(Count > 0); + assert(pPoints); + + // Find the minimum and maximum x, y, and z + XMVECTOR vMin, vMax; + + vMin = vMax = XMLoadFloat3(pPoints); + + for (size_t i = 1; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + vMin = XMVectorMin(vMin, Point); + vMax = XMVectorMax(vMax, Point); + } + + // Store center and extents. + XMStoreFloat3(&Out.Center, XMVectorScale(XMVectorAdd(vMin, vMax), 0.5f)); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(vMax, vMin), 0.5f)); +} + + +/**************************************************************************** + * + * BoundingOrientedBox + * + ****************************************************************************/ + +//----------------------------------------------------------------------------- +// Transform an oriented box by an angle preserving transform. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingOrientedBox::Transform(BoundingOrientedBox& Out, FXMMATRIX M) const noexcept +{ + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Composite the box rotation and the transform rotation. + XMMATRIX nM; + nM.r[0] = XMVector3Normalize(M.r[0]); + nM.r[1] = XMVector3Normalize(M.r[1]); + nM.r[2] = XMVector3Normalize(M.r[2]); + nM.r[3] = g_XMIdentityR3; + XMVECTOR Rotation = XMQuaternionRotationMatrix(nM); + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the center. + vCenter = XMVector3Transform(vCenter, M); + + // Scale the box extents. + XMVECTOR dX = XMVector3Length(M.r[0]); + XMVECTOR dY = XMVector3Length(M.r[1]); + XMVECTOR dZ = XMVector3Length(M.r[2]); + + XMVECTOR VectorScale = XMVectorSelect(dY, dX, g_XMSelect1000); + VectorScale = XMVectorSelect(dZ, VectorScale, g_XMSelect1100); + vExtents = XMVectorMultiply(vExtents, VectorScale); + + // Store the box. + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat3(&Out.Extents, vExtents); + XMStoreFloat4(&Out.Orientation, vOrientation); +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingOrientedBox::Transform(BoundingOrientedBox& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + assert(DirectX::MathInternal::XMQuaternionIsUnit(Rotation)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Composite the box rotation and the transform rotation. + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the center. + XMVECTOR VectorScale = XMVectorReplicate(Scale); + vCenter = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(vCenter, VectorScale), Rotation), Translation); + + // Scale the box extents. + vExtents = XMVectorMultiply(vExtents, VectorScale); + + // Store the box. + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat3(&Out.Extents, vExtents); + XMStoreFloat4(&Out.Orientation, vOrientation); +} + + +//----------------------------------------------------------------------------- +// Get the corner points of the box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingOrientedBox::GetCorners(XMFLOAT3* Corners) const noexcept +{ + assert(Corners != nullptr); + + // Load the box + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(vExtents, g_BoxOffset[i]), vOrientation), vCenter); + XMStoreFloat3(&Corners[i], C); + } +} + + +//----------------------------------------------------------------------------- +// Point in oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingOrientedBox::Contains(FXMVECTOR Point) const noexcept +{ + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Transform the point to be local to the box. + XMVECTOR TPoint = XMVector3InverseRotate(XMVectorSubtract(Point, vCenter), vOrientation); + + return XMVector3InBounds(TPoint, vExtents) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingOrientedBox::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load the box center & orientation. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Transform the triangle vertices into the space of the box. + XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vCenter), vOrientation); + XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vCenter), vOrientation); + XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vCenter), vOrientation); + + BoundingBox box; + box.Center = XMFLOAT3(0.0f, 0.0f, 0.0f); + box.Extents = Extents; + + // Use the triangle vs axis aligned box intersection routine. + return box.Contains(TV0, TV1, TV2); +} + + +//----------------------------------------------------------------------------- +// Sphere in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); + + // Transform the center of the sphere to be local to the box. + // BoxMin = -BoxExtents + // BoxMax = +BoxExtents + SphereCenter = XMVector3InverseRotate(XMVectorSubtract(SphereCenter, BoxCenter), BoxOrientation); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, XMVectorNegate(BoxExtents)); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxExtents); + + XMVECTOR MinDelta = XMVectorAdd(SphereCenter, BoxExtents); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxExtents); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + XMVECTOR SphereRadiusSq = XMVectorMultiply(SphereRadius, SphereRadius); + + if (XMVector4Greater(d2, SphereRadiusSq)) + return DISJOINT; + + // See if we are completely inside the box + XMVECTOR SMin = XMVectorSubtract(SphereCenter, SphereRadius); + XMVECTOR SMax = XMVectorAdd(SphereCenter, SphereRadius); + + return (XMVector3InBounds(SMin, BoxExtents) && XMVector3InBounds(SMax, BoxExtents)) ? CONTAINS : INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Axis aligned box vs. oriented box. Constructs an oriented box and uses +// the oriented box vs. oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingBox& box) const noexcept +{ + // Make the axis aligned box oriented and do an OBB vs OBB test. + BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); + return Contains(obox); +} + + +//----------------------------------------------------------------------------- +// Oriented bounding box in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingOrientedBox& box) const noexcept +{ + if (!Intersects(box)) + return DISJOINT; + + // Load the boxes + XMVECTOR aCenter = XMLoadFloat3(&Center); + XMVECTOR aExtents = XMLoadFloat3(&Extents); + XMVECTOR aOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(aOrientation)); + + XMVECTOR bCenter = XMLoadFloat3(&box.Center); + XMVECTOR bExtents = XMLoadFloat3(&box.Extents); + XMVECTOR bOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(bOrientation)); + + XMVECTOR offset = XMVectorSubtract(bCenter, aCenter); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + // Cb = rotate( bExtents * corneroffset[i], bOrientation ) + bcenter + // Ca = invrotate( Cb - aCenter, aOrientation ) + + XMVECTOR C = XMVectorAdd(XMVector3Rotate(XMVectorMultiply(bExtents, g_BoxOffset[i]), bOrientation), offset); + C = XMVector3InverseRotate(C, aOrientation); + + if (!XMVector3InBounds(C, aExtents)) + return INTERSECTS; + } + + return CONTAINS; +} + + +//----------------------------------------------------------------------------- +// Frustum in oriented bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingOrientedBox::Contains(const BoundingFrustum& fr) const noexcept +{ + if (!fr.Intersects(*this)) + return DISJOINT; + + XMFLOAT3 Corners[BoundingFrustum::CORNER_COUNT]; + fr.GetCorners(Corners); + + // Load the box + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + for (size_t i = 0; i < BoundingFrustum::CORNER_COUNT; ++i) + { + XMVECTOR C = XMVector3InverseRotate(XMVectorSubtract(XMLoadFloat3(&Corners[i]), vCenter), vOrientation); + + if (!XMVector3InBounds(C, vExtents)) + return INTERSECTS; + } + + return CONTAINS; +} + + +//----------------------------------------------------------------------------- +// Sphere vs. oriented box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingSphere& sh) const noexcept +{ + XMVECTOR SphereCenter = XMLoadFloat3(&sh.Center); + XMVECTOR SphereRadius = XMVectorReplicatePtr(&sh.Radius); + + XMVECTOR BoxCenter = XMLoadFloat3(&Center); + XMVECTOR BoxExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); + + // Transform the center of the sphere to be local to the box. + // BoxMin = -BoxExtents + // BoxMax = +BoxExtents + SphereCenter = XMVector3InverseRotate(XMVectorSubtract(SphereCenter, BoxCenter), BoxOrientation); + + // Find the distance to the nearest point on the box. + // for each i in (x, y, z) + // if (SphereCenter(i) < BoxMin(i)) d2 += (SphereCenter(i) - BoxMin(i)) ^ 2 + // else if (SphereCenter(i) > BoxMax(i)) d2 += (SphereCenter(i) - BoxMax(i)) ^ 2 + + XMVECTOR d = XMVectorZero(); + + // Compute d for each dimension. + XMVECTOR LessThanMin = XMVectorLess(SphereCenter, XMVectorNegate(BoxExtents)); + XMVECTOR GreaterThanMax = XMVectorGreater(SphereCenter, BoxExtents); + + XMVECTOR MinDelta = XMVectorAdd(SphereCenter, BoxExtents); + XMVECTOR MaxDelta = XMVectorSubtract(SphereCenter, BoxExtents); + + // Choose value for each dimension based on the comparison. + d = XMVectorSelect(d, MinDelta, LessThanMin); + d = XMVectorSelect(d, MaxDelta, GreaterThanMax); + + // Use a dot-product to square them and sum them together. + XMVECTOR d2 = XMVector3Dot(d, d); + + return XMVector4LessOrEqual(d2, XMVectorMultiply(SphereRadius, SphereRadius)) ? true : false; +} + + +//----------------------------------------------------------------------------- +// Axis aligned box vs. oriented box. Constructs an oriented box and uses +// the oriented box vs. oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingBox& box) const noexcept +{ + // Make the axis aligned box oriented and do an OBB vs OBB test. + BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); + return Intersects(obox); +} + + +//----------------------------------------------------------------------------- +// Fast oriented box / oriented box intersection test using the separating axis +// theorem. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingOrientedBox& box) const noexcept +{ + // Build the 3x3 rotation matrix that defines the orientation of B relative to A. + XMVECTOR A_quat = XMLoadFloat4(&Orientation); + XMVECTOR B_quat = XMLoadFloat4(&box.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(A_quat)); + assert(DirectX::MathInternal::XMQuaternionIsUnit(B_quat)); + + XMVECTOR Q = XMQuaternionMultiply(A_quat, XMQuaternionConjugate(B_quat)); + XMMATRIX R = XMMatrixRotationQuaternion(Q); + + // Compute the translation of B relative to A. + XMVECTOR A_cent = XMLoadFloat3(&Center); + XMVECTOR B_cent = XMLoadFloat3(&box.Center); + XMVECTOR t = XMVector3InverseRotate(XMVectorSubtract(B_cent, A_cent), A_quat); + + // + // h(A) = extents of A. + // h(B) = extents of B. + // + // a(u) = axes of A = (1,0,0), (0,1,0), (0,0,1) + // b(u) = axes of B relative to A = (r00,r10,r20), (r01,r11,r21), (r02,r12,r22) + // + // For each possible separating axis l: + // d(A) = sum (for i = u,v,w) h(A)(i) * abs( a(i) dot l ) + // d(B) = sum (for i = u,v,w) h(B)(i) * abs( b(i) dot l ) + // if abs( t dot l ) > d(A) + d(B) then disjoint + // + + // Load extents of A and B. + XMVECTOR h_A = XMLoadFloat3(&Extents); + XMVECTOR h_B = XMLoadFloat3(&box.Extents); + + // Rows. Note R[0,1,2]X.w = 0. + XMVECTOR R0X = R.r[0]; + XMVECTOR R1X = R.r[1]; + XMVECTOR R2X = R.r[2]; + + R = XMMatrixTranspose(R); + + // Columns. Note RX[0,1,2].w = 0. + XMVECTOR RX0 = R.r[0]; + XMVECTOR RX1 = R.r[1]; + XMVECTOR RX2 = R.r[2]; + + // Absolute value of rows. + XMVECTOR AR0X = XMVectorAbs(R0X); + XMVECTOR AR1X = XMVectorAbs(R1X); + XMVECTOR AR2X = XMVectorAbs(R2X); + + // Absolute value of columns. + XMVECTOR ARX0 = XMVectorAbs(RX0); + XMVECTOR ARX1 = XMVectorAbs(RX1); + XMVECTOR ARX2 = XMVectorAbs(RX2); + + // Test each of the 15 possible seperating axii. + XMVECTOR d, d_A, d_B; + + // l = a(u) = (1, 0, 0) + // t dot l = t.x + // d(A) = h(A).x + // d(B) = h(B) dot abs(r00, r01, r02) + d = XMVectorSplatX(t); + d_A = XMVectorSplatX(h_A); + d_B = XMVector3Dot(h_B, AR0X); + XMVECTOR NoIntersection = XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B)); + + // l = a(v) = (0, 1, 0) + // t dot l = t.y + // d(A) = h(A).y + // d(B) = h(B) dot abs(r10, r11, r12) + d = XMVectorSplatY(t); + d_A = XMVectorSplatY(h_A); + d_B = XMVector3Dot(h_B, AR1X); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) = (0, 0, 1) + // t dot l = t.z + // d(A) = h(A).z + // d(B) = h(B) dot abs(r20, r21, r22) + d = XMVectorSplatZ(t); + d_A = XMVectorSplatZ(h_A); + d_B = XMVector3Dot(h_B, AR2X); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = b(u) = (r00, r10, r20) + // d(A) = h(A) dot abs(r00, r10, r20) + // d(B) = h(B).x + d = XMVector3Dot(t, RX0); + d_A = XMVector3Dot(h_A, ARX0); + d_B = XMVectorSplatX(h_B); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = b(v) = (r01, r11, r21) + // d(A) = h(A) dot abs(r01, r11, r21) + // d(B) = h(B).y + d = XMVector3Dot(t, RX1); + d_A = XMVector3Dot(h_A, ARX1); + d_B = XMVectorSplatY(h_B); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = b(w) = (r02, r12, r22) + // d(A) = h(A) dot abs(r02, r12, r22) + // d(B) = h(B).z + d = XMVector3Dot(t, RX2); + d_A = XMVector3Dot(h_A, ARX2); + d_B = XMVectorSplatZ(h_B); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(u) x b(u) = (0, -r20, r10) + // d(A) = h(A) dot abs(0, r20, r10) + // d(B) = h(B) dot abs(0, r02, r01) + d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(u) x b(v) = (0, -r21, r11) + // d(A) = h(A) dot abs(0, r21, r11) + // d(B) = h(B) dot abs(r02, 0, r00) + d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(u) x b(w) = (0, -r22, r12) + // d(A) = h(A) dot abs(0, r22, r12) + // d(B) = h(B) dot abs(r01, r00, 0) + d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR0X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(v) x b(u) = (r20, 0, -r00) + // d(A) = h(A) dot abs(r20, 0, r00) + // d(B) = h(B) dot abs(0, r12, r11) + d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(v) x b(v) = (r21, 0, -r01) + // d(A) = h(A) dot abs(r21, 0, r01) + // d(B) = h(B) dot abs(r12, 0, r10) + d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(v) x b(w) = (r22, 0, -r02) + // d(A) = h(A) dot abs(r22, 0, r02) + // d(B) = h(B) dot abs(r11, r10, 0) + d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR1X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) x b(u) = (-r10, r00, 0) + // d(A) = h(A) dot abs(r10, r00, 0) + // d(B) = h(B) dot abs(0, r22, r21) + d = XMVector3Dot(t, XMVectorPermute(RX0, XMVectorNegate(RX0))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX0)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) x b(v) = (-r11, r01, 0) + // d(A) = h(A) dot abs(r11, r01, 0) + // d(B) = h(B) dot abs(r22, 0, r20) + d = XMVector3Dot(t, XMVectorPermute(RX1, XMVectorNegate(RX1))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX1)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // l = a(w) x b(w) = (-r12, r02, 0) + // d(A) = h(A) dot abs(r12, r02, 0) + // d(B) = h(B) dot abs(r21, r20, 0) + d = XMVector3Dot(t, XMVectorPermute(RX2, XMVectorNegate(RX2))); + d_A = XMVector3Dot(h_A, XMVectorSwizzle(ARX2)); + d_B = XMVector3Dot(h_B, XMVectorSwizzle(AR2X)); + NoIntersection = XMVectorOrInt(NoIntersection, + XMVectorGreater(XMVectorAbs(d), XMVectorAdd(d_A, d_B))); + + // No seperating axis found, boxes must intersect. + return XMVector4NotEqualInt(NoIntersection, XMVectorTrueInt()) ? true : false; +} + + +//----------------------------------------------------------------------------- +// Frustum vs. oriented box test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingOrientedBox::Intersects(const BoundingFrustum& fr) const noexcept +{ + return fr.Intersects(*this); +} + + +//----------------------------------------------------------------------------- +// Triangle vs. oriented box test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load the box center & orientation. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Transform the triangle vertices into the space of the box. + XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vCenter), vOrientation); + XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vCenter), vOrientation); + XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vCenter), vOrientation); + + BoundingBox box; + box.Center = XMFLOAT3(0.0f, 0.0f, 0.0f); + box.Extents = Extents; + + // Use the triangle vs axis aligned box intersection routine. + return box.Intersects(TV0, TV1, TV2); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + // Build the 3x3 rotation matrix that defines the box axes. + XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); + + XMVECTOR Outside, Inside; + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane, Outside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The box is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Compute the intersection of a ray (Origin, Direction) with an oriented box +// using the slabs method. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingOrientedBox::Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const noexcept +{ + assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); + + static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Get the boxes normalized side directions. + XMMATRIX R = XMMatrixRotationQuaternion(vOrientation); + + // Adjust ray origin to be relative to center of the box. + XMVECTOR TOrigin = XMVectorSubtract(vCenter, Origin); + + // Compute the dot product againt each axis of the box. + XMVECTOR AxisDotOrigin = XMVector3Dot(R.r[0], TOrigin); + AxisDotOrigin = XMVectorSelect(AxisDotOrigin, XMVector3Dot(R.r[1], TOrigin), SelectY); + AxisDotOrigin = XMVectorSelect(AxisDotOrigin, XMVector3Dot(R.r[2], TOrigin), SelectZ); + + XMVECTOR AxisDotDirection = XMVector3Dot(R.r[0], Direction); + AxisDotDirection = XMVectorSelect(AxisDotDirection, XMVector3Dot(R.r[1], Direction), SelectY); + AxisDotDirection = XMVectorSelect(AxisDotDirection, XMVector3Dot(R.r[2], Direction), SelectZ); + + // if (fabs(AxisDotDirection) <= Epsilon) the ray is nearly parallel to the slab. + XMVECTOR IsParallel = XMVectorLessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon); + + // Test against all three axes simultaneously. + XMVECTOR InverseAxisDotDirection = XMVectorReciprocal(AxisDotDirection); + XMVECTOR t1 = XMVectorMultiply(XMVectorSubtract(AxisDotOrigin, vExtents), InverseAxisDotDirection); + XMVECTOR t2 = XMVectorMultiply(XMVectorAdd(AxisDotOrigin, vExtents), InverseAxisDotDirection); + + // Compute the max of min(t1,t2) and the min of max(t1,t2) ensuring we don't + // use the results from any directions parallel to the slab. + XMVECTOR t_min = XMVectorSelect(XMVectorMin(t1, t2), g_FltMin, IsParallel); + XMVECTOR t_max = XMVectorSelect(XMVectorMax(t1, t2), g_FltMax, IsParallel); + + // t_min.x = maximum( t_min.x, t_min.y, t_min.z ); + // t_max.x = minimum( t_max.x, t_max.y, t_max.z ); + t_min = XMVectorMax(t_min, XMVectorSplatY(t_min)); // x = max(x,y) + t_min = XMVectorMax(t_min, XMVectorSplatZ(t_min)); // x = max(std::max(x,y),z) + t_max = XMVectorMin(t_max, XMVectorSplatY(t_max)); // x = min(x,y) + t_max = XMVectorMin(t_max, XMVectorSplatZ(t_max)); // x = min(std::min(x,y),z) + + // if ( t_min > t_max ) return false; + XMVECTOR NoIntersection = XMVectorGreater(XMVectorSplatX(t_min), XMVectorSplatX(t_max)); + + // if ( t_max < 0.0f ) return false; + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorSplatX(t_max), XMVectorZero())); + + // if (IsParallel && (-Extents > AxisDotOrigin || Extents < AxisDotOrigin)) return false; + XMVECTOR ParallelOverlap = XMVectorInBounds(AxisDotOrigin, vExtents); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorAndCInt(IsParallel, ParallelOverlap)); + + if (!DirectX::MathInternal::XMVector3AnyTrue(NoIntersection)) + { + // Store the x-component to *pDist + XMStoreFloat(&Dist, t_min); + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test an oriented box vs 6 planes (typically forming a frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingOrientedBox::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load the box. + XMVECTOR vCenter = XMLoadFloat3(&Center); + XMVECTOR vExtents = XMLoadFloat3(&Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); + + // Set w of the center to one so we can dot4 with a plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + // Build the 3x3 rotation matrix that defines the box axes. + XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectOrientedBoxPlane(vCenter, vExtents, R.r[0], R.r[1], R.r[2], Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the box is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the box is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The box is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Create oriented bounding box from axis-aligned bounding box +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingOrientedBox::CreateFromBoundingBox(BoundingOrientedBox& Out, const BoundingBox& box) noexcept +{ + Out.Center = box.Center; + Out.Extents = box.Extents; + Out.Orientation = XMFLOAT4(0.f, 0.f, 0.f, 1.f); +} + + +//----------------------------------------------------------------------------- +// Find the approximate minimum oriented bounding box containing a set of +// points. Exact computation of minimum oriented bounding box is possible but +// is slower and requires a more complex algorithm. +// The algorithm works by computing the inertia tensor of the points and then +// using the eigenvectors of the intertia tensor as the axes of the box. +// Computing the intertia tensor of the convex hull of the points will usually +// result in better bounding box but the computation is more complex. +// Exact computation of the minimum oriented bounding box is possible but the +// best know algorithm is O(N^3) and is significanly more complex to implement. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingOrientedBox::CreateFromPoints(BoundingOrientedBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride) noexcept +{ + assert(Count > 0); + assert(pPoints != nullptr); + + XMVECTOR CenterOfMass = XMVectorZero(); + + // Compute the center of mass and inertia tensor of the points. + for (size_t i = 0; i < Count; ++i) + { + XMVECTOR Point = XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)); + + CenterOfMass = XMVectorAdd(CenterOfMass, Point); + } + + CenterOfMass = XMVectorMultiply(CenterOfMass, XMVectorReciprocal(XMVectorReplicate(float(Count)))); + + // Compute the inertia tensor of the points around the center of mass. + // Using the center of mass is not strictly necessary, but will hopefully + // improve the stability of finding the eigenvectors. + XMVECTOR XX_YY_ZZ = XMVectorZero(); + XMVECTOR XY_XZ_YZ = XMVectorZero(); + + for (size_t i = 0; i < Count; ++i) + { + XMVECTOR Point = XMVectorSubtract(XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)), CenterOfMass); + + XX_YY_ZZ = XMVectorAdd(XX_YY_ZZ, XMVectorMultiply(Point, Point)); + + XMVECTOR XXY = XMVectorSwizzle(Point); + XMVECTOR YZZ = XMVectorSwizzle(Point); + + XY_XZ_YZ = XMVectorAdd(XY_XZ_YZ, XMVectorMultiply(XXY, YZZ)); + } + + XMVECTOR v1, v2, v3; + + // Compute the eigenvectors of the inertia tensor. + DirectX::MathInternal::CalculateEigenVectorsFromCovarianceMatrix(XMVectorGetX(XX_YY_ZZ), XMVectorGetY(XX_YY_ZZ), + XMVectorGetZ(XX_YY_ZZ), + XMVectorGetX(XY_XZ_YZ), XMVectorGetY(XY_XZ_YZ), + XMVectorGetZ(XY_XZ_YZ), + &v1, &v2, &v3); + + // Put them in a matrix. + XMMATRIX R; + + R.r[0] = XMVectorSetW(v1, 0.f); + R.r[1] = XMVectorSetW(v2, 0.f); + R.r[2] = XMVectorSetW(v3, 0.f); + R.r[3] = g_XMIdentityR3.v; + + // Multiply by -1 to convert the matrix into a right handed coordinate + // system (Det ~= 1) in case the eigenvectors form a left handed + // coordinate system (Det ~= -1) because XMQuaternionRotationMatrix only + // works on right handed matrices. + XMVECTOR Det = XMMatrixDeterminant(R); + + if (XMVector4Less(Det, XMVectorZero())) + { + R.r[0] = XMVectorMultiply(R.r[0], g_XMNegativeOne.v); + R.r[1] = XMVectorMultiply(R.r[1], g_XMNegativeOne.v); + R.r[2] = XMVectorMultiply(R.r[2], g_XMNegativeOne.v); + } + + // Get the rotation quaternion from the matrix. + XMVECTOR vOrientation = XMQuaternionRotationMatrix(R); + + // Make sure it is normal (in case the vectors are slightly non-orthogonal). + vOrientation = XMQuaternionNormalize(vOrientation); + + // Rebuild the rotation matrix from the quaternion. + R = XMMatrixRotationQuaternion(vOrientation); + + // Build the rotation into the rotated space. + XMMATRIX InverseR = XMMatrixTranspose(R); + + // Find the minimum OBB using the eigenvectors as the axes. + XMVECTOR vMin, vMax; + + vMin = vMax = XMVector3TransformNormal(XMLoadFloat3(pPoints), InverseR); + + for (size_t i = 1; i < Count; ++i) + { + XMVECTOR Point = XMVector3TransformNormal(XMLoadFloat3(reinterpret_cast(reinterpret_cast(pPoints) + i * Stride)), + InverseR); + + vMin = XMVectorMin(vMin, Point); + vMax = XMVectorMax(vMax, Point); + } + + // Rotate the center into world space. + XMVECTOR vCenter = XMVectorScale(XMVectorAdd(vMin, vMax), 0.5f); + vCenter = XMVector3TransformNormal(vCenter, R); + + // Store center, extents, and orientation. + XMStoreFloat3(&Out.Center, vCenter); + XMStoreFloat3(&Out.Extents, XMVectorScale(XMVectorSubtract(vMax, vMin), 0.5f)); + XMStoreFloat4(&Out.Orientation, vOrientation); +} + + +/**************************************************************************** + * + * BoundingFrustum + * + ****************************************************************************/ + +_Use_decl_annotations_ +inline BoundingFrustum::BoundingFrustum(CXMMATRIX Projection, bool rhcoords) noexcept +{ + CreateFromMatrix(*this, Projection, rhcoords); +} + + +//----------------------------------------------------------------------------- +// Transform a frustum by an angle preserving transform. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingFrustum::Transform(BoundingFrustum& Out, FXMMATRIX M) const noexcept +{ + // Load the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Composite the frustum rotation and the transform rotation + XMMATRIX nM; + nM.r[0] = XMVector3Normalize(M.r[0]); + nM.r[1] = XMVector3Normalize(M.r[1]); + nM.r[2] = XMVector3Normalize(M.r[2]); + nM.r[3] = g_XMIdentityR3; + XMVECTOR Rotation = XMQuaternionRotationMatrix(nM); + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the center. + vOrigin = XMVector3Transform(vOrigin, M); + + // Store the frustum. + XMStoreFloat3(&Out.Origin, vOrigin); + XMStoreFloat4(&Out.Orientation, vOrientation); + + // Scale the near and far distances (the slopes remain the same). + XMVECTOR dX = XMVector3Dot(M.r[0], M.r[0]); + XMVECTOR dY = XMVector3Dot(M.r[1], M.r[1]); + XMVECTOR dZ = XMVector3Dot(M.r[2], M.r[2]); + + XMVECTOR d = XMVectorMax(dX, XMVectorMax(dY, dZ)); + float Scale = sqrtf(XMVectorGetX(d)); + + Out.Near = Near * Scale; + Out.Far = Far * Scale; + + // Copy the slopes. + Out.RightSlope = RightSlope; + Out.LeftSlope = LeftSlope; + Out.TopSlope = TopSlope; + Out.BottomSlope = BottomSlope; +} + +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingFrustum::Transform(BoundingFrustum& Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) const noexcept +{ + assert(DirectX::MathInternal::XMQuaternionIsUnit(Rotation)); + + // Load the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Composite the frustum rotation and the transform rotation. + vOrientation = XMQuaternionMultiply(vOrientation, Rotation); + + // Transform the origin. + vOrigin = XMVectorAdd(XMVector3Rotate(XMVectorScale(vOrigin, Scale), Rotation), Translation); + + // Store the frustum. + XMStoreFloat3(&Out.Origin, vOrigin); + XMStoreFloat4(&Out.Orientation, vOrientation); + + // Scale the near and far distances (the slopes remain the same). + Out.Near = Near * Scale; + Out.Far = Far * Scale; + + // Copy the slopes. + Out.RightSlope = RightSlope; + Out.LeftSlope = LeftSlope; + Out.TopSlope = TopSlope; + Out.BottomSlope = BottomSlope; +} + + +//----------------------------------------------------------------------------- +// Get the corner points of the frustum +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingFrustum::GetCorners(XMFLOAT3* Corners) const noexcept +{ + assert(Corners != nullptr); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + // Returns 8 corners position of bounding frustum. + // Near Far + // 0----1 4----5 + // | | | | + // | | | | + // 3----2 7----6 + + XMVECTOR vCorners[CORNER_COUNT]; + vCorners[0] = XMVectorMultiply(vLeftTop, vNear); + vCorners[1] = XMVectorMultiply(vRightTop, vNear); + vCorners[2] = XMVectorMultiply(vRightBottom, vNear); + vCorners[3] = XMVectorMultiply(vLeftBottom, vNear); + vCorners[4] = XMVectorMultiply(vLeftTop, vFar); + vCorners[5] = XMVectorMultiply(vRightTop, vFar); + vCorners[6] = XMVectorMultiply(vRightBottom, vFar); + vCorners[7] = XMVectorMultiply(vLeftBottom, vFar); + + for (size_t i = 0; i < CORNER_COUNT; ++i) + { + XMVECTOR C = XMVectorAdd(XMVector3Rotate(vCorners[i], vOrientation), vOrigin); + XMStoreFloat3(&Corners[i], C); + } +} + + +//----------------------------------------------------------------------------- +// Point in frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingFrustum::Contains(FXMVECTOR Point) const noexcept +{ + // Build frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Transform point into local space of frustum. + XMVECTOR TPoint = XMVector3InverseRotate(XMVectorSubtract(Point, vOrigin), vOrientation); + + // Set w to one. + TPoint = XMVectorInsert<0, 0, 0, 0, 1>(TPoint, XMVectorSplatOne()); + + XMVECTOR Zero = XMVectorZero(); + XMVECTOR Outside = Zero; + + // Test point against each plane of the frustum. + for (size_t i = 0; i < 6; ++i) + { + XMVECTOR Dot = XMVector4Dot(TPoint, Planes[i]); + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dot, Zero)); + } + + return XMVector4NotEqualInt(Outside, XMVectorTrueInt()) ? CONTAINS : DISJOINT; +} + + +//----------------------------------------------------------------------------- +// Triangle vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingFrustum::Contains(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return TriangleTests::ContainedBy(V0, V1, V2, NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingSphere& sh) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return sh.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingBox& box) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return box.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingOrientedBox& box) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return box.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType BoundingFrustum::Contains(const BoundingFrustum& fr) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + // Create 6 planes (do it inline to encourage use of registers) + XMVECTOR NearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + NearPlane = DirectX::MathInternal::XMPlaneTransform(NearPlane, vOrientation, vOrigin); + NearPlane = XMPlaneNormalize(NearPlane); + + XMVECTOR FarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + FarPlane = DirectX::MathInternal::XMPlaneTransform(FarPlane, vOrientation, vOrigin); + FarPlane = XMPlaneNormalize(FarPlane); + + XMVECTOR RightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + RightPlane = DirectX::MathInternal::XMPlaneTransform(RightPlane, vOrientation, vOrigin); + RightPlane = XMPlaneNormalize(RightPlane); + + XMVECTOR LeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + LeftPlane = DirectX::MathInternal::XMPlaneTransform(LeftPlane, vOrientation, vOrigin); + LeftPlane = XMPlaneNormalize(LeftPlane); + + XMVECTOR TopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + TopPlane = DirectX::MathInternal::XMPlaneTransform(TopPlane, vOrientation, vOrigin); + TopPlane = XMPlaneNormalize(TopPlane); + + XMVECTOR BottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + BottomPlane = DirectX::MathInternal::XMPlaneTransform(BottomPlane, vOrientation, vOrigin); + BottomPlane = XMPlaneNormalize(BottomPlane); + + return fr.ContainedBy(NearPlane, FarPlane, RightPlane, LeftPlane, TopPlane, BottomPlane); +} + + +//----------------------------------------------------------------------------- +// Exact sphere vs frustum test. The algorithm first checks the sphere against +// the planes of the frustum, then if the plane checks were indeterminate finds +// the nearest feature (plane, line, point) on the frustum to the center of the +// sphere and compares the distance to the nearest feature to the radius of the +// sphere +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingSphere& sh) const noexcept +{ + XMVECTOR Zero = XMVectorZero(); + + // Build the frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Normalize the planes so we can compare to the sphere radius. + Planes[2] = XMVector3Normalize(Planes[2]); + Planes[3] = XMVector3Normalize(Planes[3]); + Planes[4] = XMVector3Normalize(Planes[4]); + Planes[5] = XMVector3Normalize(Planes[5]); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Load the sphere. + XMVECTOR vCenter = XMLoadFloat3(&sh.Center); + XMVECTOR vRadius = XMVectorReplicatePtr(&sh.Radius); + + // Transform the center of the sphere into the local space of frustum. + vCenter = XMVector3InverseRotate(XMVectorSubtract(vCenter, vOrigin), vOrientation); + + // Set w of the center to one so we can dot4 with the plane. + vCenter = XMVectorInsert<0, 0, 0, 0, 1>(vCenter, XMVectorSplatOne()); + + // Check against each plane of the frustum. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + XMVECTOR CenterInsideAll = XMVectorTrueInt(); + + XMVECTOR Dist[6]; + + for (size_t i = 0; i < 6; ++i) + { + Dist[i] = XMVector4Dot(vCenter, Planes[i]); + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist[i], vRadius)); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Dist[i], XMVectorNegate(vRadius))); + + // Check if the center is inside the plane. + CenterInsideAll = XMVectorAndInt(CenterInsideAll, XMVectorLessOrEqual(Dist[i], Zero)); + } + + // If the sphere is outside any of the planes it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If the sphere is inside all planes it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // If the center of the sphere is inside all planes and the sphere intersects + // one or more planes then it must intersect. + if (XMVector4EqualInt(CenterInsideAll, XMVectorTrueInt())) + return true; + + // The sphere may be outside the frustum or intersecting the frustum. + // Find the nearest feature (face, edge, or corner) on the frustum + // to the sphere. + + // The faces adjacent to each face are: + static const size_t adjacent_faces[6][4] = + { + { 2, 3, 4, 5 }, // 0 + { 2, 3, 4, 5 }, // 1 + { 0, 1, 4, 5 }, // 2 + { 0, 1, 4, 5 }, // 3 + { 0, 1, 2, 3 }, // 4 + { 0, 1, 2, 3 } + }; // 5 + + XMVECTOR Intersects = XMVectorFalseInt(); + + // Check to see if the nearest feature is one of the planes. + for (size_t i = 0; i < 6; ++i) + { + // Find the nearest point on the plane to the center of the sphere. + XMVECTOR Point = XMVectorNegativeMultiplySubtract(Planes[i], Dist[i], vCenter); + + // Set w of the point to one. + Point = XMVectorInsert<0, 0, 0, 0, 1>(Point, XMVectorSplatOne()); + + // If the point is inside the face (inside the adjacent planes) then + // this plane is the nearest feature. + XMVECTOR InsideFace = XMVectorTrueInt(); + + for (size_t j = 0; j < 4; j++) + { + size_t plane_index = adjacent_faces[i][j]; + + InsideFace = XMVectorAndInt(InsideFace, + XMVectorLessOrEqual(XMVector4Dot(Point, Planes[plane_index]), Zero)); + } + + // Since we have already checked distance from the plane we know that the + // sphere must intersect if this plane is the nearest feature. + Intersects = XMVectorOrInt(Intersects, + XMVectorAndInt(XMVectorGreater(Dist[i], Zero), InsideFace)); + } + + if (XMVector4EqualInt(Intersects, XMVectorTrueInt())) + return true; + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + XMVECTOR Corners[CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + // The Edges are: + static const size_t edges[12][2] = + { + { 0, 1 }, { 2, 3 }, { 0, 2 }, { 1, 3 }, // Near plane + { 4, 5 }, { 6, 7 }, { 4, 6 }, { 5, 7 }, // Far plane + { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }, + }; // Near to far + + XMVECTOR RadiusSq = XMVectorMultiply(vRadius, vRadius); + + // Check to see if the nearest feature is one of the edges (or corners). + for (size_t i = 0; i < 12; ++i) + { + size_t ei0 = edges[i][0]; + size_t ei1 = edges[i][1]; + + // Find the nearest point on the edge to the center of the sphere. + // The corners of the frustum are included as the endpoints of the edges. + XMVECTOR Point = DirectX::MathInternal::PointOnLineSegmentNearestPoint(Corners[ei0], Corners[ei1], vCenter); + + XMVECTOR Delta = XMVectorSubtract(vCenter, Point); + + XMVECTOR DistSq = XMVector3Dot(Delta, Delta); + + // If the distance to the center of the sphere to the point is less than + // the radius of the sphere then it must intersect. + Intersects = XMVectorOrInt(Intersects, XMVectorLessOrEqual(DistSq, RadiusSq)); + } + + if (XMVector4EqualInt(Intersects, XMVectorTrueInt())) + return true; + + // The sphere must be outside the frustum. + return false; +} + + +//----------------------------------------------------------------------------- +// Exact axis aligned box vs frustum test. Constructs an oriented box and uses +// the oriented box vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingBox& box) const noexcept +{ + // Make the axis aligned box oriented and do an OBB vs frustum test. + BoundingOrientedBox obox(box.Center, box.Extents, XMFLOAT4(0.f, 0.f, 0.f, 1.f)); + return Intersects(obox); +} + + +//----------------------------------------------------------------------------- +// Exact oriented box vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingOrientedBox& box) const noexcept +{ + static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + + XMVECTOR Zero = XMVectorZero(); + + // Build the frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR FrustumOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(FrustumOrientation)); + + // Load the box. + XMVECTOR Center = XMLoadFloat3(&box.Center); + XMVECTOR Extents = XMLoadFloat3(&box.Extents); + XMVECTOR BoxOrientation = XMLoadFloat4(&box.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(BoxOrientation)); + + // Transform the oriented box into the space of the frustum in order to + // minimize the number of transforms we have to do. + Center = XMVector3InverseRotate(XMVectorSubtract(Center, vOrigin), FrustumOrientation); + BoxOrientation = XMQuaternionMultiply(BoxOrientation, XMQuaternionConjugate(FrustumOrientation)); + + // Set w of the center to one so we can dot4 with the plane. + Center = XMVectorInsert<0, 0, 0, 0, 1>(Center, XMVectorSplatOne()); + + // Build the 3x3 rotation matrix that defines the box axes. + XMMATRIX R = XMMatrixRotationQuaternion(BoxOrientation); + + // Check against each plane of the frustum. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + XMVECTOR CenterInsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < 6; ++i) + { + // Compute the distance to the center of the box. + XMVECTOR Dist = XMVector4Dot(Center, Planes[i]); + + // Project the axes of the box onto the normal of the plane. Half the + // length of the projection (sometime called the "radius") is equal to + // h(u) * abs(n dot b(u))) + h(v) * abs(n dot b(v)) + h(w) * abs(n dot b(w)) + // where h(i) are extents of the box, n is the plane normal, and b(i) are the + // axes of the box. + XMVECTOR Radius = XMVector3Dot(Planes[i], R.r[0]); + Radius = XMVectorSelect(Radius, XMVector3Dot(Planes[i], R.r[1]), SelectY); + Radius = XMVectorSelect(Radius, XMVector3Dot(Planes[i], R.r[2]), SelectZ); + Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist, Radius)); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Dist, XMVectorNegate(Radius))); + + // Check if the center is inside the plane. + CenterInsideAll = XMVectorAndInt(CenterInsideAll, XMVectorLessOrEqual(Dist, Zero)); + } + + // If the box is outside any of the planes it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If the box is inside all planes it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // If the center of the box is inside all planes and the box intersects + // one or more planes then it must intersect. + if (XMVector4EqualInt(CenterInsideAll, XMVectorTrueInt())) + return true; + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + XMVECTOR Corners[CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + // Test against box axes (3) + { + // Find the min/max values of the projection of the frustum onto each axis. + XMVECTOR FrustumMin, FrustumMax; + + FrustumMin = XMVector3Dot(Corners[0], R.r[0]); + FrustumMin = XMVectorSelect(FrustumMin, XMVector3Dot(Corners[0], R.r[1]), SelectY); + FrustumMin = XMVectorSelect(FrustumMin, XMVector3Dot(Corners[0], R.r[2]), SelectZ); + FrustumMax = FrustumMin; + + for (size_t i = 1; i < BoundingOrientedBox::CORNER_COUNT; ++i) + { + XMVECTOR Temp = XMVector3Dot(Corners[i], R.r[0]); + Temp = XMVectorSelect(Temp, XMVector3Dot(Corners[i], R.r[1]), SelectY); + Temp = XMVectorSelect(Temp, XMVector3Dot(Corners[i], R.r[2]), SelectZ); + + FrustumMin = XMVectorMin(FrustumMin, Temp); + FrustumMax = XMVectorMax(FrustumMax, Temp); + } + + // Project the center of the box onto the axes. + XMVECTOR BoxDist = XMVector3Dot(Center, R.r[0]); + BoxDist = XMVectorSelect(BoxDist, XMVector3Dot(Center, R.r[1]), SelectY); + BoxDist = XMVectorSelect(BoxDist, XMVector3Dot(Center, R.r[2]), SelectZ); + + // The projection of the box onto the axis is just its Center and Extents. + // if (min > box_max || max < box_min) reject; + XMVECTOR Result = XMVectorOrInt(XMVectorGreater(FrustumMin, XMVectorAdd(BoxDist, Extents)), + XMVectorLess(FrustumMax, XMVectorSubtract(BoxDist, Extents))); + + if (DirectX::MathInternal::XMVector3AnyTrue(Result)) + return false; + } + + // Test against edge/edge axes (3*6). + XMVECTOR FrustumEdgeAxis[6]; + + FrustumEdgeAxis[0] = vRightTop; + FrustumEdgeAxis[1] = vRightBottom; + FrustumEdgeAxis[2] = vLeftTop; + FrustumEdgeAxis[3] = vLeftBottom; + FrustumEdgeAxis[4] = XMVectorSubtract(vRightTop, vLeftTop); + FrustumEdgeAxis[5] = XMVectorSubtract(vLeftBottom, vLeftTop); + + for (size_t i = 0; i < 3; ++i) + { + for (size_t j = 0; j < 6; j++) + { + // Compute the axis we are going to test. + XMVECTOR Axis = XMVector3Cross(R.r[i], FrustumEdgeAxis[j]); + + // Find the min/max values of the projection of the frustum onto the axis. + XMVECTOR FrustumMin, FrustumMax; + + FrustumMin = FrustumMax = XMVector3Dot(Axis, Corners[0]); + + for (size_t k = 1; k < CORNER_COUNT; k++) + { + XMVECTOR Temp = XMVector3Dot(Axis, Corners[k]); + FrustumMin = XMVectorMin(FrustumMin, Temp); + FrustumMax = XMVectorMax(FrustumMax, Temp); + } + + // Project the center of the box onto the axis. + XMVECTOR Dist = XMVector3Dot(Center, Axis); + + // Project the axes of the box onto the axis to find the "radius" of the box. + XMVECTOR Radius = XMVector3Dot(Axis, R.r[0]); + Radius = XMVectorSelect(Radius, XMVector3Dot(Axis, R.r[1]), SelectY); + Radius = XMVectorSelect(Radius, XMVector3Dot(Axis, R.r[2]), SelectZ); + Radius = XMVector3Dot(Extents, XMVectorAbs(Radius)); + + // if (center > max + radius || center < min - radius) reject; + Outside = XMVectorOrInt(Outside, XMVectorGreater(Dist, XMVectorAdd(FrustumMax, Radius))); + Outside = XMVectorOrInt(Outside, XMVectorLess(Dist, XMVectorSubtract(FrustumMin, Radius))); + } + } + + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If we did not find a separating plane then the box must intersect the frustum. + return true; +} + + +//----------------------------------------------------------------------------- +// Exact frustum vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool BoundingFrustum::Intersects(const BoundingFrustum& fr) const noexcept +{ + // Load origin and orientation of frustum B. + XMVECTOR OriginB = XMLoadFloat3(&Origin); + XMVECTOR OrientationB = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(OrientationB)); + + // Build the planes of frustum B. + XMVECTOR AxisB[6]; + AxisB[0] = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f); + AxisB[1] = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); + AxisB[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + AxisB[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + AxisB[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + AxisB[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + XMVECTOR PlaneDistB[6]; + PlaneDistB[0] = XMVectorNegate(XMVectorReplicatePtr(&Near)); + PlaneDistB[1] = XMVectorReplicatePtr(&Far); + PlaneDistB[2] = XMVectorZero(); + PlaneDistB[3] = XMVectorZero(); + PlaneDistB[4] = XMVectorZero(); + PlaneDistB[5] = XMVectorZero(); + + // Load origin and orientation of frustum A. + XMVECTOR OriginA = XMLoadFloat3(&fr.Origin); + XMVECTOR OrientationA = XMLoadFloat4(&fr.Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(OrientationA)); + + // Transform frustum A into the space of the frustum B in order to + // minimize the number of transforms we have to do. + OriginA = XMVector3InverseRotate(XMVectorSubtract(OriginA, OriginB), OrientationB); + OrientationA = XMQuaternionMultiply(OrientationA, XMQuaternionConjugate(OrientationB)); + + // Build the corners of frustum A (in the local space of B). + XMVECTOR RightTopA = XMVectorSet(fr.RightSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottomA = XMVectorSet(fr.RightSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTopA = XMVectorSet(fr.LeftSlope, fr.TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottomA = XMVectorSet(fr.LeftSlope, fr.BottomSlope, 1.0f, 0.0f); + XMVECTOR NearA = XMVectorReplicatePtr(&fr.Near); + XMVECTOR FarA = XMVectorReplicatePtr(&fr.Far); + + RightTopA = XMVector3Rotate(RightTopA, OrientationA); + RightBottomA = XMVector3Rotate(RightBottomA, OrientationA); + LeftTopA = XMVector3Rotate(LeftTopA, OrientationA); + LeftBottomA = XMVector3Rotate(LeftBottomA, OrientationA); + + XMVECTOR CornersA[CORNER_COUNT]; + CornersA[0] = XMVectorMultiplyAdd(RightTopA, NearA, OriginA); + CornersA[1] = XMVectorMultiplyAdd(RightBottomA, NearA, OriginA); + CornersA[2] = XMVectorMultiplyAdd(LeftTopA, NearA, OriginA); + CornersA[3] = XMVectorMultiplyAdd(LeftBottomA, NearA, OriginA); + CornersA[4] = XMVectorMultiplyAdd(RightTopA, FarA, OriginA); + CornersA[5] = XMVectorMultiplyAdd(RightBottomA, FarA, OriginA); + CornersA[6] = XMVectorMultiplyAdd(LeftTopA, FarA, OriginA); + CornersA[7] = XMVectorMultiplyAdd(LeftBottomA, FarA, OriginA); + + // Check frustum A against each plane of frustum B. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < 6; ++i) + { + // Find the min/max projection of the frustum onto the plane normal. + XMVECTOR Min, Max; + + Min = Max = XMVector3Dot(AxisB[i], CornersA[0]); + + for (size_t j = 1; j < CORNER_COUNT; j++) + { + XMVECTOR Temp = XMVector3Dot(AxisB[i], CornersA[j]); + Min = XMVectorMin(Min, Temp); + Max = XMVectorMax(Max, Temp); + } + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Min, PlaneDistB[i])); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(Max, PlaneDistB[i])); + } + + // If the frustum A is outside any of the planes of frustum B it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If frustum A is inside all planes of frustum B it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // Build the corners of frustum B. + XMVECTOR RightTopB = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottomB = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTopB = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottomB = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR NearB = XMVectorReplicatePtr(&Near); + XMVECTOR FarB = XMVectorReplicatePtr(&Far); + + XMVECTOR CornersB[BoundingFrustum::CORNER_COUNT]; + CornersB[0] = XMVectorMultiply(RightTopB, NearB); + CornersB[1] = XMVectorMultiply(RightBottomB, NearB); + CornersB[2] = XMVectorMultiply(LeftTopB, NearB); + CornersB[3] = XMVectorMultiply(LeftBottomB, NearB); + CornersB[4] = XMVectorMultiply(RightTopB, FarB); + CornersB[5] = XMVectorMultiply(RightBottomB, FarB); + CornersB[6] = XMVectorMultiply(LeftTopB, FarB); + CornersB[7] = XMVectorMultiply(LeftBottomB, FarB); + + // Build the planes of frustum A (in the local space of B). + XMVECTOR AxisA[6]; + XMVECTOR PlaneDistA[6]; + + AxisA[0] = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f); + AxisA[1] = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); + AxisA[2] = XMVectorSet(1.0f, 0.0f, -fr.RightSlope, 0.0f); + AxisA[3] = XMVectorSet(-1.0f, 0.0f, fr.LeftSlope, 0.0f); + AxisA[4] = XMVectorSet(0.0f, 1.0f, -fr.TopSlope, 0.0f); + AxisA[5] = XMVectorSet(0.0f, -1.0f, fr.BottomSlope, 0.0f); + + AxisA[0] = XMVector3Rotate(AxisA[0], OrientationA); + AxisA[1] = XMVectorNegate(AxisA[0]); + AxisA[2] = XMVector3Rotate(AxisA[2], OrientationA); + AxisA[3] = XMVector3Rotate(AxisA[3], OrientationA); + AxisA[4] = XMVector3Rotate(AxisA[4], OrientationA); + AxisA[5] = XMVector3Rotate(AxisA[5], OrientationA); + + PlaneDistA[0] = XMVector3Dot(AxisA[0], CornersA[0]); // Re-use corner on near plane. + PlaneDistA[1] = XMVector3Dot(AxisA[1], CornersA[4]); // Re-use corner on far plane. + PlaneDistA[2] = XMVector3Dot(AxisA[2], OriginA); + PlaneDistA[3] = XMVector3Dot(AxisA[3], OriginA); + PlaneDistA[4] = XMVector3Dot(AxisA[4], OriginA); + PlaneDistA[5] = XMVector3Dot(AxisA[5], OriginA); + + // Check each axis of frustum A for a seperating plane (5). + for (size_t i = 0; i < 6; ++i) + { + // Find the minimum projection of the frustum onto the plane normal. + XMVECTOR Min; + + Min = XMVector3Dot(AxisA[i], CornersB[0]); + + for (size_t j = 1; j < CORNER_COUNT; j++) + { + XMVECTOR Temp = XMVector3Dot(AxisA[i], CornersB[j]); + Min = XMVectorMin(Min, Temp); + } + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(Min, PlaneDistA[i])); + } + + // If the frustum B is outside any of the planes of frustum A it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // Check edge/edge axes (6 * 6). + XMVECTOR FrustumEdgeAxisA[6]; + FrustumEdgeAxisA[0] = RightTopA; + FrustumEdgeAxisA[1] = RightBottomA; + FrustumEdgeAxisA[2] = LeftTopA; + FrustumEdgeAxisA[3] = LeftBottomA; + FrustumEdgeAxisA[4] = XMVectorSubtract(RightTopA, LeftTopA); + FrustumEdgeAxisA[5] = XMVectorSubtract(LeftBottomA, LeftTopA); + + XMVECTOR FrustumEdgeAxisB[6]; + FrustumEdgeAxisB[0] = RightTopB; + FrustumEdgeAxisB[1] = RightBottomB; + FrustumEdgeAxisB[2] = LeftTopB; + FrustumEdgeAxisB[3] = LeftBottomB; + FrustumEdgeAxisB[4] = XMVectorSubtract(RightTopB, LeftTopB); + FrustumEdgeAxisB[5] = XMVectorSubtract(LeftBottomB, LeftTopB); + + for (size_t i = 0; i < 6; ++i) + { + for (size_t j = 0; j < 6; j++) + { + // Compute the axis we are going to test. + XMVECTOR Axis = XMVector3Cross(FrustumEdgeAxisA[i], FrustumEdgeAxisB[j]); + + // Find the min/max values of the projection of both frustums onto the axis. + XMVECTOR MinA, MaxA; + XMVECTOR MinB, MaxB; + + MinA = MaxA = XMVector3Dot(Axis, CornersA[0]); + MinB = MaxB = XMVector3Dot(Axis, CornersB[0]); + + for (size_t k = 1; k < CORNER_COUNT; k++) + { + XMVECTOR TempA = XMVector3Dot(Axis, CornersA[k]); + MinA = XMVectorMin(MinA, TempA); + MaxA = XMVectorMax(MaxA, TempA); + + XMVECTOR TempB = XMVector3Dot(Axis, CornersB[k]); + MinB = XMVectorMin(MinB, TempB); + MaxB = XMVectorMax(MaxB, TempB); + } + + // if (MinA > MaxB || MinB > MaxA) reject + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinA, MaxB)); + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinB, MaxA)); + } + } + + // If there is a seperating plane, then the frustums do not intersect. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If we did not find a separating plane then the frustums intersect. + return true; +} + + +//----------------------------------------------------------------------------- +// Triangle vs frustum test. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) const noexcept +{ + // Build the frustum planes (NOTE: D is negated from the usual). + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, -Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Transform triangle into the local space of frustum. + XMVECTOR TV0 = XMVector3InverseRotate(XMVectorSubtract(V0, vOrigin), vOrientation); + XMVECTOR TV1 = XMVector3InverseRotate(XMVectorSubtract(V1, vOrigin), vOrientation); + XMVECTOR TV2 = XMVector3InverseRotate(XMVectorSubtract(V2, vOrigin), vOrientation); + + // Test each vertex of the triangle against the frustum planes. + XMVECTOR Outside = XMVectorFalseInt(); + XMVECTOR InsideAll = XMVectorTrueInt(); + + for (size_t i = 0; i < 6; ++i) + { + XMVECTOR Dist0 = XMVector3Dot(TV0, Planes[i]); + XMVECTOR Dist1 = XMVector3Dot(TV1, Planes[i]); + XMVECTOR Dist2 = XMVector3Dot(TV2, Planes[i]); + + XMVECTOR MinDist = XMVectorMin(Dist0, Dist1); + MinDist = XMVectorMin(MinDist, Dist2); + XMVECTOR MaxDist = XMVectorMax(Dist0, Dist1); + MaxDist = XMVectorMax(MaxDist, Dist2); + + XMVECTOR PlaneDist = XMVectorSplatW(Planes[i]); + + // Outside the plane? + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinDist, PlaneDist)); + + // Fully inside the plane? + InsideAll = XMVectorAndInt(InsideAll, XMVectorLessOrEqual(MaxDist, PlaneDist)); + } + + // If the triangle is outside any of the planes it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If the triangle is inside all planes it is fully inside. + if (XMVector4EqualInt(InsideAll, XMVectorTrueInt())) + return true; + + // Build the corners of the frustum. + XMVECTOR vRightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vRightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vLeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR vLeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + XMVECTOR Corners[CORNER_COUNT]; + Corners[0] = XMVectorMultiply(vRightTop, vNear); + Corners[1] = XMVectorMultiply(vRightBottom, vNear); + Corners[2] = XMVectorMultiply(vLeftTop, vNear); + Corners[3] = XMVectorMultiply(vLeftBottom, vNear); + Corners[4] = XMVectorMultiply(vRightTop, vFar); + Corners[5] = XMVectorMultiply(vRightBottom, vFar); + Corners[6] = XMVectorMultiply(vLeftTop, vFar); + Corners[7] = XMVectorMultiply(vLeftBottom, vFar); + + // Test the plane of the triangle. + XMVECTOR Normal = XMVector3Cross(XMVectorSubtract(V1, V0), XMVectorSubtract(V2, V0)); + XMVECTOR Dist = XMVector3Dot(Normal, V0); + + XMVECTOR MinDist, MaxDist; + MinDist = MaxDist = XMVector3Dot(Corners[0], Normal); + for (size_t i = 1; i < CORNER_COUNT; ++i) + { + XMVECTOR Temp = XMVector3Dot(Corners[i], Normal); + MinDist = XMVectorMin(MinDist, Temp); + MaxDist = XMVectorMax(MaxDist, Temp); + } + + Outside = XMVectorOrInt(XMVectorGreater(MinDist, Dist), XMVectorLess(MaxDist, Dist)); + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // Check the edge/edge axes (3*6). + XMVECTOR TriangleEdgeAxis[3]; + TriangleEdgeAxis[0] = XMVectorSubtract(V1, V0); + TriangleEdgeAxis[1] = XMVectorSubtract(V2, V1); + TriangleEdgeAxis[2] = XMVectorSubtract(V0, V2); + + XMVECTOR FrustumEdgeAxis[6]; + FrustumEdgeAxis[0] = vRightTop; + FrustumEdgeAxis[1] = vRightBottom; + FrustumEdgeAxis[2] = vLeftTop; + FrustumEdgeAxis[3] = vLeftBottom; + FrustumEdgeAxis[4] = XMVectorSubtract(vRightTop, vLeftTop); + FrustumEdgeAxis[5] = XMVectorSubtract(vLeftBottom, vLeftTop); + + for (size_t i = 0; i < 3; ++i) + { + for (size_t j = 0; j < 6; j++) + { + // Compute the axis we are going to test. + XMVECTOR Axis = XMVector3Cross(TriangleEdgeAxis[i], FrustumEdgeAxis[j]); + + // Find the min/max of the projection of the triangle onto the axis. + XMVECTOR MinA, MaxA; + + XMVECTOR Dist0 = XMVector3Dot(V0, Axis); + XMVECTOR Dist1 = XMVector3Dot(V1, Axis); + XMVECTOR Dist2 = XMVector3Dot(V2, Axis); + + MinA = XMVectorMin(Dist0, Dist1); + MinA = XMVectorMin(MinA, Dist2); + MaxA = XMVectorMax(Dist0, Dist1); + MaxA = XMVectorMax(MaxA, Dist2); + + // Find the min/max of the projection of the frustum onto the axis. + XMVECTOR MinB, MaxB; + + MinB = MaxB = XMVector3Dot(Axis, Corners[0]); + + for (size_t k = 1; k < CORNER_COUNT; k++) + { + XMVECTOR Temp = XMVector3Dot(Axis, Corners[k]); + MinB = XMVectorMin(MinB, Temp); + MaxB = XMVectorMax(MaxB, Temp); + } + + // if (MinA > MaxB || MinB > MaxA) reject; + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinA, MaxB)); + Outside = XMVectorOrInt(Outside, XMVectorGreater(MinB, MaxA)); + } + } + + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return false; + + // If we did not find a separating plane then the triangle must intersect the frustum. + return true; +} + + +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline PlaneIntersectionType XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR Plane) const noexcept +{ + assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); + + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Set w of the origin to one so we can dot4 with a plane. + vOrigin = XMVectorInsert<0, 0, 0, 0, 1>(vOrigin, XMVectorSplatOne()); + + // Build the corners of the frustum (in world space). + XMVECTOR RightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + RightTop = XMVector3Rotate(RightTop, vOrientation); + RightBottom = XMVector3Rotate(RightBottom, vOrientation); + LeftTop = XMVector3Rotate(LeftTop, vOrientation); + LeftBottom = XMVector3Rotate(LeftBottom, vOrientation); + + XMVECTOR Corners0 = XMVectorMultiplyAdd(RightTop, vNear, vOrigin); + XMVECTOR Corners1 = XMVectorMultiplyAdd(RightBottom, vNear, vOrigin); + XMVECTOR Corners2 = XMVectorMultiplyAdd(LeftTop, vNear, vOrigin); + XMVECTOR Corners3 = XMVectorMultiplyAdd(LeftBottom, vNear, vOrigin); + XMVECTOR Corners4 = XMVectorMultiplyAdd(RightTop, vFar, vOrigin); + XMVECTOR Corners5 = XMVectorMultiplyAdd(RightBottom, vFar, vOrigin); + XMVECTOR Corners6 = XMVectorMultiplyAdd(LeftTop, vFar, vOrigin); + XMVECTOR Corners7 = XMVectorMultiplyAdd(LeftBottom, vFar, vOrigin); + + XMVECTOR Outside, Inside; + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane, Outside, Inside); + + // If the frustum is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the frustum is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The frustum is not inside all planes or outside a plane it intersects. + return INTERSECTING; +} + + +//----------------------------------------------------------------------------- +// Ray vs. frustum test +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline bool XM_CALLCONV BoundingFrustum::Intersects(FXMVECTOR rayOrigin, FXMVECTOR Direction, float& Dist) const noexcept +{ + // If ray starts inside the frustum, return a distance of 0 for the hit + if (Contains(rayOrigin) == CONTAINS) + { + Dist = 0.0f; + return true; + } + + // Build the frustum planes. + XMVECTOR Planes[6]; + Planes[0] = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + Planes[1] = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + Planes[2] = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + Planes[3] = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + Planes[4] = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + Planes[5] = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + + // Load origin and orientation of the frustum. + XMVECTOR frOrigin = XMLoadFloat3(&Origin); + XMVECTOR frOrientation = XMLoadFloat4(&Orientation); + + // This algorithm based on "Fast Ray-Convex Polyhedron Intersectin," in James Arvo, ed., Graphics Gems II pp. 247-250 + float tnear = -FLT_MAX; + float tfar = FLT_MAX; + + for (size_t i = 0; i < 6; ++i) + { + XMVECTOR Plane = DirectX::MathInternal::XMPlaneTransform(Planes[i], frOrientation, frOrigin); + Plane = XMPlaneNormalize(Plane); + + XMVECTOR AxisDotOrigin = XMPlaneDotCoord(Plane, rayOrigin); + XMVECTOR AxisDotDirection = XMVector3Dot(Plane, Direction); + + if (XMVector3LessOrEqual(XMVectorAbs(AxisDotDirection), g_RayEpsilon)) + { + // Ray is parallel to plane - check if ray origin is inside plane's + if (XMVector3Greater(AxisDotOrigin, g_XMZero)) + { + // Ray origin is outside half-space. + Dist = 0.f; + return false; + } + } + else + { + // Ray not parallel - get distance to plane. + float vd = XMVectorGetX(AxisDotDirection); + float vn = XMVectorGetX(AxisDotOrigin); + float t = -vn / vd; + if (vd < 0.0f) + { + // Front face - T is a near point. + if (t > tfar) + { + Dist = 0.f; + return false; + } + if (t > tnear) + { + // Hit near face. + tnear = t; + } + } + else + { + // back face - T is far point. + if (t < tnear) + { + Dist = 0.f; + return false; + } + if (t < tfar) + { + // Hit far face. + tfar = t; + } + } + } + } + + // Survived all tests. + // Note: if ray originates on polyhedron, may want to change 0.0f to some + // epsilon to avoid intersecting the originating face. + float distance = (tnear >= 0.0f) ? tnear : tfar; + if (distance >= 0.0f) + { + Dist = distance; + return true; + } + + Dist = 0.f; + return false; +} + + +//----------------------------------------------------------------------------- +// Test a frustum vs 6 planes (typically forming another frustum). +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline ContainmentType XM_CALLCONV BoundingFrustum::ContainedBy( + FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, + GXMVECTOR Plane3, + HXMVECTOR Plane4, HXMVECTOR Plane5) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + assert(DirectX::MathInternal::XMQuaternionIsUnit(vOrientation)); + + // Set w of the origin to one so we can dot4 with a plane. + vOrigin = XMVectorInsert<0, 0, 0, 0, 1>(vOrigin, XMVectorSplatOne()); + + // Build the corners of the frustum (in world space). + XMVECTOR RightTop = XMVectorSet(RightSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR RightBottom = XMVectorSet(RightSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR LeftTop = XMVectorSet(LeftSlope, TopSlope, 1.0f, 0.0f); + XMVECTOR LeftBottom = XMVectorSet(LeftSlope, BottomSlope, 1.0f, 0.0f); + XMVECTOR vNear = XMVectorReplicatePtr(&Near); + XMVECTOR vFar = XMVectorReplicatePtr(&Far); + + RightTop = XMVector3Rotate(RightTop, vOrientation); + RightBottom = XMVector3Rotate(RightBottom, vOrientation); + LeftTop = XMVector3Rotate(LeftTop, vOrientation); + LeftBottom = XMVector3Rotate(LeftBottom, vOrientation); + + XMVECTOR Corners0 = XMVectorMultiplyAdd(RightTop, vNear, vOrigin); + XMVECTOR Corners1 = XMVectorMultiplyAdd(RightBottom, vNear, vOrigin); + XMVECTOR Corners2 = XMVectorMultiplyAdd(LeftTop, vNear, vOrigin); + XMVECTOR Corners3 = XMVectorMultiplyAdd(LeftBottom, vNear, vOrigin); + XMVECTOR Corners4 = XMVectorMultiplyAdd(RightTop, vFar, vOrigin); + XMVECTOR Corners5 = XMVectorMultiplyAdd(RightBottom, vFar, vOrigin); + XMVECTOR Corners6 = XMVectorMultiplyAdd(LeftTop, vFar, vOrigin); + XMVECTOR Corners7 = XMVectorMultiplyAdd(LeftBottom, vFar, vOrigin); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane1, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane2, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane3, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane4, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectFrustumPlane(Corners0, Corners1, Corners2, Corners3, + Corners4, Corners5, Corners6, Corners7, + Plane5, Outside, Inside); + + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the frustum is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the frustum is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The frustum is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; +} + + +//----------------------------------------------------------------------------- +// Build the 6 frustum planes from a frustum. +// +// The intended use for these routines is for fast culling to a view frustum. +// When the volume being tested against a view frustum is small relative to the +// view frustum it is usually either inside all six planes of the frustum +// (CONTAINS) or outside one of the planes of the frustum (DISJOINT). If neither +// of these cases is true then it may or may not be intersecting the frustum +// (INTERSECTS) +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void BoundingFrustum::GetPlanes(XMVECTOR* NearPlane, XMVECTOR* FarPlane, XMVECTOR* RightPlane, + XMVECTOR* LeftPlane, XMVECTOR* TopPlane, XMVECTOR* BottomPlane) const noexcept +{ + // Load origin and orientation of the frustum. + XMVECTOR vOrigin = XMLoadFloat3(&Origin); + XMVECTOR vOrientation = XMLoadFloat4(&Orientation); + + if (NearPlane) + { + XMVECTOR vNearPlane = XMVectorSet(0.0f, 0.0f, -1.0f, Near); + vNearPlane = DirectX::MathInternal::XMPlaneTransform(vNearPlane, vOrientation, vOrigin); + *NearPlane = XMPlaneNormalize(vNearPlane); + } + + if (FarPlane) + { + XMVECTOR vFarPlane = XMVectorSet(0.0f, 0.0f, 1.0f, -Far); + vFarPlane = DirectX::MathInternal::XMPlaneTransform(vFarPlane, vOrientation, vOrigin); + *FarPlane = XMPlaneNormalize(vFarPlane); + } + + if (RightPlane) + { + XMVECTOR vRightPlane = XMVectorSet(1.0f, 0.0f, -RightSlope, 0.0f); + vRightPlane = DirectX::MathInternal::XMPlaneTransform(vRightPlane, vOrientation, vOrigin); + *RightPlane = XMPlaneNormalize(vRightPlane); + } + + if (LeftPlane) + { + XMVECTOR vLeftPlane = XMVectorSet(-1.0f, 0.0f, LeftSlope, 0.0f); + vLeftPlane = DirectX::MathInternal::XMPlaneTransform(vLeftPlane, vOrientation, vOrigin); + *LeftPlane = XMPlaneNormalize(vLeftPlane); + } + + if (TopPlane) + { + XMVECTOR vTopPlane = XMVectorSet(0.0f, 1.0f, -TopSlope, 0.0f); + vTopPlane = DirectX::MathInternal::XMPlaneTransform(vTopPlane, vOrientation, vOrigin); + *TopPlane = XMPlaneNormalize(vTopPlane); + } + + if (BottomPlane) + { + XMVECTOR vBottomPlane = XMVectorSet(0.0f, -1.0f, BottomSlope, 0.0f); + vBottomPlane = DirectX::MathInternal::XMPlaneTransform(vBottomPlane, vOrientation, vOrigin); + *BottomPlane = XMPlaneNormalize(vBottomPlane); + } +} + + +//----------------------------------------------------------------------------- +// Build a frustum from a persepective projection matrix. The matrix may only +// contain a projection; any rotation, translation or scale will cause the +// constructed frustum to be incorrect. +//----------------------------------------------------------------------------- +_Use_decl_annotations_ +inline void XM_CALLCONV BoundingFrustum::CreateFromMatrix(BoundingFrustum& Out, FXMMATRIX Projection, bool rhcoords) noexcept +{ + // Corners of the projection frustum in NDC space. + static XMVECTORF32 NDCPoints[6] = + { + { { { 1.0f, 0.0f, 1.0f, 1.0f } } }, // right (at far plane) + { { { -1.0f, 0.0f, 1.0f, 1.0f } } }, // left + { { { 0.0f, 1.0f, 1.0f, 1.0f } } }, // top + { { { 0.0f, -1.0f, 1.0f, 1.0f } } }, // bottom + + { { { 0.0f, 0.0f, 0.0f, 1.0f } } }, // near + { { { 0.0f, 0.0f, 1.0f, 1.0f } } } // far + }; + + XMVECTOR Determinant; + XMMATRIX matInverse = XMMatrixInverse(&Determinant, Projection); + + // Compute the frustum corners in world space. + XMVECTOR Points[6]; + + for (size_t i = 0; i < 6; ++i) + { + // Transform point. + Points[i] = XMVector4Transform(NDCPoints[i], matInverse); + } + + Out.Origin = XMFLOAT3(0.0f, 0.0f, 0.0f); + Out.Orientation = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); + + // Compute the slopes. + Points[0] = XMVectorMultiply(Points[0], XMVectorReciprocal(XMVectorSplatZ(Points[0]))); + Points[1] = XMVectorMultiply(Points[1], XMVectorReciprocal(XMVectorSplatZ(Points[1]))); + Points[2] = XMVectorMultiply(Points[2], XMVectorReciprocal(XMVectorSplatZ(Points[2]))); + Points[3] = XMVectorMultiply(Points[3], XMVectorReciprocal(XMVectorSplatZ(Points[3]))); + + Out.RightSlope = XMVectorGetX(Points[0]); + Out.LeftSlope = XMVectorGetX(Points[1]); + Out.TopSlope = XMVectorGetY(Points[2]); + Out.BottomSlope = XMVectorGetY(Points[3]); + + // Compute near and far. + Points[4] = XMVectorMultiply(Points[4], XMVectorReciprocal(XMVectorSplatW(Points[4]))); + Points[5] = XMVectorMultiply(Points[5], XMVectorReciprocal(XMVectorSplatW(Points[5]))); + + if (rhcoords) + { + Out.Near = XMVectorGetZ(Points[5]); + Out.Far = XMVectorGetZ(Points[4]); + } + else + { + Out.Near = XMVectorGetZ(Points[4]); + Out.Far = XMVectorGetZ(Points[5]); + } +} + + +/**************************************************************************** + * + * TriangleTests + * + ****************************************************************************/ + +namespace TriangleTests +{ + + //----------------------------------------------------------------------------- + // Compute the intersection of a ray (Origin, Direction) with a triangle + // (V0, V1, V2). Return true if there is an intersection and also set *pDist + // to the distance along the ray to the intersection. + // + // The algorithm is based on Moller, Tomas and Trumbore, "Fast, Minimum Storage + // Ray-Triangle Intersection", Journal of Graphics Tools, vol. 2, no. 1, + // pp 21-28, 1997. + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline bool XM_CALLCONV Intersects( + FXMVECTOR Origin, FXMVECTOR Direction, FXMVECTOR V0, + GXMVECTOR V1, + HXMVECTOR V2, float& Dist) noexcept + { + assert(DirectX::MathInternal::XMVector3IsUnit(Direction)); + + XMVECTOR Zero = XMVectorZero(); + + XMVECTOR e1 = XMVectorSubtract(V1, V0); + XMVECTOR e2 = XMVectorSubtract(V2, V0); + + // p = Direction ^ e2; + XMVECTOR p = XMVector3Cross(Direction, e2); + + // det = e1 * p; + XMVECTOR det = XMVector3Dot(e1, p); + + XMVECTOR u, v, t; + + if (XMVector3GreaterOrEqual(det, g_RayEpsilon)) + { + // Determinate is positive (front side of the triangle). + XMVECTOR s = XMVectorSubtract(Origin, V0); + + // u = s * p; + u = XMVector3Dot(s, p); + + XMVECTOR NoIntersection = XMVectorLess(u, Zero); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(u, det)); + + // q = s ^ e1; + XMVECTOR q = XMVector3Cross(s, e1); + + // v = Direction * q; + v = XMVector3Dot(Direction, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(v, Zero)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(XMVectorAdd(u, v), det)); + + // t = e2 * q; + t = XMVector3Dot(e2, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(t, Zero)); + + if (XMVector4EqualInt(NoIntersection, XMVectorTrueInt())) + { + Dist = 0.f; + return false; + } + } + else if (XMVector3LessOrEqual(det, g_RayNegEpsilon)) + { + // Determinate is negative (back side of the triangle). + XMVECTOR s = XMVectorSubtract(Origin, V0); + + // u = s * p; + u = XMVector3Dot(s, p); + + XMVECTOR NoIntersection = XMVectorGreater(u, Zero); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(u, det)); + + // q = s ^ e1; + XMVECTOR q = XMVector3Cross(s, e1); + + // v = Direction * q; + v = XMVector3Dot(Direction, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(v, Zero)); + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorLess(XMVectorAdd(u, v), det)); + + // t = e2 * q; + t = XMVector3Dot(e2, q); + + NoIntersection = XMVectorOrInt(NoIntersection, XMVectorGreater(t, Zero)); + + if (XMVector4EqualInt(NoIntersection, XMVectorTrueInt())) + { + Dist = 0.f; + return false; + } + } + else + { + // Parallel ray. + Dist = 0.f; + return false; + } + + t = XMVectorDivide(t, det); + + // (u / det) and (v / dev) are the barycentric cooridinates of the intersection. + + // Store the x-component to *pDist + XMStoreFloat(&Dist, t); + + return true; + } + + + //----------------------------------------------------------------------------- + // Test if two triangles intersect. + // + // The final test of algorithm is based on Shen, Heng, and Tang, "A Fast + // Triangle-Triangle Overlap Test Using Signed Distances", Journal of Graphics + // Tools, vol. 8, no. 1, pp 17-23, 2003 and Guigue and Devillers, "Fast and + // Robust Triangle-Triangle Overlap Test Using Orientation Predicates", Journal + // of Graphics Tools, vol. 8, no. 1, pp 25-32, 2003. + // + // The final test could be considered an edge-edge separating plane test with + // the 9 possible cases narrowed down to the only two pairs of edges that can + // actaully result in a seperation. + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline bool XM_CALLCONV Intersects(FXMVECTOR A0, FXMVECTOR A1, FXMVECTOR A2, GXMVECTOR B0, HXMVECTOR B1, HXMVECTOR B2) noexcept + { + static const XMVECTORU32 SelectY = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0 } } }; + static const XMVECTORU32 SelectZ = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + static const XMVECTORU32 Select0111 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_1 } } }; + static const XMVECTORU32 Select1011 = { { { XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1 } } }; + static const XMVECTORU32 Select1101 = { { { XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1 } } }; + + XMVECTOR Zero = XMVectorZero(); + + // Compute the normal of triangle A. + XMVECTOR N1 = XMVector3Cross(XMVectorSubtract(A1, A0), XMVectorSubtract(A2, A0)); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(N1, Zero)); + + // Test points of B against the plane of A. + XMVECTOR BDist = XMVector3Dot(N1, XMVectorSubtract(B0, A0)); + BDist = XMVectorSelect(BDist, XMVector3Dot(N1, XMVectorSubtract(B1, A0)), SelectY); + BDist = XMVectorSelect(BDist, XMVector3Dot(N1, XMVectorSubtract(B2, A0)), SelectZ); + + // Ensure robustness with co-planar triangles by zeroing small distances. + uint32_t BDistIsZeroCR; + XMVECTOR BDistIsZero = XMVectorGreaterR(&BDistIsZeroCR, g_RayEpsilon, XMVectorAbs(BDist)); + BDist = XMVectorSelect(BDist, Zero, BDistIsZero); + + uint32_t BDistIsLessCR; + XMVECTOR BDistIsLess = XMVectorGreaterR(&BDistIsLessCR, Zero, BDist); + + uint32_t BDistIsGreaterCR; + XMVECTOR BDistIsGreater = XMVectorGreaterR(&BDistIsGreaterCR, BDist, Zero); + + // If all the points are on the same side we don't intersect. + if (XMComparisonAllTrue(BDistIsLessCR) || XMComparisonAllTrue(BDistIsGreaterCR)) + return false; + + // Compute the normal of triangle B. + XMVECTOR N2 = XMVector3Cross(XMVectorSubtract(B1, B0), XMVectorSubtract(B2, B0)); + + // Assert that the triangle is not degenerate. + assert(!XMVector3Equal(N2, Zero)); + + // Test points of A against the plane of B. + XMVECTOR ADist = XMVector3Dot(N2, XMVectorSubtract(A0, B0)); + ADist = XMVectorSelect(ADist, XMVector3Dot(N2, XMVectorSubtract(A1, B0)), SelectY); + ADist = XMVectorSelect(ADist, XMVector3Dot(N2, XMVectorSubtract(A2, B0)), SelectZ); + + // Ensure robustness with co-planar triangles by zeroing small distances. + uint32_t ADistIsZeroCR; + XMVECTOR ADistIsZero = XMVectorGreaterR(&ADistIsZeroCR, g_RayEpsilon, XMVectorAbs(ADist)); + ADist = XMVectorSelect(ADist, Zero, ADistIsZero); + + uint32_t ADistIsLessCR; + XMVECTOR ADistIsLess = XMVectorGreaterR(&ADistIsLessCR, Zero, ADist); + + uint32_t ADistIsGreaterCR; + XMVECTOR ADistIsGreater = XMVectorGreaterR(&ADistIsGreaterCR, ADist, Zero); + + // If all the points are on the same side we don't intersect. + if (XMComparisonAllTrue(ADistIsLessCR) || XMComparisonAllTrue(ADistIsGreaterCR)) + return false; + + // Special case for co-planar triangles. + if (XMComparisonAllTrue(ADistIsZeroCR) || XMComparisonAllTrue(BDistIsZeroCR)) + { + XMVECTOR Axis, Dist, MinDist; + + // Compute an axis perpindicular to the edge (points out). + Axis = XMVector3Cross(N1, XMVectorSubtract(A1, A0)); + Dist = XMVector3Dot(Axis, A0); + + // Test points of B against the axis. + MinDist = XMVector3Dot(B0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (A1, A2) + Axis = XMVector3Cross(N1, XMVectorSubtract(A2, A1)); + Dist = XMVector3Dot(Axis, A1); + + MinDist = XMVector3Dot(B0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (A2, A0) + Axis = XMVector3Cross(N1, XMVectorSubtract(A0, A2)); + Dist = XMVector3Dot(Axis, A2); + + MinDist = XMVector3Dot(B0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(B2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (B0, B1) + Axis = XMVector3Cross(N2, XMVectorSubtract(B1, B0)); + Dist = XMVector3Dot(Axis, B0); + + MinDist = XMVector3Dot(A0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (B1, B2) + Axis = XMVector3Cross(N2, XMVectorSubtract(B2, B1)); + Dist = XMVector3Dot(Axis, B1); + + MinDist = XMVector3Dot(A0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + // Edge (B2,B0) + Axis = XMVector3Cross(N2, XMVectorSubtract(B0, B2)); + Dist = XMVector3Dot(Axis, B2); + + MinDist = XMVector3Dot(A0, Axis); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A1, Axis)); + MinDist = XMVectorMin(MinDist, XMVector3Dot(A2, Axis)); + if (XMVector4GreaterOrEqual(MinDist, Dist)) + return false; + + return true; + } + + // + // Find the single vertex of A and B (ie the vertex on the opposite side + // of the plane from the other two) and reorder the edges so we can compute + // the signed edge/edge distances. + // + // if ( (V0 >= 0 && V1 < 0 && V2 < 0) || + // (V0 > 0 && V1 <= 0 && V2 <= 0) || + // (V0 <= 0 && V1 > 0 && V2 > 0) || + // (V0 < 0 && V1 >= 0 && V2 >= 0) ) then V0 is singular; + // + // If our singular vertex is not on the positive side of the plane we reverse + // the triangle winding so that the overlap comparisons will compare the + // correct edges with the correct signs. + // + XMVECTOR ADistIsLessEqual = XMVectorOrInt(ADistIsLess, ADistIsZero); + XMVECTOR ADistIsGreaterEqual = XMVectorOrInt(ADistIsGreater, ADistIsZero); + + XMVECTOR AA0, AA1, AA2; + bool bPositiveA; + + if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select0111)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select0111))) + { + // A0 is singular, crossing from positive to negative. + AA0 = A0; AA1 = A1; AA2 = A2; + bPositiveA = true; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select0111)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select0111))) + { + // A0 is singular, crossing from negative to positive. + AA0 = A0; AA1 = A2; AA2 = A1; + bPositiveA = false; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select1011)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select1011))) + { + // A1 is singular, crossing from positive to negative. + AA0 = A1; AA1 = A2; AA2 = A0; + bPositiveA = true; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select1011)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select1011))) + { + // A1 is singular, crossing from negative to positive. + AA0 = A1; AA1 = A0; AA2 = A2; + bPositiveA = false; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreaterEqual, ADistIsLess, Select1101)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsGreater, ADistIsLessEqual, Select1101))) + { + // A2 is singular, crossing from positive to negative. + AA0 = A2; AA1 = A0; AA2 = A1; + bPositiveA = true; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLessEqual, ADistIsGreater, Select1101)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(ADistIsLess, ADistIsGreaterEqual, Select1101))) + { + // A2 is singular, crossing from negative to positive. + AA0 = A2; AA1 = A1; AA2 = A0; + bPositiveA = false; + } + else + { + assert(false); + return false; + } + + XMVECTOR BDistIsLessEqual = XMVectorOrInt(BDistIsLess, BDistIsZero); + XMVECTOR BDistIsGreaterEqual = XMVectorOrInt(BDistIsGreater, BDistIsZero); + + XMVECTOR BB0, BB1, BB2; + bool bPositiveB; + + if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select0111)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select0111))) + { + // B0 is singular, crossing from positive to negative. + BB0 = B0; BB1 = B1; BB2 = B2; + bPositiveB = true; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select0111)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select0111))) + { + // B0 is singular, crossing from negative to positive. + BB0 = B0; BB1 = B2; BB2 = B1; + bPositiveB = false; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select1011)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select1011))) + { + // B1 is singular, crossing from positive to negative. + BB0 = B1; BB1 = B2; BB2 = B0; + bPositiveB = true; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select1011)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select1011))) + { + // B1 is singular, crossing from negative to positive. + BB0 = B1; BB1 = B0; BB2 = B2; + bPositiveB = false; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreaterEqual, BDistIsLess, Select1101)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsGreater, BDistIsLessEqual, Select1101))) + { + // B2 is singular, crossing from positive to negative. + BB0 = B2; BB1 = B0; BB2 = B1; + bPositiveB = true; + } + else if (DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLessEqual, BDistIsGreater, Select1101)) || + DirectX::MathInternal::XMVector3AllTrue(XMVectorSelect(BDistIsLess, BDistIsGreaterEqual, Select1101))) + { + // B2 is singular, crossing from negative to positive. + BB0 = B2; BB1 = B1; BB2 = B0; + bPositiveB = false; + } + else + { + assert(false); + return false; + } + + XMVECTOR Delta0, Delta1; + + // Reverse the direction of the test depending on whether the singular vertices are + // the same sign or different signs. + if (bPositiveA ^ bPositiveB) + { + Delta0 = XMVectorSubtract(BB0, AA0); + Delta1 = XMVectorSubtract(AA0, BB0); + } + else + { + Delta0 = XMVectorSubtract(AA0, BB0); + Delta1 = XMVectorSubtract(BB0, AA0); + } + + // Check if the triangles overlap on the line of intersection between the + // planes of the two triangles by finding the signed line distances. + XMVECTOR Dist0 = XMVector3Dot(Delta0, XMVector3Cross(XMVectorSubtract(BB2, BB0), XMVectorSubtract(AA2, AA0))); + if (XMVector4Greater(Dist0, Zero)) + return false; + + XMVECTOR Dist1 = XMVector3Dot(Delta1, XMVector3Cross(XMVectorSubtract(BB1, BB0), XMVectorSubtract(AA1, AA0))); + if (XMVector4Greater(Dist1, Zero)) + return false; + + return true; + } + + + //----------------------------------------------------------------------------- + // Ray-triangle test + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline PlaneIntersectionType XM_CALLCONV Intersects(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, GXMVECTOR Plane) noexcept + { + XMVECTOR One = XMVectorSplatOne(); + + assert(DirectX::MathInternal::XMPlaneIsUnit(Plane)); + + // Set w of the points to one so we can dot4 with a plane. + XMVECTOR TV0 = XMVectorInsert<0, 0, 0, 0, 1>(V0, One); + XMVECTOR TV1 = XMVectorInsert<0, 0, 0, 0, 1>(V1, One); + XMVECTOR TV2 = XMVectorInsert<0, 0, 0, 0, 1>(V2, One); + + XMVECTOR Outside, Inside; + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane, Outside, Inside); + + // If the triangle is outside any plane it is outside. + if (XMVector4EqualInt(Outside, XMVectorTrueInt())) + return FRONT; + + // If the triangle is inside all planes it is inside. + if (XMVector4EqualInt(Inside, XMVectorTrueInt())) + return BACK; + + // The triangle is not inside all planes or outside a plane it intersects. + return INTERSECTING; + } + + + //----------------------------------------------------------------------------- + // Test a triangle vs 6 planes (typically forming a frustum). + //----------------------------------------------------------------------------- + _Use_decl_annotations_ + inline ContainmentType XM_CALLCONV ContainedBy( + FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2, + GXMVECTOR Plane0, + HXMVECTOR Plane1, HXMVECTOR Plane2, + CXMVECTOR Plane3, CXMVECTOR Plane4, CXMVECTOR Plane5) noexcept + { + XMVECTOR One = XMVectorSplatOne(); + + // Set w of the points to one so we can dot4 with a plane. + XMVECTOR TV0 = XMVectorInsert<0, 0, 0, 0, 1>(V0, One); + XMVECTOR TV1 = XMVectorInsert<0, 0, 0, 0, 1>(V1, One); + XMVECTOR TV2 = XMVectorInsert<0, 0, 0, 0, 1>(V2, One); + + XMVECTOR Outside, Inside; + + // Test against each plane. + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane0, Outside, Inside); + + XMVECTOR AnyOutside = Outside; + XMVECTOR AllInside = Inside; + + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane1, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane2, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane3, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane4, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + DirectX::MathInternal::FastIntersectTrianglePlane(TV0, TV1, TV2, Plane5, Outside, Inside); + AnyOutside = XMVectorOrInt(AnyOutside, Outside); + AllInside = XMVectorAndInt(AllInside, Inside); + + // If the triangle is outside any plane it is outside. + if (XMVector4EqualInt(AnyOutside, XMVectorTrueInt())) + return DISJOINT; + + // If the triangle is inside all planes it is inside. + if (XMVector4EqualInt(AllInside, XMVectorTrueInt())) + return CONTAINS; + + // The triangle is not inside all planes or outside a plane, it may intersect. + return INTERSECTS; + } + +} // namespace TriangleTests + diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXColors.h b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXColors.h similarity index 98% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXColors.h rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXColors.h index 30bd3d852..218fe17c6 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXColors.h +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXColors.h @@ -1,500 +1,500 @@ -//------------------------------------------------------------------------------------- -// DirectXColors.h -- C++ Color Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -#include "DirectXMath.h" - -namespace DirectX { - -namespace Colors { -// Standard colors (Red/Green/Blue/Alpha) in sRGB colorspace -XMGLOBALCONST XMVECTORF32 AliceBlue = { - {{0.941176534f, 0.972549081f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 AntiqueWhite = { - {{0.980392218f, 0.921568692f, 0.843137324f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Aqua = {{{0.f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Aquamarine = { - {{0.498039246f, 1.f, 0.831372619f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Azure = {{{0.941176534f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Beige = { - {{0.960784376f, 0.960784376f, 0.862745166f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Bisque = {{{1.f, 0.894117713f, 0.768627524f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Black = {{{0.f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 BlanchedAlmond = { - {{1.f, 0.921568692f, 0.803921640f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Blue = {{{0.f, 0.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 BlueViolet = { - {{0.541176498f, 0.168627456f, 0.886274576f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Brown = { - {{0.647058845f, 0.164705887f, 0.164705887f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 BurlyWood = { - {{0.870588303f, 0.721568644f, 0.529411793f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 CadetBlue = { - {{0.372549027f, 0.619607866f, 0.627451003f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Chartreuse = {{{0.498039246f, 1.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Chocolate = { - {{0.823529482f, 0.411764741f, 0.117647067f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Coral = {{{1.f, 0.498039246f, 0.313725501f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 CornflowerBlue = { - {{0.392156899f, 0.584313750f, 0.929411829f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Cornsilk = {{{1.f, 0.972549081f, 0.862745166f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Crimson = { - {{0.862745166f, 0.078431375f, 0.235294133f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Cyan = {{{0.f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkBlue = {{{0.f, 0.f, 0.545098066f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkCyan = {{{0.f, 0.545098066f, 0.545098066f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkGoldenrod = { - {{0.721568644f, 0.525490224f, 0.043137256f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkGray = { - {{0.662745118f, 0.662745118f, 0.662745118f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkGreen = {{{0.f, 0.392156899f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkKhaki = { - {{0.741176486f, 0.717647076f, 0.419607878f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkMagenta = { - {{0.545098066f, 0.f, 0.545098066f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkOliveGreen = { - {{0.333333343f, 0.419607878f, 0.184313729f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkOrange = {{{1.f, 0.549019635f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkOrchid = { - {{0.600000024f, 0.196078449f, 0.800000072f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkRed = {{{0.545098066f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSalmon = { - {{0.913725555f, 0.588235319f, 0.478431404f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSeaGreen = { - {{0.560784340f, 0.737254918f, 0.545098066f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSlateBlue = { - {{0.282352954f, 0.239215702f, 0.545098066f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSlateGray = { - {{0.184313729f, 0.309803933f, 0.309803933f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkTurquoise = { - {{0.f, 0.807843208f, 0.819607913f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkViolet = { - {{0.580392182f, 0.f, 0.827451050f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DeepPink = {{{1.f, 0.078431375f, 0.576470613f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DeepSkyBlue = {{{0.f, 0.749019623f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DimGray = { - {{0.411764741f, 0.411764741f, 0.411764741f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DodgerBlue = { - {{0.117647067f, 0.564705908f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Firebrick = { - {{0.698039234f, 0.133333340f, 0.133333340f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 FloralWhite = { - {{1.f, 0.980392218f, 0.941176534f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 ForestGreen = { - {{0.133333340f, 0.545098066f, 0.133333340f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Fuchsia = {{{1.f, 0.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Gainsboro = { - {{0.862745166f, 0.862745166f, 0.862745166f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 GhostWhite = { - {{0.972549081f, 0.972549081f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Gold = {{{1.f, 0.843137324f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Goldenrod = { - {{0.854902029f, 0.647058845f, 0.125490203f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Gray = { - {{0.501960814f, 0.501960814f, 0.501960814f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Green = {{{0.f, 0.501960814f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 GreenYellow = { - {{0.678431392f, 1.f, 0.184313729f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Honeydew = {{{0.941176534f, 1.f, 0.941176534f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 HotPink = {{{1.f, 0.411764741f, 0.705882370f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 IndianRed = { - {{0.803921640f, 0.360784322f, 0.360784322f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Indigo = {{{0.294117659f, 0.f, 0.509803951f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Ivory = {{{1.f, 1.f, 0.941176534f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Khaki = { - {{0.941176534f, 0.901960850f, 0.549019635f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Lavender = { - {{0.901960850f, 0.901960850f, 0.980392218f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LavenderBlush = { - {{1.f, 0.941176534f, 0.960784376f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LawnGreen = { - {{0.486274540f, 0.988235354f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LemonChiffon = { - {{1.f, 0.980392218f, 0.803921640f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightBlue = { - {{0.678431392f, 0.847058892f, 0.901960850f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightCoral = { - {{0.941176534f, 0.501960814f, 0.501960814f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightCyan = {{{0.878431439f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightGoldenrodYellow = { - {{0.980392218f, 0.980392218f, 0.823529482f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightGray = { - {{0.827451050f, 0.827451050f, 0.827451050f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightGreen = { - {{0.564705908f, 0.933333397f, 0.564705908f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightPink = { - {{1.f, 0.713725507f, 0.756862819f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSalmon = { - {{1.f, 0.627451003f, 0.478431404f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSeaGreen = { - {{0.125490203f, 0.698039234f, 0.666666687f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSkyBlue = { - {{0.529411793f, 0.807843208f, 0.980392218f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSlateGray = { - {{0.466666698f, 0.533333361f, 0.600000024f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSteelBlue = { - {{0.690196097f, 0.768627524f, 0.870588303f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightYellow = {{{1.f, 1.f, 0.878431439f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Lime = {{{0.f, 1.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LimeGreen = { - {{0.196078449f, 0.803921640f, 0.196078449f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Linen = { - {{0.980392218f, 0.941176534f, 0.901960850f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Magenta = {{{1.f, 0.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Maroon = {{{0.501960814f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumAquamarine = { - {{0.400000036f, 0.803921640f, 0.666666687f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumBlue = {{{0.f, 0.f, 0.803921640f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumOrchid = { - {{0.729411781f, 0.333333343f, 0.827451050f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumPurple = { - {{0.576470613f, 0.439215720f, 0.858823597f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumSeaGreen = { - {{0.235294133f, 0.701960802f, 0.443137288f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumSlateBlue = { - {{0.482352972f, 0.407843173f, 0.933333397f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumSpringGreen = { - {{0.f, 0.980392218f, 0.603921592f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumTurquoise = { - {{0.282352954f, 0.819607913f, 0.800000072f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumVioletRed = { - {{0.780392230f, 0.082352944f, 0.521568656f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MidnightBlue = { - {{0.098039225f, 0.098039225f, 0.439215720f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MintCream = { - {{0.960784376f, 1.f, 0.980392218f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MistyRose = { - {{1.f, 0.894117713f, 0.882353008f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Moccasin = {{{1.f, 0.894117713f, 0.709803939f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 NavajoWhite = { - {{1.f, 0.870588303f, 0.678431392f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Navy = {{{0.f, 0.f, 0.501960814f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 OldLace = { - {{0.992156923f, 0.960784376f, 0.901960850f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Olive = {{{0.501960814f, 0.501960814f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 OliveDrab = { - {{0.419607878f, 0.556862772f, 0.137254909f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Orange = {{{1.f, 0.647058845f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 OrangeRed = {{{1.f, 0.270588249f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Orchid = { - {{0.854902029f, 0.439215720f, 0.839215755f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleGoldenrod = { - {{0.933333397f, 0.909803987f, 0.666666687f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleGreen = { - {{0.596078455f, 0.984313786f, 0.596078455f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleTurquoise = { - {{0.686274529f, 0.933333397f, 0.933333397f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleVioletRed = { - {{0.858823597f, 0.439215720f, 0.576470613f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PapayaWhip = { - {{1.f, 0.937254965f, 0.835294187f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PeachPuff = { - {{1.f, 0.854902029f, 0.725490212f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Peru = { - {{0.803921640f, 0.521568656f, 0.247058839f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Pink = {{{1.f, 0.752941251f, 0.796078503f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Plum = { - {{0.866666734f, 0.627451003f, 0.866666734f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PowderBlue = { - {{0.690196097f, 0.878431439f, 0.901960850f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Purple = {{{0.501960814f, 0.f, 0.501960814f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Red = {{{1.f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 RosyBrown = { - {{0.737254918f, 0.560784340f, 0.560784340f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 RoyalBlue = { - {{0.254901975f, 0.411764741f, 0.882353008f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SaddleBrown = { - {{0.545098066f, 0.270588249f, 0.074509807f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Salmon = { - {{0.980392218f, 0.501960814f, 0.447058856f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SandyBrown = { - {{0.956862807f, 0.643137276f, 0.376470625f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SeaGreen = { - {{0.180392161f, 0.545098066f, 0.341176480f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SeaShell = {{{1.f, 0.960784376f, 0.933333397f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Sienna = { - {{0.627451003f, 0.321568638f, 0.176470593f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Silver = { - {{0.752941251f, 0.752941251f, 0.752941251f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SkyBlue = { - {{0.529411793f, 0.807843208f, 0.921568692f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SlateBlue = { - {{0.415686309f, 0.352941185f, 0.803921640f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SlateGray = { - {{0.439215720f, 0.501960814f, 0.564705908f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Snow = {{{1.f, 0.980392218f, 0.980392218f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SpringGreen = {{{0.f, 1.f, 0.498039246f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SteelBlue = { - {{0.274509817f, 0.509803951f, 0.705882370f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Tan = { - {{0.823529482f, 0.705882370f, 0.549019635f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Teal = {{{0.f, 0.501960814f, 0.501960814f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Thistle = { - {{0.847058892f, 0.749019623f, 0.847058892f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Tomato = {{{1.f, 0.388235331f, 0.278431386f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Transparent = {{{0.f, 0.f, 0.f, 0.f}}}; -XMGLOBALCONST XMVECTORF32 Turquoise = { - {{0.250980407f, 0.878431439f, 0.815686345f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Violet = { - {{0.933333397f, 0.509803951f, 0.933333397f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Wheat = { - {{0.960784376f, 0.870588303f, 0.701960802f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 White = {{{1.f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 WhiteSmoke = { - {{0.960784376f, 0.960784376f, 0.960784376f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Yellow = {{{1.f, 1.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 YellowGreen = { - {{0.603921592f, 0.803921640f, 0.196078449f, 1.f}}}; - -} // namespace Colors - -namespace ColorsLinear { -// Standard colors (Red/Green/Blue/Alpha) in linear colorspace -XMGLOBALCONST XMVECTORF32 AliceBlue = { - {{0.871367335f, 0.938685894f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 AntiqueWhite = { - {{0.955973506f, 0.830770075f, 0.679542601f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Aqua = {{{0.f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Aquamarine = { - {{0.212230787f, 1.f, 0.658374965f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Azure = {{{0.871367335f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Beige = { - {{0.913098991f, 0.913098991f, 0.715693772f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Bisque = {{{1.f, 0.775822461f, 0.552011609f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Black = {{{0.f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 BlanchedAlmond = { - {{1.f, 0.830770075f, 0.610495746f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Blue = {{{0.f, 0.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 BlueViolet = { - {{0.254152179f, 0.024157630f, 0.760524750f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Brown = { - {{0.376262218f, 0.023153365f, 0.023153365f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 BurlyWood = { - {{0.730461001f, 0.479320228f, 0.242281199f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 CadetBlue = { - {{0.114435382f, 0.341914445f, 0.351532698f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Chartreuse = {{{0.212230787f, 1.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Chocolate = { - {{0.644479871f, 0.141263321f, 0.012983031f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Coral = {{{1.f, 0.212230787f, 0.080219828f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 CornflowerBlue = { - {{0.127437726f, 0.300543845f, 0.846873462f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Cornsilk = {{{1.f, 0.938685894f, 0.715693772f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Crimson = { - {{0.715693772f, 0.006995410f, 0.045186214f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Cyan = {{{0.f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkBlue = {{{0.f, 0.f, 0.258182913f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkCyan = {{{0.f, 0.258182913f, 0.258182913f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkGoldenrod = { - {{0.479320228f, 0.238397658f, 0.003346536f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkGray = { - {{0.396755308f, 0.396755308f, 0.396755308f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkGreen = {{{0.f, 0.127437726f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkKhaki = { - {{0.508881450f, 0.473531544f, 0.147027299f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkMagenta = { - {{0.258182913f, 0.f, 0.258182913f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkOliveGreen = { - {{0.090841733f, 0.147027299f, 0.028426038f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkOrange = {{{1.f, 0.262250721f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkOrchid = { - {{0.318546832f, 0.031896040f, 0.603827536f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkRed = {{{0.258182913f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSalmon = { - {{0.814846814f, 0.304987371f, 0.194617867f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSeaGreen = { - {{0.274677366f, 0.502886593f, 0.258182913f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSlateBlue = { - {{0.064803280f, 0.046665095f, 0.258182913f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkSlateGray = { - {{0.028426038f, 0.078187428f, 0.078187428f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkTurquoise = { - {{0.f, 0.617206752f, 0.637597024f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DarkViolet = { - {{0.296138316f, 0.f, 0.651405811f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DeepPink = {{{1.f, 0.006995410f, 0.291770697f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DeepSkyBlue = {{{0.f, 0.520995677f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DimGray = { - {{0.141263321f, 0.141263321f, 0.141263321f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 DodgerBlue = { - {{0.012983031f, 0.278894335f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Firebrick = { - {{0.445201248f, 0.015996292f, 0.015996292f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 FloralWhite = { - {{1.f, 0.955973506f, 0.871367335f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 ForestGreen = { - {{0.015996292f, 0.258182913f, 0.015996292f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Fuchsia = {{{1.f, 0.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Gainsboro = { - {{0.715693772f, 0.715693772f, 0.715693772f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 GhostWhite = { - {{0.938685894f, 0.938685894f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Gold = {{{1.f, 0.679542601f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Goldenrod = { - {{0.701102138f, 0.376262218f, 0.014443844f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Gray = { - {{0.215860531f, 0.215860531f, 0.215860531f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Green = {{{0.f, 0.215860531f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 GreenYellow = { - {{0.417885154f, 1.f, 0.028426038f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Honeydew = {{{0.871367335f, 1.f, 0.871367335f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 HotPink = {{{1.f, 0.141263321f, 0.456411064f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 IndianRed = { - {{0.610495746f, 0.107023112f, 0.107023112f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Indigo = {{{0.070360109f, 0.f, 0.223227978f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Ivory = {{{1.f, 1.f, 0.871367335f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Khaki = { - {{0.871367335f, 0.791298151f, 0.262250721f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Lavender = { - {{0.791298151f, 0.791298151f, 0.955973506f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LavenderBlush = { - {{1.f, 0.871367335f, 0.913098991f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LawnGreen = { - {{0.201556295f, 0.973445475f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LemonChiffon = { - {{1.f, 0.955973506f, 0.610495746f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightBlue = { - {{0.417885154f, 0.686685443f, 0.791298151f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightCoral = { - {{0.871367335f, 0.215860531f, 0.215860531f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightCyan = {{{0.745404482f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightGoldenrodYellow = { - {{0.955973506f, 0.955973506f, 0.644479871f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightGray = { - {{0.651405811f, 0.651405811f, 0.651405811f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightGreen = { - {{0.278894335f, 0.854992807f, 0.278894335f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightPink = { - {{1.f, 0.467783839f, 0.533276618f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSalmon = { - {{1.f, 0.351532698f, 0.194617867f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSeaGreen = { - {{0.014443844f, 0.445201248f, 0.401977867f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSkyBlue = { - {{0.242281199f, 0.617206752f, 0.955973506f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSlateGray = { - {{0.184475034f, 0.246201396f, 0.318546832f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightSteelBlue = { - {{0.434153706f, 0.552011609f, 0.730461001f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LightYellow = {{{1.f, 1.f, 0.745404482f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Lime = {{{0.f, 1.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 LimeGreen = { - {{0.031896040f, 0.610495746f, 0.031896040f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Linen = { - {{0.955973506f, 0.871367335f, 0.791298151f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Magenta = {{{1.f, 0.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Maroon = {{{0.215860531f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumAquamarine = { - {{0.132868364f, 0.610495746f, 0.401977867f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumBlue = {{{0.f, 0.f, 0.610495746f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumOrchid = { - {{0.491020888f, 0.090841733f, 0.651405811f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumPurple = { - {{0.291770697f, 0.162029430f, 0.708376050f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumSeaGreen = { - {{0.045186214f, 0.450785846f, 0.165132239f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumSlateBlue = { - {{0.198069349f, 0.138431653f, 0.854992807f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumSpringGreen = { - {{0.f, 0.955973506f, 0.323143244f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumTurquoise = { - {{0.064803280f, 0.637597024f, 0.603827536f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MediumVioletRed = { - {{0.571125031f, 0.007499032f, 0.234550655f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MidnightBlue = { - {{0.009721218f, 0.009721218f, 0.162029430f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MintCream = { - {{0.913098991f, 1.f, 0.955973506f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 MistyRose = { - {{1.f, 0.775822461f, 0.752942443f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Moccasin = {{{1.f, 0.775822461f, 0.462077051f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 NavajoWhite = { - {{1.f, 0.730461001f, 0.417885154f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Navy = {{{0.f, 0.f, 0.215860531f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 OldLace = { - {{0.982250869f, 0.913098991f, 0.791298151f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Olive = {{{0.215860531f, 0.215860531f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 OliveDrab = { - {{0.147027299f, 0.270497859f, 0.016807375f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Orange = {{{1.f, 0.376262218f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 OrangeRed = {{{1.f, 0.059511241f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Orchid = { - {{0.701102138f, 0.162029430f, 0.672443330f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleGoldenrod = { - {{0.854992807f, 0.806952477f, 0.401977867f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleGreen = { - {{0.313988745f, 0.964686573f, 0.313988745f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleTurquoise = { - {{0.428690553f, 0.854992807f, 0.854992807f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PaleVioletRed = { - {{0.708376050f, 0.162029430f, 0.291770697f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PapayaWhip = { - {{1.f, 0.863157392f, 0.665387452f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PeachPuff = { - {{1.f, 0.701102138f, 0.485149980f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Peru = { - {{0.610495746f, 0.234550655f, 0.049706575f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Pink = {{{1.f, 0.527115345f, 0.597202003f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Plum = { - {{0.723055363f, 0.351532698f, 0.723055363f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 PowderBlue = { - {{0.434153706f, 0.745404482f, 0.791298151f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Purple = {{{0.215860531f, 0.f, 0.215860531f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Red = {{{1.f, 0.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 RosyBrown = { - {{0.502886593f, 0.274677366f, 0.274677366f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 RoyalBlue = { - {{0.052860655f, 0.141263321f, 0.752942443f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SaddleBrown = { - {{0.258182913f, 0.059511241f, 0.006512091f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Salmon = { - {{0.955973506f, 0.215860531f, 0.168269455f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SandyBrown = { - {{0.904661357f, 0.371237785f, 0.116970696f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SeaGreen = { - {{0.027320892f, 0.258182913f, 0.095307484f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SeaShell = {{{1.f, 0.913098991f, 0.854992807f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Sienna = { - {{0.351532698f, 0.084376216f, 0.026241222f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Silver = { - {{0.527115345f, 0.527115345f, 0.527115345f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SkyBlue = { - {{0.242281199f, 0.617206752f, 0.830770075f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SlateBlue = { - {{0.144128501f, 0.102241747f, 0.610495746f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SlateGray = { - {{0.162029430f, 0.215860531f, 0.278894335f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Snow = {{{1.f, 0.955973506f, 0.955973506f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SpringGreen = {{{0.f, 1.f, 0.212230787f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 SteelBlue = { - {{0.061246071f, 0.223227978f, 0.456411064f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Tan = { - {{0.644479871f, 0.456411064f, 0.262250721f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Teal = {{{0.f, 0.215860531f, 0.215860531f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Thistle = { - {{0.686685443f, 0.520995677f, 0.686685443f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Tomato = {{{1.f, 0.124771863f, 0.063010029f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Transparent = {{{0.f, 0.f, 0.f, 0.f}}}; -XMGLOBALCONST XMVECTORF32 Turquoise = { - {{0.051269468f, 0.745404482f, 0.630757332f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Violet = { - {{0.854992807f, 0.223227978f, 0.854992807f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Wheat = { - {{0.913098991f, 0.730461001f, 0.450785846f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 White = {{{1.f, 1.f, 1.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 WhiteSmoke = { - {{0.913098991f, 0.913098991f, 0.913098991f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 Yellow = {{{1.f, 1.f, 0.f, 1.f}}}; -XMGLOBALCONST XMVECTORF32 YellowGreen = { - {{0.323143244f, 0.610495746f, 0.031896040f, 1.f}}}; - -} // namespace ColorsLinear - -} // namespace DirectX +//------------------------------------------------------------------------------------- +// DirectXColors.h -- C++ Color Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#include "DirectXMath.h" + +namespace DirectX { + +namespace Colors { +// Standard colors (Red/Green/Blue/Alpha) in sRGB colorspace +XMGLOBALCONST XMVECTORF32 AliceBlue = { + {{0.941176534f, 0.972549081f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 AntiqueWhite = { + {{0.980392218f, 0.921568692f, 0.843137324f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Aqua = {{{0.f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Aquamarine = { + {{0.498039246f, 1.f, 0.831372619f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Azure = {{{0.941176534f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Beige = { + {{0.960784376f, 0.960784376f, 0.862745166f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Bisque = {{{1.f, 0.894117713f, 0.768627524f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Black = {{{0.f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 BlanchedAlmond = { + {{1.f, 0.921568692f, 0.803921640f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Blue = {{{0.f, 0.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 BlueViolet = { + {{0.541176498f, 0.168627456f, 0.886274576f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Brown = { + {{0.647058845f, 0.164705887f, 0.164705887f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 BurlyWood = { + {{0.870588303f, 0.721568644f, 0.529411793f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 CadetBlue = { + {{0.372549027f, 0.619607866f, 0.627451003f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Chartreuse = {{{0.498039246f, 1.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Chocolate = { + {{0.823529482f, 0.411764741f, 0.117647067f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Coral = {{{1.f, 0.498039246f, 0.313725501f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 CornflowerBlue = { + {{0.392156899f, 0.584313750f, 0.929411829f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Cornsilk = {{{1.f, 0.972549081f, 0.862745166f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Crimson = { + {{0.862745166f, 0.078431375f, 0.235294133f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Cyan = {{{0.f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkBlue = {{{0.f, 0.f, 0.545098066f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkCyan = {{{0.f, 0.545098066f, 0.545098066f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkGoldenrod = { + {{0.721568644f, 0.525490224f, 0.043137256f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkGray = { + {{0.662745118f, 0.662745118f, 0.662745118f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkGreen = {{{0.f, 0.392156899f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkKhaki = { + {{0.741176486f, 0.717647076f, 0.419607878f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkMagenta = { + {{0.545098066f, 0.f, 0.545098066f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkOliveGreen = { + {{0.333333343f, 0.419607878f, 0.184313729f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkOrange = {{{1.f, 0.549019635f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkOrchid = { + {{0.600000024f, 0.196078449f, 0.800000072f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkRed = {{{0.545098066f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSalmon = { + {{0.913725555f, 0.588235319f, 0.478431404f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSeaGreen = { + {{0.560784340f, 0.737254918f, 0.545098066f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSlateBlue = { + {{0.282352954f, 0.239215702f, 0.545098066f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSlateGray = { + {{0.184313729f, 0.309803933f, 0.309803933f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkTurquoise = { + {{0.f, 0.807843208f, 0.819607913f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkViolet = { + {{0.580392182f, 0.f, 0.827451050f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DeepPink = {{{1.f, 0.078431375f, 0.576470613f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DeepSkyBlue = {{{0.f, 0.749019623f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DimGray = { + {{0.411764741f, 0.411764741f, 0.411764741f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DodgerBlue = { + {{0.117647067f, 0.564705908f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Firebrick = { + {{0.698039234f, 0.133333340f, 0.133333340f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 FloralWhite = { + {{1.f, 0.980392218f, 0.941176534f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 ForestGreen = { + {{0.133333340f, 0.545098066f, 0.133333340f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Fuchsia = {{{1.f, 0.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Gainsboro = { + {{0.862745166f, 0.862745166f, 0.862745166f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 GhostWhite = { + {{0.972549081f, 0.972549081f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Gold = {{{1.f, 0.843137324f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Goldenrod = { + {{0.854902029f, 0.647058845f, 0.125490203f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Gray = { + {{0.501960814f, 0.501960814f, 0.501960814f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Green = {{{0.f, 0.501960814f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 GreenYellow = { + {{0.678431392f, 1.f, 0.184313729f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Honeydew = {{{0.941176534f, 1.f, 0.941176534f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 HotPink = {{{1.f, 0.411764741f, 0.705882370f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 IndianRed = { + {{0.803921640f, 0.360784322f, 0.360784322f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Indigo = {{{0.294117659f, 0.f, 0.509803951f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Ivory = {{{1.f, 1.f, 0.941176534f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Khaki = { + {{0.941176534f, 0.901960850f, 0.549019635f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Lavender = { + {{0.901960850f, 0.901960850f, 0.980392218f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LavenderBlush = { + {{1.f, 0.941176534f, 0.960784376f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LawnGreen = { + {{0.486274540f, 0.988235354f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LemonChiffon = { + {{1.f, 0.980392218f, 0.803921640f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightBlue = { + {{0.678431392f, 0.847058892f, 0.901960850f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightCoral = { + {{0.941176534f, 0.501960814f, 0.501960814f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightCyan = {{{0.878431439f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightGoldenrodYellow = { + {{0.980392218f, 0.980392218f, 0.823529482f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightGray = { + {{0.827451050f, 0.827451050f, 0.827451050f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightGreen = { + {{0.564705908f, 0.933333397f, 0.564705908f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightPink = { + {{1.f, 0.713725507f, 0.756862819f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSalmon = { + {{1.f, 0.627451003f, 0.478431404f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSeaGreen = { + {{0.125490203f, 0.698039234f, 0.666666687f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSkyBlue = { + {{0.529411793f, 0.807843208f, 0.980392218f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSlateGray = { + {{0.466666698f, 0.533333361f, 0.600000024f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSteelBlue = { + {{0.690196097f, 0.768627524f, 0.870588303f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightYellow = {{{1.f, 1.f, 0.878431439f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Lime = {{{0.f, 1.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LimeGreen = { + {{0.196078449f, 0.803921640f, 0.196078449f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Linen = { + {{0.980392218f, 0.941176534f, 0.901960850f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Magenta = {{{1.f, 0.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Maroon = {{{0.501960814f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumAquamarine = { + {{0.400000036f, 0.803921640f, 0.666666687f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumBlue = {{{0.f, 0.f, 0.803921640f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumOrchid = { + {{0.729411781f, 0.333333343f, 0.827451050f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumPurple = { + {{0.576470613f, 0.439215720f, 0.858823597f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumSeaGreen = { + {{0.235294133f, 0.701960802f, 0.443137288f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumSlateBlue = { + {{0.482352972f, 0.407843173f, 0.933333397f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumSpringGreen = { + {{0.f, 0.980392218f, 0.603921592f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumTurquoise = { + {{0.282352954f, 0.819607913f, 0.800000072f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumVioletRed = { + {{0.780392230f, 0.082352944f, 0.521568656f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MidnightBlue = { + {{0.098039225f, 0.098039225f, 0.439215720f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MintCream = { + {{0.960784376f, 1.f, 0.980392218f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MistyRose = { + {{1.f, 0.894117713f, 0.882353008f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Moccasin = {{{1.f, 0.894117713f, 0.709803939f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 NavajoWhite = { + {{1.f, 0.870588303f, 0.678431392f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Navy = {{{0.f, 0.f, 0.501960814f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 OldLace = { + {{0.992156923f, 0.960784376f, 0.901960850f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Olive = {{{0.501960814f, 0.501960814f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 OliveDrab = { + {{0.419607878f, 0.556862772f, 0.137254909f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Orange = {{{1.f, 0.647058845f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 OrangeRed = {{{1.f, 0.270588249f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Orchid = { + {{0.854902029f, 0.439215720f, 0.839215755f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleGoldenrod = { + {{0.933333397f, 0.909803987f, 0.666666687f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleGreen = { + {{0.596078455f, 0.984313786f, 0.596078455f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleTurquoise = { + {{0.686274529f, 0.933333397f, 0.933333397f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleVioletRed = { + {{0.858823597f, 0.439215720f, 0.576470613f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PapayaWhip = { + {{1.f, 0.937254965f, 0.835294187f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PeachPuff = { + {{1.f, 0.854902029f, 0.725490212f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Peru = { + {{0.803921640f, 0.521568656f, 0.247058839f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Pink = {{{1.f, 0.752941251f, 0.796078503f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Plum = { + {{0.866666734f, 0.627451003f, 0.866666734f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PowderBlue = { + {{0.690196097f, 0.878431439f, 0.901960850f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Purple = {{{0.501960814f, 0.f, 0.501960814f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Red = {{{1.f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 RosyBrown = { + {{0.737254918f, 0.560784340f, 0.560784340f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 RoyalBlue = { + {{0.254901975f, 0.411764741f, 0.882353008f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SaddleBrown = { + {{0.545098066f, 0.270588249f, 0.074509807f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Salmon = { + {{0.980392218f, 0.501960814f, 0.447058856f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SandyBrown = { + {{0.956862807f, 0.643137276f, 0.376470625f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SeaGreen = { + {{0.180392161f, 0.545098066f, 0.341176480f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SeaShell = {{{1.f, 0.960784376f, 0.933333397f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Sienna = { + {{0.627451003f, 0.321568638f, 0.176470593f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Silver = { + {{0.752941251f, 0.752941251f, 0.752941251f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SkyBlue = { + {{0.529411793f, 0.807843208f, 0.921568692f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SlateBlue = { + {{0.415686309f, 0.352941185f, 0.803921640f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SlateGray = { + {{0.439215720f, 0.501960814f, 0.564705908f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Snow = {{{1.f, 0.980392218f, 0.980392218f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SpringGreen = {{{0.f, 1.f, 0.498039246f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SteelBlue = { + {{0.274509817f, 0.509803951f, 0.705882370f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Tan = { + {{0.823529482f, 0.705882370f, 0.549019635f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Teal = {{{0.f, 0.501960814f, 0.501960814f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Thistle = { + {{0.847058892f, 0.749019623f, 0.847058892f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Tomato = {{{1.f, 0.388235331f, 0.278431386f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Transparent = {{{0.f, 0.f, 0.f, 0.f}}}; +XMGLOBALCONST XMVECTORF32 Turquoise = { + {{0.250980407f, 0.878431439f, 0.815686345f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Violet = { + {{0.933333397f, 0.509803951f, 0.933333397f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Wheat = { + {{0.960784376f, 0.870588303f, 0.701960802f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 White = {{{1.f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 WhiteSmoke = { + {{0.960784376f, 0.960784376f, 0.960784376f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Yellow = {{{1.f, 1.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 YellowGreen = { + {{0.603921592f, 0.803921640f, 0.196078449f, 1.f}}}; + +} // namespace Colors + +namespace ColorsLinear { +// Standard colors (Red/Green/Blue/Alpha) in linear colorspace +XMGLOBALCONST XMVECTORF32 AliceBlue = { + {{0.871367335f, 0.938685894f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 AntiqueWhite = { + {{0.955973506f, 0.830770075f, 0.679542601f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Aqua = {{{0.f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Aquamarine = { + {{0.212230787f, 1.f, 0.658374965f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Azure = {{{0.871367335f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Beige = { + {{0.913098991f, 0.913098991f, 0.715693772f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Bisque = {{{1.f, 0.775822461f, 0.552011609f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Black = {{{0.f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 BlanchedAlmond = { + {{1.f, 0.830770075f, 0.610495746f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Blue = {{{0.f, 0.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 BlueViolet = { + {{0.254152179f, 0.024157630f, 0.760524750f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Brown = { + {{0.376262218f, 0.023153365f, 0.023153365f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 BurlyWood = { + {{0.730461001f, 0.479320228f, 0.242281199f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 CadetBlue = { + {{0.114435382f, 0.341914445f, 0.351532698f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Chartreuse = {{{0.212230787f, 1.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Chocolate = { + {{0.644479871f, 0.141263321f, 0.012983031f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Coral = {{{1.f, 0.212230787f, 0.080219828f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 CornflowerBlue = { + {{0.127437726f, 0.300543845f, 0.846873462f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Cornsilk = {{{1.f, 0.938685894f, 0.715693772f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Crimson = { + {{0.715693772f, 0.006995410f, 0.045186214f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Cyan = {{{0.f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkBlue = {{{0.f, 0.f, 0.258182913f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkCyan = {{{0.f, 0.258182913f, 0.258182913f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkGoldenrod = { + {{0.479320228f, 0.238397658f, 0.003346536f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkGray = { + {{0.396755308f, 0.396755308f, 0.396755308f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkGreen = {{{0.f, 0.127437726f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkKhaki = { + {{0.508881450f, 0.473531544f, 0.147027299f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkMagenta = { + {{0.258182913f, 0.f, 0.258182913f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkOliveGreen = { + {{0.090841733f, 0.147027299f, 0.028426038f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkOrange = {{{1.f, 0.262250721f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkOrchid = { + {{0.318546832f, 0.031896040f, 0.603827536f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkRed = {{{0.258182913f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSalmon = { + {{0.814846814f, 0.304987371f, 0.194617867f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSeaGreen = { + {{0.274677366f, 0.502886593f, 0.258182913f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSlateBlue = { + {{0.064803280f, 0.046665095f, 0.258182913f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkSlateGray = { + {{0.028426038f, 0.078187428f, 0.078187428f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkTurquoise = { + {{0.f, 0.617206752f, 0.637597024f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DarkViolet = { + {{0.296138316f, 0.f, 0.651405811f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DeepPink = {{{1.f, 0.006995410f, 0.291770697f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DeepSkyBlue = {{{0.f, 0.520995677f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DimGray = { + {{0.141263321f, 0.141263321f, 0.141263321f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 DodgerBlue = { + {{0.012983031f, 0.278894335f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Firebrick = { + {{0.445201248f, 0.015996292f, 0.015996292f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 FloralWhite = { + {{1.f, 0.955973506f, 0.871367335f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 ForestGreen = { + {{0.015996292f, 0.258182913f, 0.015996292f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Fuchsia = {{{1.f, 0.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Gainsboro = { + {{0.715693772f, 0.715693772f, 0.715693772f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 GhostWhite = { + {{0.938685894f, 0.938685894f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Gold = {{{1.f, 0.679542601f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Goldenrod = { + {{0.701102138f, 0.376262218f, 0.014443844f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Gray = { + {{0.215860531f, 0.215860531f, 0.215860531f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Green = {{{0.f, 0.215860531f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 GreenYellow = { + {{0.417885154f, 1.f, 0.028426038f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Honeydew = {{{0.871367335f, 1.f, 0.871367335f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 HotPink = {{{1.f, 0.141263321f, 0.456411064f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 IndianRed = { + {{0.610495746f, 0.107023112f, 0.107023112f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Indigo = {{{0.070360109f, 0.f, 0.223227978f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Ivory = {{{1.f, 1.f, 0.871367335f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Khaki = { + {{0.871367335f, 0.791298151f, 0.262250721f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Lavender = { + {{0.791298151f, 0.791298151f, 0.955973506f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LavenderBlush = { + {{1.f, 0.871367335f, 0.913098991f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LawnGreen = { + {{0.201556295f, 0.973445475f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LemonChiffon = { + {{1.f, 0.955973506f, 0.610495746f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightBlue = { + {{0.417885154f, 0.686685443f, 0.791298151f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightCoral = { + {{0.871367335f, 0.215860531f, 0.215860531f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightCyan = {{{0.745404482f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightGoldenrodYellow = { + {{0.955973506f, 0.955973506f, 0.644479871f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightGray = { + {{0.651405811f, 0.651405811f, 0.651405811f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightGreen = { + {{0.278894335f, 0.854992807f, 0.278894335f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightPink = { + {{1.f, 0.467783839f, 0.533276618f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSalmon = { + {{1.f, 0.351532698f, 0.194617867f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSeaGreen = { + {{0.014443844f, 0.445201248f, 0.401977867f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSkyBlue = { + {{0.242281199f, 0.617206752f, 0.955973506f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSlateGray = { + {{0.184475034f, 0.246201396f, 0.318546832f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightSteelBlue = { + {{0.434153706f, 0.552011609f, 0.730461001f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LightYellow = {{{1.f, 1.f, 0.745404482f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Lime = {{{0.f, 1.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 LimeGreen = { + {{0.031896040f, 0.610495746f, 0.031896040f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Linen = { + {{0.955973506f, 0.871367335f, 0.791298151f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Magenta = {{{1.f, 0.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Maroon = {{{0.215860531f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumAquamarine = { + {{0.132868364f, 0.610495746f, 0.401977867f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumBlue = {{{0.f, 0.f, 0.610495746f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumOrchid = { + {{0.491020888f, 0.090841733f, 0.651405811f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumPurple = { + {{0.291770697f, 0.162029430f, 0.708376050f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumSeaGreen = { + {{0.045186214f, 0.450785846f, 0.165132239f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumSlateBlue = { + {{0.198069349f, 0.138431653f, 0.854992807f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumSpringGreen = { + {{0.f, 0.955973506f, 0.323143244f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumTurquoise = { + {{0.064803280f, 0.637597024f, 0.603827536f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MediumVioletRed = { + {{0.571125031f, 0.007499032f, 0.234550655f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MidnightBlue = { + {{0.009721218f, 0.009721218f, 0.162029430f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MintCream = { + {{0.913098991f, 1.f, 0.955973506f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 MistyRose = { + {{1.f, 0.775822461f, 0.752942443f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Moccasin = {{{1.f, 0.775822461f, 0.462077051f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 NavajoWhite = { + {{1.f, 0.730461001f, 0.417885154f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Navy = {{{0.f, 0.f, 0.215860531f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 OldLace = { + {{0.982250869f, 0.913098991f, 0.791298151f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Olive = {{{0.215860531f, 0.215860531f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 OliveDrab = { + {{0.147027299f, 0.270497859f, 0.016807375f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Orange = {{{1.f, 0.376262218f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 OrangeRed = {{{1.f, 0.059511241f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Orchid = { + {{0.701102138f, 0.162029430f, 0.672443330f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleGoldenrod = { + {{0.854992807f, 0.806952477f, 0.401977867f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleGreen = { + {{0.313988745f, 0.964686573f, 0.313988745f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleTurquoise = { + {{0.428690553f, 0.854992807f, 0.854992807f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PaleVioletRed = { + {{0.708376050f, 0.162029430f, 0.291770697f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PapayaWhip = { + {{1.f, 0.863157392f, 0.665387452f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PeachPuff = { + {{1.f, 0.701102138f, 0.485149980f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Peru = { + {{0.610495746f, 0.234550655f, 0.049706575f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Pink = {{{1.f, 0.527115345f, 0.597202003f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Plum = { + {{0.723055363f, 0.351532698f, 0.723055363f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 PowderBlue = { + {{0.434153706f, 0.745404482f, 0.791298151f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Purple = {{{0.215860531f, 0.f, 0.215860531f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Red = {{{1.f, 0.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 RosyBrown = { + {{0.502886593f, 0.274677366f, 0.274677366f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 RoyalBlue = { + {{0.052860655f, 0.141263321f, 0.752942443f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SaddleBrown = { + {{0.258182913f, 0.059511241f, 0.006512091f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Salmon = { + {{0.955973506f, 0.215860531f, 0.168269455f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SandyBrown = { + {{0.904661357f, 0.371237785f, 0.116970696f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SeaGreen = { + {{0.027320892f, 0.258182913f, 0.095307484f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SeaShell = {{{1.f, 0.913098991f, 0.854992807f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Sienna = { + {{0.351532698f, 0.084376216f, 0.026241222f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Silver = { + {{0.527115345f, 0.527115345f, 0.527115345f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SkyBlue = { + {{0.242281199f, 0.617206752f, 0.830770075f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SlateBlue = { + {{0.144128501f, 0.102241747f, 0.610495746f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SlateGray = { + {{0.162029430f, 0.215860531f, 0.278894335f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Snow = {{{1.f, 0.955973506f, 0.955973506f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SpringGreen = {{{0.f, 1.f, 0.212230787f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 SteelBlue = { + {{0.061246071f, 0.223227978f, 0.456411064f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Tan = { + {{0.644479871f, 0.456411064f, 0.262250721f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Teal = {{{0.f, 0.215860531f, 0.215860531f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Thistle = { + {{0.686685443f, 0.520995677f, 0.686685443f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Tomato = {{{1.f, 0.124771863f, 0.063010029f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Transparent = {{{0.f, 0.f, 0.f, 0.f}}}; +XMGLOBALCONST XMVECTORF32 Turquoise = { + {{0.051269468f, 0.745404482f, 0.630757332f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Violet = { + {{0.854992807f, 0.223227978f, 0.854992807f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Wheat = { + {{0.913098991f, 0.730461001f, 0.450785846f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 White = {{{1.f, 1.f, 1.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 WhiteSmoke = { + {{0.913098991f, 0.913098991f, 0.913098991f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 Yellow = {{{1.f, 1.f, 0.f, 1.f}}}; +XMGLOBALCONST XMVECTORF32 YellowGreen = { + {{0.323143244f, 0.610495746f, 0.031896040f, 1.f}}}; + +} // namespace ColorsLinear + +} // namespace DirectX diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMath.h b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMath.h similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMath.h rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMath.h index 68711f406..0d5ebecec 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMath.h +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMath.h @@ -1,3091 +1,3091 @@ -//------------------------------------------------------------------------------------- -// DirectXMath.h -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -#ifndef __cplusplus -#error DirectX Math requires C++ -#endif - -#define DIRECTX_MATH_VERSION 320 - -#if defined(_MSC_VER) && (_MSC_VER < 1910) -#error DirectX Math requires Visual C++ 2017 or later. -#endif - -#if defined(_MSC_VER) && !defined(_M_ARM) && !defined(_M_ARM64) && \ - !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC) && (!_MANAGED) && \ - (!_M_CEE) && (!defined(_M_IX86_FP) || (_M_IX86_FP > 1)) && \ - !defined(_XM_NO_INTRINSICS_) && !defined(_XM_VECTORCALL_) -#define _XM_VECTORCALL_ 1 -#endif - -#if _XM_VECTORCALL_ -#define XM_CALLCONV __vectorcall -#elif defined(__GNUC__) -#define XM_CALLCONV -#else -#define XM_CALLCONV __fastcall -#endif - -#ifndef XM_DEPRECATED -#if (__cplusplus >= 201402L) -#define XM_DEPRECATED [[deprecated]] -#elif defined(__GNUC__) -#define XM_DEPRECATED __attribute__((deprecated)) -#else -#define XM_DEPRECATED \ - __declspec(deprecated( \ - "This is deprecated and will be removed in a future version.")) -#endif -#endif - -#if !defined(_XM_AVX2_INTRINSICS_) && defined(__AVX2__) && \ - !defined(_XM_NO_INTRINSICS_) -#define _XM_AVX2_INTRINSICS_ -#endif - -#if !defined(_XM_FMA3_INTRINSICS_) && defined(_XM_AVX2_INTRINSICS_) && \ - !defined(_XM_NO_INTRINSICS_) -#define _XM_FMA3_INTRINSICS_ -#endif - -#if !defined(_XM_F16C_INTRINSICS_) && defined(_XM_AVX2_INTRINSICS_) && \ - !defined(_XM_NO_INTRINSICS_) -#define _XM_F16C_INTRINSICS_ -#endif - -#if !defined(_XM_F16C_INTRINSICS_) && defined(__F16C__) && \ - !defined(_XM_NO_INTRINSICS_) -#define _XM_F16C_INTRINSICS_ -#endif - -#if defined(_XM_FMA3_INTRINSICS_) && !defined(_XM_AVX_INTRINSICS_) -#define _XM_AVX_INTRINSICS_ -#endif - -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_AVX_INTRINSICS_) -#define _XM_AVX_INTRINSICS_ -#endif - -#if !defined(_XM_AVX_INTRINSICS_) && defined(__AVX__) && \ - !defined(_XM_NO_INTRINSICS_) -#define _XM_AVX_INTRINSICS_ -#endif - -#if defined(_XM_AVX_INTRINSICS_) && !defined(_XM_SSE4_INTRINSICS_) -#define _XM_SSE4_INTRINSICS_ -#endif - -#if defined(_XM_SSE4_INTRINSICS_) && !defined(_XM_SSE3_INTRINSICS_) -#define _XM_SSE3_INTRINSICS_ -#endif - -#if defined(_XM_SSE3_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) -#define _XM_SSE_INTRINSICS_ -#endif - -#if !defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) && \ - !defined(_XM_NO_INTRINSICS_) -#if (defined(_M_IX86) || defined(_M_X64) || __i386__ || __x86_64__) && \ - !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC) -#define _XM_SSE_INTRINSICS_ -#elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ - defined(_M_ARM64EC) || __arm__ || __aarch64__ -#define _XM_ARM_NEON_INTRINSICS_ -#elif !defined(_XM_NO_INTRINSICS_) -#error DirectX Math does not support this target -#endif -#endif // !_XM_ARM_NEON_INTRINSICS_ && !_XM_SSE_INTRINSICS_ && - // !_XM_NO_INTRINSICS_ - -#if defined(_XM_SSE_INTRINSICS_) && defined(_MSC_VER) && (_MSC_VER >= 1920) && \ - !defined(__clang__) && !defined(_XM_SVML_INTRINSICS_) && \ - !defined(_XM_DISABLE_INTEL_SVML_) -#define _XM_SVML_INTRINSICS_ -#endif - -#if !defined(_XM_NO_XMVECTOR_OVERLOADS_) && \ - (defined(__clang__) || defined(__GNUC__)) && !defined(_XM_NO_INTRINSICS_) -#define _XM_NO_XMVECTOR_OVERLOADS_ -#endif - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4514 4820) -// C4514/4820: Off by default noise -#endif -#include -#include -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#ifndef _XM_NO_INTRINSICS_ - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4987) -// C4987: Off by default noise -#endif -#if defined(_MSC_VER) || defined(__MINGW32__) -#include -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#if (defined(__clang__) || defined(__GNUC__)) && (__x86_64__ || __i386__) && \ - !defined(__MINGW32__) -#include -#endif - -#ifdef _XM_SSE_INTRINSICS_ -#include -#include - -#ifdef _XM_SSE3_INTRINSICS_ -#include -#endif - -#ifdef _XM_SSE4_INTRINSICS_ -#include -#endif - -#ifdef _XM_AVX_INTRINSICS_ -#include -#endif - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && \ - (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC)) -#include -#else -#include -#endif -#endif -#endif // !_XM_NO_INTRINSICS_ - -#include "sal.h" -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4005 4668) -// C4005/4668: Old header issue -#endif -#include -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#if (__cplusplus >= 201703L) -#define XM_ALIGNED_DATA(x) alignas(x) -#define XM_ALIGNED_STRUCT(x) struct alignas(x) -#elif defined(__GNUC__) -#define XM_ALIGNED_DATA(x) __attribute__((aligned(x))) -#define XM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) -#else -#define XM_ALIGNED_DATA(x) __declspec(align(x)) -#define XM_ALIGNED_STRUCT(x) __declspec(align(x)) struct -#endif - -#if (__cplusplus >= 202002L) -#include -#endif - -/**************************************************************************** - * - * Conditional intrinsics - * - ****************************************************************************/ - -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - -#if defined(_XM_NO_MOVNT_) -#define XM_STREAM_PS(p, a) _mm_store_ps((p), (a)) -#define XM256_STREAM_PS(p, a) _mm256_store_ps((p), (a)) -#define XM_SFENCE() -#else -#define XM_STREAM_PS(p, a) _mm_stream_ps((p), (a)) -#define XM256_STREAM_PS(p, a) _mm256_stream_ps((p), (a)) -#define XM_SFENCE() _mm_sfence() -#endif - -#if defined(_XM_FMA3_INTRINSICS_) -#define XM_FMADD_PS(a, b, c) _mm_fmadd_ps((a), (b), (c)) -#define XM_FNMADD_PS(a, b, c) _mm_fnmadd_ps((a), (b), (c)) -#else -#define XM_FMADD_PS(a, b, c) _mm_add_ps(_mm_mul_ps((a), (b)), (c)) -#define XM_FNMADD_PS(a, b, c) _mm_sub_ps((c), _mm_mul_ps((a), (b))) -#endif - -#if defined(_XM_AVX_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) -#define XM_PERMUTE_PS(v, c) _mm_permute_ps((v), c) -#else -#define XM_PERMUTE_PS(v, c) _mm_shuffle_ps((v), (v), c) -#endif - -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 11) -#define XM_LOADU_SI16(p) \ - _mm_cvtsi32_si128(*reinterpret_cast(p)) -#else -#define XM_LOADU_SI16(p) _mm_loadu_si16(p) -#endif - -#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ - -#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - -#if defined(__clang__) || defined(__GNUC__) -#define XM_PREFETCH(a) __builtin_prefetch(a) -#elif defined(_MSC_VER) -#define XM_PREFETCH(a) __prefetch(a) -#else -#define XM_PREFETCH(a) -#endif - -#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ - -namespace DirectX { - -/**************************************************************************** - * - * Constant definitions - * - ****************************************************************************/ - -#if defined(__XNAMATH_H__) && defined(XM_PI) -#undef XM_PI -#undef XM_2PI -#undef XM_1DIVPI -#undef XM_1DIV2PI -#undef XM_PIDIV2 -#undef XM_PIDIV4 -#undef XM_SELECT_0 -#undef XM_SELECT_1 -#undef XM_PERMUTE_0X -#undef XM_PERMUTE_0Y -#undef XM_PERMUTE_0Z -#undef XM_PERMUTE_0W -#undef XM_PERMUTE_1X -#undef XM_PERMUTE_1Y -#undef XM_PERMUTE_1Z -#undef XM_PERMUTE_1W -#undef XM_CRMASK_CR6 -#undef XM_CRMASK_CR6TRUE -#undef XM_CRMASK_CR6FALSE -#undef XM_CRMASK_CR6BOUNDS -#undef XM_CACHE_LINE_SIZE -#endif - -constexpr float XM_PI = 3.141592654f; -constexpr float XM_2PI = 6.283185307f; -constexpr float XM_1DIVPI = 0.318309886f; -constexpr float XM_1DIV2PI = 0.159154943f; -constexpr float XM_PIDIV2 = 1.570796327f; -constexpr float XM_PIDIV4 = 0.785398163f; - -constexpr uint32_t XM_SELECT_0 = 0x00000000; -constexpr uint32_t XM_SELECT_1 = 0xFFFFFFFF; - -constexpr uint32_t XM_PERMUTE_0X = 0; -constexpr uint32_t XM_PERMUTE_0Y = 1; -constexpr uint32_t XM_PERMUTE_0Z = 2; -constexpr uint32_t XM_PERMUTE_0W = 3; -constexpr uint32_t XM_PERMUTE_1X = 4; -constexpr uint32_t XM_PERMUTE_1Y = 5; -constexpr uint32_t XM_PERMUTE_1Z = 6; -constexpr uint32_t XM_PERMUTE_1W = 7; - -constexpr uint32_t XM_SWIZZLE_X = 0; -constexpr uint32_t XM_SWIZZLE_Y = 1; -constexpr uint32_t XM_SWIZZLE_Z = 2; -constexpr uint32_t XM_SWIZZLE_W = 3; - -constexpr uint32_t XM_CRMASK_CR6 = 0x000000F0; -constexpr uint32_t XM_CRMASK_CR6TRUE = 0x00000080; -constexpr uint32_t XM_CRMASK_CR6FALSE = 0x00000020; -constexpr uint32_t XM_CRMASK_CR6BOUNDS = XM_CRMASK_CR6FALSE; - -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ - defined(_M_ARM64EC) || __arm__ || __aarch64__ -constexpr size_t XM_CACHE_LINE_SIZE = 128; -#else -constexpr size_t XM_CACHE_LINE_SIZE = 64; -#endif - -/**************************************************************************** - * - * Macros - * - ****************************************************************************/ - -#if defined(__XNAMATH_H__) && defined(XMComparisonAllTrue) -#undef XMComparisonAllTrue -#undef XMComparisonAnyTrue -#undef XMComparisonAllFalse -#undef XMComparisonAnyFalse -#undef XMComparisonMixed -#undef XMComparisonAllInBounds -#undef XMComparisonAnyOutOfBounds -#endif - -// Unit conversion - -constexpr float XMConvertToRadians(float fDegrees) noexcept { - return fDegrees * (XM_PI / 180.0f); -} -constexpr float XMConvertToDegrees(float fRadians) noexcept { - return fRadians * (180.0f / XM_PI); -} - -// Condition register evaluation proceeding a recording (R) comparison - -constexpr bool XMComparisonAllTrue(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE; -} -constexpr bool XMComparisonAnyTrue(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE; -} -constexpr bool XMComparisonAllFalse(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE; -} -constexpr bool XMComparisonAnyFalse(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE; -} -constexpr bool XMComparisonMixed(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6) == 0; -} -constexpr bool XMComparisonAllInBounds(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS; -} -constexpr bool XMComparisonAnyOutOfBounds(uint32_t CR) noexcept { - return (CR & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS; -} - -/**************************************************************************** - * - * Data types - * - ****************************************************************************/ - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4068 4201 4365 4324 4820) -// C4068: ignore unknown pragmas -// C4201: nonstandard extension used : nameless struct/union -// C4365: Off by default noise -// C4324/4820: padding warnings -#endif - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") -#endif - -//------------------------------------------------------------------------------ -#if defined(_XM_NO_INTRINSICS_) -struct __vector4 { - union { - float vector4_f32[4]; - uint32_t vector4_u32[4]; - }; -}; -#endif // _XM_NO_INTRINSICS_ - -//------------------------------------------------------------------------------ -// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte -// boundary and mapped to hardware vector registers -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) -using XMVECTOR = __m128; -#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) -using XMVECTOR = float32x4_t; -#else -using XMVECTOR = __vector4; -#endif - -// Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86, -// ARM, ARM64, and vector call; by reference otherwise -#if (defined(_M_IX86) || defined(_M_ARM) || defined(_M_ARM64) || \ - _XM_VECTORCALL_ || __i386__ || __arm__ || __aarch64__) && \ - !defined(_XM_NO_INTRINSICS_) -typedef const XMVECTOR FXMVECTOR; -#else -typedef const XMVECTOR& FXMVECTOR; -#endif - -// Fix-up for (4th) XMVECTOR parameter to pass in-register for ARM, ARM64, and -// vector call; by reference otherwise -#if (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ - defined(_M_ARM64EC) || _XM_VECTORCALL_ || __arm__ || __aarch64__) && \ - !defined(_XM_NO_INTRINSICS_) -typedef const XMVECTOR GXMVECTOR; -#else -typedef const XMVECTOR& GXMVECTOR; -#endif - -// Fix-up for (5th & 6th) XMVECTOR parameter to pass in-register for ARM64 and -// vector call; by reference otherwise -#if (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ - defined(_M_ARM64EC) || _XM_VECTORCALL_ || __aarch64__) && \ - !defined(_XM_NO_INTRINSICS_) -typedef const XMVECTOR HXMVECTOR; -#else -typedef const XMVECTOR& HXMVECTOR; -#endif - -// Fix-up for (7th+) XMVECTOR parameters to pass by reference -typedef const XMVECTOR& CXMVECTOR; - -//------------------------------------------------------------------------------ -// Conversion types for constants -XM_ALIGNED_STRUCT(16) XMVECTORF32 { - union { - float f[4]; - XMVECTOR v; - }; - - inline operator XMVECTOR() const noexcept { return v; } - inline operator const float*() const noexcept { return f; } -#ifdef _XM_NO_INTRINSICS_ -#elif defined(_XM_SSE_INTRINSICS_) - inline operator __m128i() const noexcept { return _mm_castps_si128(v); } - inline operator __m128d() const noexcept { return _mm_castps_pd(v); } -#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ - (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) - inline operator int32x4_t() const noexcept { - return vreinterpretq_s32_f32(v); - } - inline operator uint32x4_t() const noexcept { - return vreinterpretq_u32_f32(v); - } -#endif -}; - -XM_ALIGNED_STRUCT(16) XMVECTORI32 { - union { - int32_t i[4]; - XMVECTOR v; - }; - - inline operator XMVECTOR() const noexcept { return v; } -#ifdef _XM_NO_INTRINSICS_ -#elif defined(_XM_SSE_INTRINSICS_) - inline operator __m128i() const noexcept { return _mm_castps_si128(v); } - inline operator __m128d() const noexcept { return _mm_castps_pd(v); } -#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ - (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) - inline operator int32x4_t() const noexcept { - return vreinterpretq_s32_f32(v); - } - inline operator uint32x4_t() const noexcept { - return vreinterpretq_u32_f32(v); - } -#endif -}; - -XM_ALIGNED_STRUCT(16) XMVECTORU8 { - union { - uint8_t u[16]; - XMVECTOR v; - }; - - inline operator XMVECTOR() const noexcept { return v; } -#ifdef _XM_NO_INTRINSICS_ -#elif defined(_XM_SSE_INTRINSICS_) - inline operator __m128i() const noexcept { return _mm_castps_si128(v); } - inline operator __m128d() const noexcept { return _mm_castps_pd(v); } -#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ - (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) - inline operator int32x4_t() const noexcept { - return vreinterpretq_s32_f32(v); - } - inline operator uint32x4_t() const noexcept { - return vreinterpretq_u32_f32(v); - } -#endif -}; - -XM_ALIGNED_STRUCT(16) XMVECTORU32 { - union { - uint32_t u[4]; - XMVECTOR v; - }; - - inline operator XMVECTOR() const noexcept { return v; } -#ifdef _XM_NO_INTRINSICS_ -#elif defined(_XM_SSE_INTRINSICS_) - inline operator __m128i() const noexcept { return _mm_castps_si128(v); } - inline operator __m128d() const noexcept { return _mm_castps_pd(v); } -#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ - (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) - inline operator int32x4_t() const noexcept { - return vreinterpretq_s32_f32(v); - } - inline operator uint32x4_t() const noexcept { - return vreinterpretq_u32_f32(v); - } -#endif -}; - -//------------------------------------------------------------------------------ -// Vector operators - -#ifndef _XM_NO_XMVECTOR_OVERLOADS_ -XMVECTOR XM_CALLCONV operator+(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV operator-(FXMVECTOR V) noexcept; - -XMVECTOR& XM_CALLCONV operator+=(XMVECTOR& V1, FXMVECTOR V2) noexcept; -XMVECTOR& XM_CALLCONV operator-=(XMVECTOR& V1, FXMVECTOR V2) noexcept; -XMVECTOR& XM_CALLCONV operator*=(XMVECTOR& V1, FXMVECTOR V2) noexcept; -XMVECTOR& XM_CALLCONV operator/=(XMVECTOR& V1, FXMVECTOR V2) noexcept; - -XMVECTOR& operator*=(XMVECTOR& V, float S) noexcept; -XMVECTOR& operator/=(XMVECTOR& V, float S) noexcept; - -XMVECTOR XM_CALLCONV operator+(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV operator-(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV operator*(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV operator/(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV operator*(FXMVECTOR V, float S) noexcept; -XMVECTOR XM_CALLCONV operator*(float S, FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV operator/(FXMVECTOR V, float S) noexcept; -#endif /* !_XM_NO_XMVECTOR_OVERLOADS_ */ - -//------------------------------------------------------------------------------ -// Matrix type: Sixteen 32 bit floating point components aligned on a -// 16 byte boundary and mapped to four hardware vector registers - -struct XMMATRIX; - -// Fix-up for (1st) XMMATRIX parameter to pass in-register for ARM64 and vector -// call; by reference otherwise -#if (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ - defined(_M_ARM64EC) || _XM_VECTORCALL_ || __aarch64__) && \ - !defined(_XM_NO_INTRINSICS_) -typedef const XMMATRIX FXMMATRIX; -#else -typedef const XMMATRIX& FXMMATRIX; -#endif - -// Fix-up for (2nd+) XMMATRIX parameters to pass by reference -typedef const XMMATRIX& CXMMATRIX; - -#ifdef _XM_NO_INTRINSICS_ -struct XMMATRIX -#else -XM_ALIGNED_STRUCT(16) -XMMATRIX -#endif -{ -#ifdef _XM_NO_INTRINSICS_ - union { - XMVECTOR r[4]; - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - float _41, _42, _43, _44; - }; - float m[4][4]; - }; -#else - XMVECTOR r[4]; -#endif - - XMMATRIX() = default; - - XMMATRIX(const XMMATRIX&) = default; - -#if defined(_MSC_VER) && (_MSC_FULL_VER < 191426431) - XMMATRIX& operator=(const XMMATRIX& M) noexcept { - r[0] = M.r[0]; - r[1] = M.r[1]; - r[2] = M.r[2]; - r[3] = M.r[3]; - return *this; - } -#else - XMMATRIX& operator=(const XMMATRIX&) = default; - - XMMATRIX(XMMATRIX&&) = default; - XMMATRIX& operator=(XMMATRIX&&) = default; -#endif - - constexpr XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, - CXMVECTOR R3) noexcept - : r{R0, R1, R2, R3} {} - XMMATRIX(float m00, float m01, float m02, float m03, float m10, float m11, - float m12, float m13, float m20, float m21, float m22, float m23, - float m30, float m31, float m32, float m33) noexcept; - explicit XMMATRIX(_In_reads_(16) const float* pArray) noexcept; - -#ifdef _XM_NO_INTRINSICS_ - float operator()(size_t Row, size_t Column) const noexcept { - return m[Row][Column]; - } - float& operator()(size_t Row, size_t Column) noexcept { - return m[Row][Column]; - } -#endif - - XMMATRIX operator+() const noexcept { return *this; } - XMMATRIX operator-() const noexcept; - - XMMATRIX& XM_CALLCONV operator+=(FXMMATRIX M) noexcept; - XMMATRIX& XM_CALLCONV operator-=(FXMMATRIX M) noexcept; - XMMATRIX& XM_CALLCONV operator*=(FXMMATRIX M) noexcept; - XMMATRIX& operator*=(float S) noexcept; - XMMATRIX& operator/=(float S) noexcept; - - XMMATRIX XM_CALLCONV operator+(FXMMATRIX M) const noexcept; - XMMATRIX XM_CALLCONV operator-(FXMMATRIX M) const noexcept; - XMMATRIX XM_CALLCONV operator*(FXMMATRIX M) const noexcept; - XMMATRIX operator*(float S) const noexcept; - XMMATRIX operator/(float S) const noexcept; - - friend XMMATRIX XM_CALLCONV operator*(float S, FXMMATRIX M) noexcept; -}; - -//------------------------------------------------------------------------------ -// 2D Vector; 32 bit floating point components -struct XMFLOAT2 { - float x; - float y; - - XMFLOAT2() = default; - - XMFLOAT2(const XMFLOAT2&) = default; - XMFLOAT2& operator=(const XMFLOAT2&) = default; - - XMFLOAT2(XMFLOAT2&&) = default; - XMFLOAT2& operator=(XMFLOAT2&&) = default; - - constexpr XMFLOAT2(float _x, float _y) noexcept : x(_x), y(_y) {} - explicit XMFLOAT2(_In_reads_(2) const float* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMFLOAT2&) const = default; - auto operator<=>(const XMFLOAT2&) const = default; -#endif -}; - -// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary -XM_ALIGNED_STRUCT(16) XMFLOAT2A : public XMFLOAT2 { using XMFLOAT2::XMFLOAT2; }; - -//------------------------------------------------------------------------------ -// 2D Vector; 32 bit signed integer components -struct XMINT2 { - int32_t x; - int32_t y; - - XMINT2() = default; - - XMINT2(const XMINT2&) = default; - XMINT2& operator=(const XMINT2&) = default; - - XMINT2(XMINT2&&) = default; - XMINT2& operator=(XMINT2&&) = default; - - constexpr XMINT2(int32_t _x, int32_t _y) noexcept : x(_x), y(_y) {} - explicit XMINT2(_In_reads_(2) const int32_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMINT2&) const = default; - auto operator<=>(const XMINT2&) const = default; -#endif -}; - -// 2D Vector; 32 bit unsigned integer components -struct XMUINT2 { - uint32_t x; - uint32_t y; - - XMUINT2() = default; - - XMUINT2(const XMUINT2&) = default; - XMUINT2& operator=(const XMUINT2&) = default; - - XMUINT2(XMUINT2&&) = default; - XMUINT2& operator=(XMUINT2&&) = default; - - constexpr XMUINT2(uint32_t _x, uint32_t _y) noexcept : x(_x), y(_y) {} - explicit XMUINT2(_In_reads_(2) const uint32_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMUINT2&) const = default; - auto operator<=>(const XMUINT2&) const = default; -#endif -}; - -//------------------------------------------------------------------------------ -// 3D Vector; 32 bit floating point components -struct XMFLOAT3 { - float x; - float y; - float z; - - XMFLOAT3() = default; - - XMFLOAT3(const XMFLOAT3&) = default; - XMFLOAT3& operator=(const XMFLOAT3&) = default; - - XMFLOAT3(XMFLOAT3&&) = default; - XMFLOAT3& operator=(XMFLOAT3&&) = default; - - constexpr XMFLOAT3(float _x, float _y, float _z) noexcept - : x(_x), y(_y), z(_z) {} - explicit XMFLOAT3(_In_reads_(3) const float* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} -}; - -// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary -XM_ALIGNED_STRUCT(16) XMFLOAT3A : public XMFLOAT3 { using XMFLOAT3::XMFLOAT3; }; - -//------------------------------------------------------------------------------ -// 3D Vector; 32 bit signed integer components -struct XMINT3 { - int32_t x; - int32_t y; - int32_t z; - - XMINT3() = default; - - XMINT3(const XMINT3&) = default; - XMINT3& operator=(const XMINT3&) = default; - - XMINT3(XMINT3&&) = default; - XMINT3& operator=(XMINT3&&) = default; - - constexpr XMINT3(int32_t _x, int32_t _y, int32_t _z) noexcept - : x(_x), y(_y), z(_z) {} - explicit XMINT3(_In_reads_(3) const int32_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMINT3&) const = default; - auto operator<=>(const XMINT3&) const = default; -#endif -}; - -// 3D Vector; 32 bit unsigned integer components -struct XMUINT3 { - uint32_t x; - uint32_t y; - uint32_t z; - - XMUINT3() = default; - - XMUINT3(const XMUINT3&) = default; - XMUINT3& operator=(const XMUINT3&) = default; - - XMUINT3(XMUINT3&&) = default; - XMUINT3& operator=(XMUINT3&&) = default; - - constexpr XMUINT3(uint32_t _x, uint32_t _y, uint32_t _z) noexcept - : x(_x), y(_y), z(_z) {} - explicit XMUINT3(_In_reads_(3) const uint32_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMUINT3&) const = default; - auto operator<=>(const XMUINT3&) const = default; -#endif -}; - -//------------------------------------------------------------------------------ -// 4D Vector; 32 bit floating point components -struct XMFLOAT4 { - float x; - float y; - float z; - float w; - - XMFLOAT4() = default; - - XMFLOAT4(const XMFLOAT4&) = default; - XMFLOAT4& operator=(const XMFLOAT4&) = default; - - XMFLOAT4(XMFLOAT4&&) = default; - XMFLOAT4& operator=(XMFLOAT4&&) = default; - - constexpr XMFLOAT4(float _x, float _y, float _z, float _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMFLOAT4(_In_reads_(4) const float* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMFLOAT4&) const = default; - auto operator<=>(const XMFLOAT4&) const = default; -#endif -}; - -// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary -XM_ALIGNED_STRUCT(16) XMFLOAT4A : public XMFLOAT4 { using XMFLOAT4::XMFLOAT4; }; - -//------------------------------------------------------------------------------ -// 4D Vector; 32 bit signed integer components -struct XMINT4 { - int32_t x; - int32_t y; - int32_t z; - int32_t w; - - XMINT4() = default; - - XMINT4(const XMINT4&) = default; - XMINT4& operator=(const XMINT4&) = default; - - XMINT4(XMINT4&&) = default; - XMINT4& operator=(XMINT4&&) = default; - - constexpr XMINT4(int32_t _x, int32_t _y, int32_t _z, int32_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMINT4(_In_reads_(4) const int32_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMINT4&) const = default; - auto operator<=>(const XMINT4&) const = default; -#endif -}; - -// 4D Vector; 32 bit unsigned integer components -struct XMUINT4 { - uint32_t x; - uint32_t y; - uint32_t z; - uint32_t w; - - XMUINT4() = default; - - XMUINT4(const XMUINT4&) = default; - XMUINT4& operator=(const XMUINT4&) = default; - - XMUINT4(XMUINT4&&) = default; - XMUINT4& operator=(XMUINT4&&) = default; - - constexpr XMUINT4(uint32_t _x, uint32_t _y, uint32_t _z, - uint32_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMUINT4(_In_reads_(4) const uint32_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - -#if (__cplusplus >= 202002L) - bool operator==(const XMUINT4&) const = default; - auto operator<=>(const XMUINT4&) const = default; -#endif -}; - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -#pragma clang diagnostic ignored "-Wnested-anon-types" -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" -#endif - -//------------------------------------------------------------------------------ -// 3x3 Matrix: 32 bit floating point components -struct XMFLOAT3X3 { - union { - struct { - float _11, _12, _13; - float _21, _22, _23; - float _31, _32, _33; - }; - float m[3][3]; - }; - - XMFLOAT3X3() = default; - - XMFLOAT3X3(const XMFLOAT3X3&) = default; - XMFLOAT3X3& operator=(const XMFLOAT3X3&) = default; - - XMFLOAT3X3(XMFLOAT3X3&&) = default; - XMFLOAT3X3& operator=(XMFLOAT3X3&&) = default; - - constexpr XMFLOAT3X3(float m00, float m01, float m02, float m10, float m11, - float m12, float m20, float m21, float m22) noexcept - : _11(m00), - _12(m01), - _13(m02), - _21(m10), - _22(m11), - _23(m12), - _31(m20), - _32(m21), - _33(m22) {} - explicit XMFLOAT3X3(_In_reads_(9) const float* pArray) noexcept; - - float operator()(size_t Row, size_t Column) const noexcept { - return m[Row][Column]; - } - float& operator()(size_t Row, size_t Column) noexcept { - return m[Row][Column]; - } - -#if (__cplusplus >= 202002L) - bool operator==(const XMFLOAT3X3&) const = delete; - auto operator<=>(const XMFLOAT3X3&) const = delete; -#endif -}; - -//------------------------------------------------------------------------------ -// 4x3 Row-major Matrix: 32 bit floating point components -struct XMFLOAT4X3 { - union { - struct { - float _11, _12, _13; - float _21, _22, _23; - float _31, _32, _33; - float _41, _42, _43; - }; - float m[4][3]; - float f[12]; - }; - - XMFLOAT4X3() = default; - - XMFLOAT4X3(const XMFLOAT4X3&) = default; - XMFLOAT4X3& operator=(const XMFLOAT4X3&) = default; - - XMFLOAT4X3(XMFLOAT4X3&&) = default; - XMFLOAT4X3& operator=(XMFLOAT4X3&&) = default; - - constexpr XMFLOAT4X3(float m00, float m01, float m02, float m10, float m11, - float m12, float m20, float m21, float m22, float m30, - float m31, float m32) noexcept - : _11(m00), - _12(m01), - _13(m02), - _21(m10), - _22(m11), - _23(m12), - _31(m20), - _32(m21), - _33(m22), - _41(m30), - _42(m31), - _43(m32) {} - explicit XMFLOAT4X3(_In_reads_(12) const float* pArray) noexcept; - - float operator()(size_t Row, size_t Column) const noexcept { - return m[Row][Column]; - } - float& operator()(size_t Row, size_t Column) noexcept { - return m[Row][Column]; - } - -#if (__cplusplus >= 202002L) - bool operator==(const XMFLOAT4X3&) const = delete; - auto operator<=>(const XMFLOAT4X3&) const = delete; -#endif -}; - -// 4x3 Row-major Matrix: 32 bit floating point components aligned on a 16 byte -// boundary -XM_ALIGNED_STRUCT(16) XMFLOAT4X3A : public XMFLOAT4X3 { - using XMFLOAT4X3::XMFLOAT4X3; -}; - -//------------------------------------------------------------------------------ -// 3x4 Column-major Matrix: 32 bit floating point components -struct XMFLOAT3X4 { - union { - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - }; - float m[3][4]; - float f[12]; - }; - - XMFLOAT3X4() = default; - - XMFLOAT3X4(const XMFLOAT3X4&) = default; - XMFLOAT3X4& operator=(const XMFLOAT3X4&) = default; - - XMFLOAT3X4(XMFLOAT3X4&&) = default; - XMFLOAT3X4& operator=(XMFLOAT3X4&&) = default; - - constexpr XMFLOAT3X4(float m00, float m01, float m02, float m03, float m10, - float m11, float m12, float m13, float m20, float m21, - float m22, float m23) noexcept - : _11(m00), - _12(m01), - _13(m02), - _14(m03), - _21(m10), - _22(m11), - _23(m12), - _24(m13), - _31(m20), - _32(m21), - _33(m22), - _34(m23) {} - explicit XMFLOAT3X4(_In_reads_(12) const float* pArray) noexcept; - - float operator()(size_t Row, size_t Column) const noexcept { - return m[Row][Column]; - } - float& operator()(size_t Row, size_t Column) noexcept { - return m[Row][Column]; - } - -#if (__cplusplus >= 202002L) - bool operator==(const XMFLOAT3X4&) const = delete; - auto operator<=>(const XMFLOAT3X4&) const = delete; -#endif -}; - -// 3x4 Column-major Matrix: 32 bit floating point components aligned on a 16 -// byte boundary -XM_ALIGNED_STRUCT(16) XMFLOAT3X4A : public XMFLOAT3X4 { - using XMFLOAT3X4::XMFLOAT3X4; -}; - -//------------------------------------------------------------------------------ -// 4x4 Matrix: 32 bit floating point components -struct XMFLOAT4X4 { - union { - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - float _41, _42, _43, _44; - }; - float m[4][4]; - }; - - XMFLOAT4X4() = default; - - XMFLOAT4X4(const XMFLOAT4X4&) = default; - XMFLOAT4X4& operator=(const XMFLOAT4X4&) = default; - - XMFLOAT4X4(XMFLOAT4X4&&) = default; - XMFLOAT4X4& operator=(XMFLOAT4X4&&) = default; - - constexpr XMFLOAT4X4(float m00, float m01, float m02, float m03, float m10, - float m11, float m12, float m13, float m20, float m21, - float m22, float m23, float m30, float m31, float m32, - float m33) noexcept - : _11(m00), - _12(m01), - _13(m02), - _14(m03), - _21(m10), - _22(m11), - _23(m12), - _24(m13), - _31(m20), - _32(m21), - _33(m22), - _34(m23), - _41(m30), - _42(m31), - _43(m32), - _44(m33) {} - explicit XMFLOAT4X4(_In_reads_(16) const float* pArray) noexcept; - - float operator()(size_t Row, size_t Column) const noexcept { - return m[Row][Column]; - } - float& operator()(size_t Row, size_t Column) noexcept { - return m[Row][Column]; - } - -#if (__cplusplus >= 202002L) - bool operator==(const XMFLOAT4X4&) const = delete; - auto operator<=>(const XMFLOAT4X4&) const = delete; -#endif -}; - -// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary -XM_ALIGNED_STRUCT(16) XMFLOAT4X4A : public XMFLOAT4X4 { - using XMFLOAT4X4::XMFLOAT4X4; -}; - -//////////////////////////////////////////////////////////////////////////////// - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * Data conversion operations - * - ****************************************************************************/ - -XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat(FXMVECTOR VInt, - uint32_t DivExponent) noexcept; -XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt(FXMVECTOR VFloat, - uint32_t MulExponent) noexcept; -XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat(FXMVECTOR VUInt, - uint32_t DivExponent) noexcept; -XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt(FXMVECTOR VFloat, - uint32_t MulExponent) noexcept; - -#if defined(__XNAMATH_H__) && defined(XMVectorSetBinaryConstant) -#undef XMVectorSetBinaryConstant -#undef XMVectorSplatConstant -#undef XMVectorSplatConstantInt -#endif - -XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1, - uint32_t C2, - uint32_t C3) noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatConstant(int32_t IntConstant, - uint32_t DivExponent) noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatConstantInt(int32_t IntConstant) noexcept; - -/**************************************************************************** - * - * Load operations - * - ****************************************************************************/ - -XMVECTOR XM_CALLCONV XMLoadInt(_In_ const uint32_t* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat(_In_ const float* pSource) noexcept; - -XMVECTOR XM_CALLCONV XMLoadInt2(_In_reads_(2) const uint32_t* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadInt2A(_In_reads_(2) - const uint32_t* PSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat2(_In_ const XMFLOAT2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat2A(_In_ const XMFLOAT2A* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadSInt2(_In_ const XMINT2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUInt2(_In_ const XMUINT2* pSource) noexcept; - -XMVECTOR XM_CALLCONV XMLoadInt3(_In_reads_(3) const uint32_t* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadInt3A(_In_reads_(3) - const uint32_t* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat3(_In_ const XMFLOAT3* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat3A(_In_ const XMFLOAT3A* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadSInt3(_In_ const XMINT3* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUInt3(_In_ const XMUINT3* pSource) noexcept; - -XMVECTOR XM_CALLCONV XMLoadInt4(_In_reads_(4) const uint32_t* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadInt4A(_In_reads_(4) - const uint32_t* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat4(_In_ const XMFLOAT4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat4A(_In_ const XMFLOAT4A* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadSInt4(_In_ const XMINT4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUInt4(_In_ const XMUINT4* pSource) noexcept; - -XMMATRIX XM_CALLCONV XMLoadFloat3x3(_In_ const XMFLOAT3X3* pSource) noexcept; -XMMATRIX XM_CALLCONV XMLoadFloat4x3(_In_ const XMFLOAT4X3* pSource) noexcept; -XMMATRIX XM_CALLCONV XMLoadFloat4x3A(_In_ const XMFLOAT4X3A* pSource) noexcept; -XMMATRIX XM_CALLCONV XMLoadFloat3x4(_In_ const XMFLOAT3X4* pSource) noexcept; -XMMATRIX XM_CALLCONV XMLoadFloat3x4A(_In_ const XMFLOAT3X4A* pSource) noexcept; -XMMATRIX XM_CALLCONV XMLoadFloat4x4(_In_ const XMFLOAT4X4* pSource) noexcept; -XMMATRIX XM_CALLCONV XMLoadFloat4x4A(_In_ const XMFLOAT4X4A* pSource) noexcept; - -/**************************************************************************** - * - * Store operations - * - ****************************************************************************/ - -void XM_CALLCONV XMStoreInt(_Out_ uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat(_Out_ float* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreInt2(_Out_writes_(2) uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreInt2A(_Out_writes_(2) uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat2(_Out_ XMFLOAT2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat2A(_Out_ XMFLOAT2A* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreSInt2(_Out_ XMINT2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUInt2(_Out_ XMUINT2* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreInt3(_Out_writes_(3) uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreInt3A(_Out_writes_(3) uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat3(_Out_ XMFLOAT3* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat3A(_Out_ XMFLOAT3A* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreSInt3(_Out_ XMINT3* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUInt3(_Out_ XMUINT3* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreInt4(_Out_writes_(4) uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreInt4A(_Out_writes_(4) uint32_t* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat4(_Out_ XMFLOAT4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat4A(_Out_ XMFLOAT4A* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreSInt4(_Out_ XMINT4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUInt4(_Out_ XMUINT4* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreFloat3x3(_Out_ XMFLOAT3X3* pDestination, - _In_ FXMMATRIX M) noexcept; -void XM_CALLCONV XMStoreFloat4x3(_Out_ XMFLOAT4X3* pDestination, - _In_ FXMMATRIX M) noexcept; -void XM_CALLCONV XMStoreFloat4x3A(_Out_ XMFLOAT4X3A* pDestination, - _In_ FXMMATRIX M) noexcept; -void XM_CALLCONV XMStoreFloat3x4(_Out_ XMFLOAT3X4* pDestination, - _In_ FXMMATRIX M) noexcept; -void XM_CALLCONV XMStoreFloat3x4A(_Out_ XMFLOAT3X4A* pDestination, - _In_ FXMMATRIX M) noexcept; -void XM_CALLCONV XMStoreFloat4x4(_Out_ XMFLOAT4X4* pDestination, - _In_ FXMMATRIX M) noexcept; -void XM_CALLCONV XMStoreFloat4x4A(_Out_ XMFLOAT4X4A* pDestination, - _In_ FXMMATRIX M) noexcept; - -/**************************************************************************** - * - * General vector operations - * - ****************************************************************************/ - -XMVECTOR XM_CALLCONV XMVectorZero() noexcept; -XMVECTOR XM_CALLCONV XMVectorSet(float x, float y, float z, float w) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetInt(uint32_t x, uint32_t y, uint32_t z, - uint32_t w) noexcept; -XMVECTOR XM_CALLCONV XMVectorReplicate(float Value) noexcept; -XMVECTOR XM_CALLCONV XMVectorReplicatePtr(_In_ const float* pValue) noexcept; -XMVECTOR XM_CALLCONV XMVectorReplicateInt(uint32_t Value) noexcept; -XMVECTOR XM_CALLCONV -XMVectorReplicateIntPtr(_In_ const uint32_t* pValue) noexcept; -XMVECTOR XM_CALLCONV XMVectorTrueInt() noexcept; -XMVECTOR XM_CALLCONV XMVectorFalseInt() noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatY(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatZ(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatW(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatOne() noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatInfinity() noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatQNaN() noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatEpsilon() noexcept; -XMVECTOR XM_CALLCONV XMVectorSplatSignMask() noexcept; - -float XM_CALLCONV XMVectorGetByIndex(FXMVECTOR V, size_t i) noexcept; -float XM_CALLCONV XMVectorGetX(FXMVECTOR V) noexcept; -float XM_CALLCONV XMVectorGetY(FXMVECTOR V) noexcept; -float XM_CALLCONV XMVectorGetZ(FXMVECTOR V) noexcept; -float XM_CALLCONV XMVectorGetW(FXMVECTOR V) noexcept; - -void XM_CALLCONV XMVectorGetByIndexPtr(_Out_ float* f, _In_ FXMVECTOR V, - _In_ size_t i) noexcept; -void XM_CALLCONV XMVectorGetXPtr(_Out_ float* x, _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorGetYPtr(_Out_ float* y, _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorGetZPtr(_Out_ float* z, _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorGetWPtr(_Out_ float* w, _In_ FXMVECTOR V) noexcept; - -uint32_t XM_CALLCONV XMVectorGetIntByIndex(FXMVECTOR V, size_t i) noexcept; -uint32_t XM_CALLCONV XMVectorGetIntX(FXMVECTOR V) noexcept; -uint32_t XM_CALLCONV XMVectorGetIntY(FXMVECTOR V) noexcept; -uint32_t XM_CALLCONV XMVectorGetIntZ(FXMVECTOR V) noexcept; -uint32_t XM_CALLCONV XMVectorGetIntW(FXMVECTOR V) noexcept; - -void XM_CALLCONV XMVectorGetIntByIndexPtr(_Out_ uint32_t* x, _In_ FXMVECTOR V, - _In_ size_t i) noexcept; -void XM_CALLCONV XMVectorGetIntXPtr(_Out_ uint32_t* x, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorGetIntYPtr(_Out_ uint32_t* y, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorGetIntZPtr(_Out_ uint32_t* z, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorGetIntWPtr(_Out_ uint32_t* w, - _In_ FXMVECTOR V) noexcept; - -XMVECTOR XM_CALLCONV XMVectorSetByIndex(FXMVECTOR V, float f, - size_t i) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetX(FXMVECTOR V, float x) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetY(FXMVECTOR V, float y) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetZ(FXMVECTOR V, float z) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetW(FXMVECTOR V, float w) noexcept; - -XMVECTOR XM_CALLCONV XMVectorSetByIndexPtr(_In_ FXMVECTOR V, - _In_ const float* f, - _In_ size_t i) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetXPtr(_In_ FXMVECTOR V, - _In_ const float* x) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetYPtr(_In_ FXMVECTOR V, - _In_ const float* y) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetZPtr(_In_ FXMVECTOR V, - _In_ const float* z) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetWPtr(_In_ FXMVECTOR V, - _In_ const float* w) noexcept; - -XMVECTOR XM_CALLCONV XMVectorSetIntByIndex(FXMVECTOR V, uint32_t x, - size_t i) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w) noexcept; - -XMVECTOR XM_CALLCONV XMVectorSetIntByIndexPtr(_In_ FXMVECTOR V, - _In_ const uint32_t* x, - _In_ size_t i) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntXPtr(_In_ FXMVECTOR V, - _In_ const uint32_t* x) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntYPtr(_In_ FXMVECTOR V, - _In_ const uint32_t* y) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntZPtr(_In_ FXMVECTOR V, - _In_ const uint32_t* z) noexcept; -XMVECTOR XM_CALLCONV XMVectorSetIntWPtr(_In_ FXMVECTOR V, - _In_ const uint32_t* w) noexcept; - -#if defined(__XNAMATH_H__) && defined(XMVectorSwizzle) -#undef XMVectorSwizzle -#endif - -XMVECTOR XM_CALLCONV XMVectorSwizzle(FXMVECTOR V, uint32_t E0, uint32_t E1, - uint32_t E2, uint32_t E3) noexcept; -XMVECTOR XM_CALLCONV XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, - uint32_t PermuteX, uint32_t PermuteY, - uint32_t PermuteZ, - uint32_t PermuteW) noexcept; -XMVECTOR XM_CALLCONV XMVectorSelectControl(uint32_t VectorIndex0, - uint32_t VectorIndex1, - uint32_t VectorIndex2, - uint32_t VectorIndex3) noexcept; -XMVECTOR XM_CALLCONV XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR Control) noexcept; -XMVECTOR XM_CALLCONV XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2) noexcept; - -#if defined(__XNAMATH_H__) && defined(XMVectorShiftLeft) -#undef XMVectorShiftLeft -#undef XMVectorRotateLeft -#undef XMVectorRotateRight -#undef XMVectorInsert -#endif - -XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, - uint32_t Elements) noexcept; -XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V, - uint32_t Elements) noexcept; -XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, - uint32_t Elements) noexcept; -XMVECTOR XM_CALLCONV XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, - uint32_t VSLeftRotateElements, - uint32_t Select0, uint32_t Select1, - uint32_t Select2, - uint32_t Select3) noexcept; - -XMVECTOR XM_CALLCONV XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorEqualR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorEqualIntR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V, - _In_ FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR Epsilon) noexcept; -XMVECTOR XM_CALLCONV XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorGreaterR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorGreaterOrEqual(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorGreaterOrEqualR(_Out_ uint32_t* pCR, - _In_ FXMVECTOR V1, - _In_ FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorLess(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; -XMVECTOR XM_CALLCONV XMVectorInBoundsR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V, - _In_ FXMVECTOR Bounds) noexcept; - -XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorIsInfinite(FXMVECTOR V) noexcept; - -XMVECTOR XM_CALLCONV XMVectorMin(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorMax(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorTruncate(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorFloor(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorCeiling(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, - FXMVECTOR Max) noexcept; -XMVECTOR XM_CALLCONV XMVectorSaturate(FXMVECTOR V) noexcept; - -XMVECTOR XM_CALLCONV XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; - -XMVECTOR XM_CALLCONV XMVectorNegate(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorSum(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorSubtractAngles(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR V3) noexcept; -XMVECTOR XM_CALLCONV XMVectorDivide(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorNegativeMultiplySubtract(FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR V3) noexcept; -XMVECTOR XM_CALLCONV XMVectorScale(FXMVECTOR V, float ScaleFactor) noexcept; -XMVECTOR XM_CALLCONV XMVectorReciprocalEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorReciprocal(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSqrtEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSqrt(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorReciprocalSqrtEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorExp10(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorExpE(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorLog(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorPow(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorAbs(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorMod(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVectorModAngles(FXMVECTOR Angles) noexcept; -XMVECTOR XM_CALLCONV XMVectorSin(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSinEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorCos(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorCosEst(FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorSinCos(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, - _In_ FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorTan(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorTanEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorSinH(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorCosH(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorTanH(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorASin(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorASinEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorACos(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorACosEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorATan(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorATanEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVectorATan2(FXMVECTOR Y, FXMVECTOR X) noexcept; -XMVECTOR XM_CALLCONV XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X) noexcept; -XMVECTOR XM_CALLCONV XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, float t) noexcept; -XMVECTOR XM_CALLCONV XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, - FXMVECTOR T) noexcept; -XMVECTOR XM_CALLCONV XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, - FXMVECTOR Position1, GXMVECTOR Tangent1, - float t) noexcept; -XMVECTOR XM_CALLCONV XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, - FXMVECTOR Position1, GXMVECTOR Tangent1, - HXMVECTOR T) noexcept; -XMVECTOR XM_CALLCONV XMVectorCatmullRom(FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, - GXMVECTOR Position3, float t) noexcept; -XMVECTOR XM_CALLCONV XMVectorCatmullRomV(FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, - GXMVECTOR Position3, - HXMVECTOR T) noexcept; -XMVECTOR XM_CALLCONV XMVectorBaryCentric(FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, float f, - float g) noexcept; -XMVECTOR XM_CALLCONV XMVectorBaryCentricV(FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, GXMVECTOR F, - HXMVECTOR G) noexcept; - -/**************************************************************************** - * - * 2D vector operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR Epsilon) noexcept; -bool XM_CALLCONV XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector2GreaterOrEqualR(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; - -bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept; -bool XM_CALLCONV XMVector2IsInfinite(FXMVECTOR V) noexcept; - -XMVECTOR XM_CALLCONV XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector2LengthSq(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2ReciprocalLengthEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2ReciprocalLength(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2LengthEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2Length(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2NormalizeEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2Normalize(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2ClampLength(FXMVECTOR V, float LengthMin, - float LengthMax) noexcept; -XMVECTOR XM_CALLCONV XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, - FXMVECTOR LengthMax) noexcept; -XMVECTOR XM_CALLCONV XMVector2Reflect(FXMVECTOR Incident, - FXMVECTOR Normal) noexcept; -XMVECTOR XM_CALLCONV XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, - float RefractionIndex) noexcept; -XMVECTOR XM_CALLCONV XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, - FXMVECTOR RefractionIndex) noexcept; -XMVECTOR XM_CALLCONV XMVector2Orthogonal(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, - FXMVECTOR N2) noexcept; -XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormals(FXMVECTOR N1, - FXMVECTOR N2) noexcept; -XMVECTOR XM_CALLCONV XMVector2AngleBetweenVectors(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector2LinePointDistance(FXMVECTOR LinePoint1, - FXMVECTOR LinePoint2, - FXMVECTOR Point) noexcept; -XMVECTOR XM_CALLCONV XMVector2IntersectLine(FXMVECTOR Line1Point1, - FXMVECTOR Line1Point2, - FXMVECTOR Line2Point1, - GXMVECTOR Line2Point2) noexcept; -XMVECTOR XM_CALLCONV XMVector2Transform(FXMVECTOR V, FXMMATRIX M) noexcept; -XMFLOAT4* XM_CALLCONV XMVector2TransformStream( - _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) - XMFLOAT4* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) - const XMFLOAT2* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; -XMVECTOR XM_CALLCONV XMVector2TransformCoord(FXMVECTOR V, FXMMATRIX M) noexcept; -XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream( - _Out_writes_bytes_(sizeof(XMFLOAT2) + OutputStride * (VectorCount - 1)) - XMFLOAT2* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) - const XMFLOAT2* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; -XMVECTOR XM_CALLCONV XMVector2TransformNormal(FXMVECTOR V, - FXMMATRIX M) noexcept; -XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream( - _Out_writes_bytes_(sizeof(XMFLOAT2) + OutputStride * (VectorCount - 1)) - XMFLOAT2* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) - const XMFLOAT2* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; - -/**************************************************************************** - * - * 3D vector operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR Epsilon) noexcept; -bool XM_CALLCONV XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector3GreaterOrEqualR(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; - -bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept; -bool XM_CALLCONV XMVector3IsInfinite(FXMVECTOR V) noexcept; - -XMVECTOR XM_CALLCONV XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector3LengthSq(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3ReciprocalLengthEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3ReciprocalLength(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3LengthEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3Length(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3NormalizeEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3Normalize(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3ClampLength(FXMVECTOR V, float LengthMin, - float LengthMax) noexcept; -XMVECTOR XM_CALLCONV XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, - FXMVECTOR LengthMax) noexcept; -XMVECTOR XM_CALLCONV XMVector3Reflect(FXMVECTOR Incident, - FXMVECTOR Normal) noexcept; -XMVECTOR XM_CALLCONV XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, - float RefractionIndex) noexcept; -XMVECTOR XM_CALLCONV XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, - FXMVECTOR RefractionIndex) noexcept; -XMVECTOR XM_CALLCONV XMVector3Orthogonal(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, - FXMVECTOR N2) noexcept; -XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormals(FXMVECTOR N1, - FXMVECTOR N2) noexcept; -XMVECTOR XM_CALLCONV XMVector3AngleBetweenVectors(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector3LinePointDistance(FXMVECTOR LinePoint1, - FXMVECTOR LinePoint2, - FXMVECTOR Point) noexcept; -void XM_CALLCONV XMVector3ComponentsFromNormal(_Out_ XMVECTOR* pParallel, - _Out_ XMVECTOR* pPerpendicular, - _In_ FXMVECTOR V, - _In_ FXMVECTOR Normal) noexcept; -XMVECTOR XM_CALLCONV XMVector3Rotate(FXMVECTOR V, - FXMVECTOR RotationQuaternion) noexcept; -XMVECTOR XM_CALLCONV -XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion) noexcept; -XMVECTOR XM_CALLCONV XMVector3Transform(FXMVECTOR V, FXMMATRIX M) noexcept; -XMFLOAT4* XM_CALLCONV XMVector3TransformStream( - _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) - XMFLOAT4* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) - const XMFLOAT3* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; -XMVECTOR XM_CALLCONV XMVector3TransformCoord(FXMVECTOR V, FXMMATRIX M) noexcept; -XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream( - _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) - XMFLOAT3* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) - const XMFLOAT3* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; -XMVECTOR XM_CALLCONV XMVector3TransformNormal(FXMVECTOR V, - FXMMATRIX M) noexcept; -XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream( - _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) - XMFLOAT3* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) - const XMFLOAT3* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; -XMVECTOR XM_CALLCONV XMVector3Project(FXMVECTOR V, float ViewportX, - float ViewportY, float ViewportWidth, - float ViewportHeight, float ViewportMinZ, - float ViewportMaxZ, FXMMATRIX Projection, - CXMMATRIX View, CXMMATRIX World) noexcept; -XMFLOAT3* XM_CALLCONV XMVector3ProjectStream( - _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) - XMFLOAT3* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) - const XMFLOAT3* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, _In_ float ViewportX, - _In_ float ViewportY, _In_ float ViewportWidth, _In_ float ViewportHeight, - _In_ float ViewportMinZ, _In_ float ViewportMaxZ, _In_ FXMMATRIX Projection, - _In_ CXMMATRIX View, _In_ CXMMATRIX World) noexcept; -XMVECTOR XM_CALLCONV XMVector3Unproject(FXMVECTOR V, float ViewportX, - float ViewportY, float ViewportWidth, - float ViewportHeight, - float ViewportMinZ, float ViewportMaxZ, - FXMMATRIX Projection, CXMMATRIX View, - CXMMATRIX World) noexcept; -XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream( - _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) - XMFLOAT3* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) - const XMFLOAT3* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, _In_ float ViewportX, - _In_ float ViewportY, _In_ float ViewportWidth, _In_ float ViewportHeight, - _In_ float ViewportMinZ, _In_ float ViewportMaxZ, _In_ FXMMATRIX Projection, - _In_ CXMMATRIX View, _In_ CXMMATRIX World) noexcept; - -/**************************************************************************** - * - * 4D vector operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR Epsilon) noexcept; -bool XM_CALLCONV XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -uint32_t XM_CALLCONV XMVector4GreaterOrEqualR(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; -bool XM_CALLCONV XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; - -bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept; -bool XM_CALLCONV XMVector4IsInfinite(FXMVECTOR V) noexcept; - -XMVECTOR XM_CALLCONV XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, - FXMVECTOR V3) noexcept; -XMVECTOR XM_CALLCONV XMVector4LengthSq(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4ReciprocalLengthEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4ReciprocalLength(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4LengthEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4Length(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4NormalizeEst(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4Normalize(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4ClampLength(FXMVECTOR V, float LengthMin, - float LengthMax) noexcept; -XMVECTOR XM_CALLCONV XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, - FXMVECTOR LengthMax) noexcept; -XMVECTOR XM_CALLCONV XMVector4Reflect(FXMVECTOR Incident, - FXMVECTOR Normal) noexcept; -XMVECTOR XM_CALLCONV XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, - float RefractionIndex) noexcept; -XMVECTOR XM_CALLCONV XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, - FXMVECTOR RefractionIndex) noexcept; -XMVECTOR XM_CALLCONV XMVector4Orthogonal(FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, - FXMVECTOR N2) noexcept; -XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormals(FXMVECTOR N1, - FXMVECTOR N2) noexcept; -XMVECTOR XM_CALLCONV XMVector4AngleBetweenVectors(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMVector4Transform(FXMVECTOR V, FXMMATRIX M) noexcept; -XMFLOAT4* XM_CALLCONV XMVector4TransformStream( - _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) - XMFLOAT4* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (VectorCount - 1)) - const XMFLOAT4* pInputStream, - _In_ size_t InputStride, _In_ size_t VectorCount, - _In_ FXMMATRIX M) noexcept; - -/**************************************************************************** - * - * Matrix operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept; -bool XM_CALLCONV XMMatrixIsInfinite(FXMMATRIX M) noexcept; -bool XM_CALLCONV XMMatrixIsIdentity(FXMMATRIX M) noexcept; - -XMMATRIX XM_CALLCONV XMMatrixMultiply(FXMMATRIX M1, CXMMATRIX M2) noexcept; -XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose(FXMMATRIX M1, - CXMMATRIX M2) noexcept; -XMMATRIX XM_CALLCONV XMMatrixTranspose(FXMMATRIX M) noexcept; -XMMATRIX XM_CALLCONV XMMatrixInverse(_Out_opt_ XMVECTOR* pDeterminant, - _In_ FXMMATRIX M) noexcept; -XMMATRIX XM_CALLCONV XMMatrixVectorTensorProduct(FXMVECTOR V1, - FXMVECTOR V2) noexcept; -XMVECTOR XM_CALLCONV XMMatrixDeterminant(FXMMATRIX M) noexcept; - -_Success_(return) bool XM_CALLCONV - XMMatrixDecompose(_Out_ XMVECTOR* outScale, _Out_ XMVECTOR* outRotQuat, - _Out_ XMVECTOR* outTrans, _In_ FXMMATRIX M) noexcept; - -XMMATRIX XM_CALLCONV XMMatrixIdentity() noexcept; -XMMATRIX XM_CALLCONV XMMatrixSet(float m00, float m01, float m02, float m03, - float m10, float m11, float m12, float m13, - float m20, float m21, float m22, float m23, - float m30, float m31, float m32, - float m33) noexcept; -XMMATRIX XM_CALLCONV XMMatrixTranslation(float OffsetX, float OffsetY, - float OffsetZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(FXMVECTOR Offset) noexcept; -XMMATRIX XM_CALLCONV XMMatrixScaling(float ScaleX, float ScaleY, - float ScaleZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale) noexcept; -XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle) noexcept; -XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle) noexcept; -XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle) noexcept; - -// Rotates about y-axis (Yaw), then x-axis (Pitch), then z-axis (Roll) -XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw(float Pitch, float Yaw, - float Roll) noexcept; - -// Rotates about y-axis (Angles.y), then x-axis (Angles.x), then z-axis -// (Angles.z) -XMMATRIX XM_CALLCONV -XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles) noexcept; - -XMMATRIX XM_CALLCONV XMMatrixRotationNormal(FXMVECTOR NormalAxis, - float Angle) noexcept; -XMMATRIX XM_CALLCONV XMMatrixRotationAxis(FXMVECTOR Axis, float Angle) noexcept; -XMMATRIX XM_CALLCONV XMMatrixRotationQuaternion(FXMVECTOR Quaternion) noexcept; -XMMATRIX XM_CALLCONV XMMatrixTransformation2D( - FXMVECTOR ScalingOrigin, float ScalingOrientation, FXMVECTOR Scaling, - FXMVECTOR RotationOrigin, float Rotation, GXMVECTOR Translation) noexcept; -XMMATRIX XM_CALLCONV XMMatrixTransformation( - FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, - FXMVECTOR Scaling, GXMVECTOR RotationOrigin, HXMVECTOR RotationQuaternion, - HXMVECTOR Translation) noexcept; -XMMATRIX XM_CALLCONV -XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, - float Rotation, FXMVECTOR Translation) noexcept; -XMMATRIX XM_CALLCONV XMMatrixAffineTransformation( - FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, - GXMVECTOR Translation) noexcept; -XMMATRIX XM_CALLCONV XMMatrixReflect(FXMVECTOR ReflectionPlane) noexcept; -XMMATRIX XM_CALLCONV XMMatrixShadow(FXMVECTOR ShadowPlane, - FXMVECTOR LightPosition) noexcept; - -XMMATRIX XM_CALLCONV XMMatrixLookAtLH(FXMVECTOR EyePosition, - FXMVECTOR FocusPosition, - FXMVECTOR UpDirection) noexcept; -XMMATRIX XM_CALLCONV XMMatrixLookAtRH(FXMVECTOR EyePosition, - FXMVECTOR FocusPosition, - FXMVECTOR UpDirection) noexcept; -XMMATRIX XM_CALLCONV XMMatrixLookToLH(FXMVECTOR EyePosition, - FXMVECTOR EyeDirection, - FXMVECTOR UpDirection) noexcept; -XMMATRIX XM_CALLCONV XMMatrixLookToRH(FXMVECTOR EyePosition, - FXMVECTOR EyeDirection, - FXMVECTOR UpDirection) noexcept; -XMMATRIX XM_CALLCONV XMMatrixPerspectiveLH(float ViewWidth, float ViewHeight, - float NearZ, float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixPerspectiveRH(float ViewWidth, float ViewHeight, - float NearZ, float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovLH(float FovAngleY, - float AspectRatio, float NearZ, - float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovRH(float FovAngleY, - float AspectRatio, float NearZ, - float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterLH(float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, float NearZ, - float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterRH(float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, float NearZ, - float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixOrthographicLH(float ViewWidth, float ViewHeight, - float NearZ, float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixOrthographicRH(float ViewWidth, float ViewHeight, - float NearZ, float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterLH(float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, float NearZ, - float FarZ) noexcept; -XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterRH(float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, float NearZ, - float FarZ) noexcept; - -/**************************************************************************** - * - * Quaternion operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; -bool XM_CALLCONV XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; - -bool XM_CALLCONV XMQuaternionIsNaN(FXMVECTOR Q) noexcept; -bool XM_CALLCONV XMQuaternionIsInfinite(FXMVECTOR Q) noexcept; -bool XM_CALLCONV XMQuaternionIsIdentity(FXMVECTOR Q) noexcept; - -XMVECTOR XM_CALLCONV XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionLengthSq(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionReciprocalLength(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionLength(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionNormalizeEst(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionNormalize(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionConjugate(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionInverse(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionLn(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionExp(FXMVECTOR Q) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, - float t) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, - FXMVECTOR T) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, - GXMVECTOR Q3, float t) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, - FXMVECTOR Q2, GXMVECTOR Q3, - HXMVECTOR T) noexcept; -void XM_CALLCONV XMQuaternionSquadSetup(_Out_ XMVECTOR* pA, _Out_ XMVECTOR* pB, - _Out_ XMVECTOR* pC, _In_ FXMVECTOR Q0, - _In_ FXMVECTOR Q1, _In_ FXMVECTOR Q2, - _In_ GXMVECTOR Q3) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, - FXMVECTOR Q2, float f, - float g) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, - FXMVECTOR Q2, GXMVECTOR F, - HXMVECTOR G) noexcept; - -XMVECTOR XM_CALLCONV XMQuaternionIdentity() noexcept; - -// Rotates about y-axis (Yaw), then x-axis (Pitch), then z-axis (Roll) -XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYaw(float Pitch, float Yaw, - float Roll) noexcept; - -// Rotates about y-axis (Angles.y), then x-axis (Angles.x), then z-axis -// (Angles.z) -XMVECTOR XM_CALLCONV -XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles) noexcept; - -XMVECTOR XM_CALLCONV XMQuaternionRotationNormal(FXMVECTOR NormalAxis, - float Angle) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionRotationAxis(FXMVECTOR Axis, - float Angle) noexcept; -XMVECTOR XM_CALLCONV XMQuaternionRotationMatrix(FXMMATRIX M) noexcept; - -void XM_CALLCONV XMQuaternionToAxisAngle(_Out_ XMVECTOR* pAxis, - _Out_ float* pAngle, - _In_ FXMVECTOR Q) noexcept; - -/**************************************************************************** - * - * Plane operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2) noexcept; -bool XM_CALLCONV XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, - FXMVECTOR Epsilon) noexcept; -bool XM_CALLCONV XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2) noexcept; - -bool XM_CALLCONV XMPlaneIsNaN(FXMVECTOR P) noexcept; -bool XM_CALLCONV XMPlaneIsInfinite(FXMVECTOR P) noexcept; - -XMVECTOR XM_CALLCONV XMPlaneDot(FXMVECTOR P, FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V) noexcept; -XMVECTOR XM_CALLCONV XMPlaneNormalizeEst(FXMVECTOR P) noexcept; -XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept; -XMVECTOR XM_CALLCONV XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, - FXMVECTOR LinePoint2) noexcept; -void XM_CALLCONV XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, - _Out_ XMVECTOR* pLinePoint2, - _In_ FXMVECTOR P1, - _In_ FXMVECTOR P2) noexcept; - -// Transforms a plane given an inverse transpose matrix -XMVECTOR XM_CALLCONV XMPlaneTransform(FXMVECTOR P, FXMMATRIX ITM) noexcept; - -// Transforms an array of planes given an inverse transpose matrix -XMFLOAT4* XM_CALLCONV XMPlaneTransformStream( - _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (PlaneCount - 1)) - XMFLOAT4* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (PlaneCount - 1)) - const XMFLOAT4* pInputStream, - _In_ size_t InputStride, _In_ size_t PlaneCount, - _In_ FXMMATRIX ITM) noexcept; - -XMVECTOR XM_CALLCONV XMPlaneFromPointNormal(FXMVECTOR Point, - FXMVECTOR Normal) noexcept; -XMVECTOR XM_CALLCONV XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, - FXMVECTOR Point3) noexcept; - -/**************************************************************************** - * - * Color operations - * - ****************************************************************************/ - -bool XM_CALLCONV XMColorEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; -bool XM_CALLCONV XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; -bool XM_CALLCONV XMColorGreater(FXMVECTOR C1, FXMVECTOR C2) noexcept; -bool XM_CALLCONV XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; -bool XM_CALLCONV XMColorLess(FXMVECTOR C1, FXMVECTOR C2) noexcept; -bool XM_CALLCONV XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; - -bool XM_CALLCONV XMColorIsNaN(FXMVECTOR C) noexcept; -bool XM_CALLCONV XMColorIsInfinite(FXMVECTOR C) noexcept; - -XMVECTOR XM_CALLCONV XMColorNegative(FXMVECTOR C) noexcept; -XMVECTOR XM_CALLCONV XMColorModulate(FXMVECTOR C1, FXMVECTOR C2) noexcept; -XMVECTOR XM_CALLCONV XMColorAdjustSaturation(FXMVECTOR C, - float Saturation) noexcept; -XMVECTOR XM_CALLCONV XMColorAdjustContrast(FXMVECTOR C, - float Contrast) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToHSV(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorHSVToRGB(FXMVECTOR hsv) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToYUV(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorYUVToRGB(FXMVECTOR yuv) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToYUV_HD(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorYUVToRGB_HD(FXMVECTOR yuv) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToYUV_UHD(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorYUVToRGB_UHD(FXMVECTOR yuv) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToXYZ(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorXYZToRGB(FXMVECTOR xyz) noexcept; - -XMVECTOR XM_CALLCONV XMColorXYZToSRGB(FXMVECTOR xyz) noexcept; -XMVECTOR XM_CALLCONV XMColorSRGBToXYZ(FXMVECTOR srgb) noexcept; - -XMVECTOR XM_CALLCONV XMColorRGBToSRGB(FXMVECTOR rgb) noexcept; -XMVECTOR XM_CALLCONV XMColorSRGBToRGB(FXMVECTOR srgb) noexcept; - -/**************************************************************************** - * - * Miscellaneous operations - * - ****************************************************************************/ - -bool XMVerifyCPUSupport() noexcept; - -XMVECTOR XM_CALLCONV XMFresnelTerm(FXMVECTOR CosIncidentAngle, - FXMVECTOR RefractionIndex) noexcept; - -bool XMScalarNearEqual(float S1, float S2, float Epsilon) noexcept; -float XMScalarModAngle(float Value) noexcept; - -float XMScalarSin(float Value) noexcept; -float XMScalarSinEst(float Value) noexcept; - -float XMScalarCos(float Value) noexcept; -float XMScalarCosEst(float Value) noexcept; - -void XMScalarSinCos(_Out_ float* pSin, _Out_ float* pCos, float Value) noexcept; -void XMScalarSinCosEst(_Out_ float* pSin, _Out_ float* pCos, - float Value) noexcept; - -float XMScalarASin(float Value) noexcept; -float XMScalarASinEst(float Value) noexcept; - -float XMScalarACos(float Value) noexcept; -float XMScalarACosEst(float Value) noexcept; - -/**************************************************************************** - * - * Templates - * - ****************************************************************************/ - -#if defined(__XNAMATH_H__) && defined(XMMin) -#undef XMMin -#undef XMMax -#endif - -template -inline T XMMin(T a, T b) noexcept { - return (a < b) ? a : b; -} -template -inline T XMMax(T a, T b) noexcept { - return (a > b) ? a : b; -} - -//------------------------------------------------------------------------------ - -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - -// PermuteHelper internal template (SSE only) -namespace MathInternal { -// Slow path fallback for permutes that do not map to a single SSE shuffle -// opcode. -template -struct PermuteHelper { - static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { - static const XMVECTORU32 selectMask = {{{ - WhichX ? 0xFFFFFFFF : 0, - WhichY ? 0xFFFFFFFF : 0, - WhichZ ? 0xFFFFFFFF : 0, - WhichW ? 0xFFFFFFFF : 0, - }}}; - - XMVECTOR shuffled1 = XM_PERMUTE_PS(v1, Shuffle); - XMVECTOR shuffled2 = XM_PERMUTE_PS(v2, Shuffle); - - XMVECTOR masked1 = _mm_andnot_ps(selectMask, shuffled1); - XMVECTOR masked2 = _mm_and_ps(selectMask, shuffled2); - - return _mm_or_ps(masked1, masked2); - } -}; - -// Fast path for permutes that only read from the first vector. -template -struct PermuteHelper { - static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR) noexcept { - return XM_PERMUTE_PS(v1, Shuffle); - } -}; - -// Fast path for permutes that only read from the second vector. -template -struct PermuteHelper { - static XMVECTOR XM_CALLCONV Permute(FXMVECTOR, FXMVECTOR v2) noexcept { - return XM_PERMUTE_PS(v2, Shuffle); - } -}; - -// Fast path for permutes that read XY from the first vector, ZW from the -// second. -template -struct PermuteHelper { - static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { - return _mm_shuffle_ps(v1, v2, Shuffle); - } -}; - -// Fast path for permutes that read XY from the second vector, ZW from the -// first. -template -struct PermuteHelper { - static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { - return _mm_shuffle_ps(v2, v1, Shuffle); - } -}; -} // namespace MathInternal - -#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ - -// General permute template -template -inline XMVECTOR XM_CALLCONV XMVectorPermute(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - static_assert(PermuteX <= 7, "PermuteX template parameter out of range"); - static_assert(PermuteY <= 7, "PermuteY template parameter out of range"); - static_assert(PermuteZ <= 7, "PermuteZ template parameter out of range"); - static_assert(PermuteW <= 7, "PermuteW template parameter out of range"); - -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - constexpr uint32_t Shuffle = - _MM_SHUFFLE(PermuteW & 3, PermuteZ & 3, PermuteY & 3, PermuteX & 3); - - constexpr bool WhichX = PermuteX > 3; - constexpr bool WhichY = PermuteY > 3; - constexpr bool WhichZ = PermuteZ > 3; - constexpr bool WhichW = PermuteW > 3; - - return MathInternal::PermuteHelper::Permute(V1, V2); -#else - - return XMVectorPermute(V1, V2, PermuteX, PermuteY, PermuteZ, PermuteW); - -#endif -} - -// Special-case permute templates -template <> -constexpr XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 2, 3>(FXMVECTOR V1, - FXMVECTOR) noexcept { - return V1; -} -template <> -constexpr XMVECTOR XM_CALLCONV -XMVectorPermute<4, 5, 6, 7>(FXMVECTOR, FXMVECTOR V2) noexcept { - return V2; -} - -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 4, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_movelh_ps(V1, V2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<6, 7, 2, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_movehl_ps(V1, V2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 1, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_unpacklo_ps(V1, V2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 6, 3, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_unpackhi_ps(V1, V2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_castpd_ps(_mm_unpackhi_pd(_mm_castps_pd(V1), _mm_castps_pd(V2))); -} -#endif - -#if defined(_XM_SSE4_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 2, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x1); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 2, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 2, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x3); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x4); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 6, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x5); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 6, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x6); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 6, 3>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x7); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 2, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x8); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 2, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0x9); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 2, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0xA); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 2, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0xB); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0xC); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0xD); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return _mm_blend_ps(V1, V2, 0xE); -} -#endif - -#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - -// If the indices are all in the range 0-3 or 4-7, then use XMVectorSwizzle -// instead The mirror cases are not spelled out here as the programmer can -// always swap the arguments (i.e. prefer permutes where the X element comes -// from the V1 vector instead of the V2 vector) - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 4, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_low_f32(V1), vget_low_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 4, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vget_low_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 5, 4>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_low_f32(V1), vrev64_f32(vget_low_f32(V2))); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 5, 4>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_low_f32(V1)), - vrev64_f32(vget_low_f32(V2))); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_high_f32(V1), vget_high_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vget_high_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 7, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_high_f32(V1), vrev64_f32(vget_high_f32(V2))); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 7, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_high_f32(V1)), - vrev64_f32(vget_high_f32(V2))); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_low_f32(V1), vget_high_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 6, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vget_high_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 7, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_low_f32(V1), vrev64_f32(vget_high_f32(V2))); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 7, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_low_f32(V1)), - vrev64_f32(vget_high_f32(V2))); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 4, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vget_low_f32(V2)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 5, 4>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vget_high_f32(V1), vrev64_f32(vget_low_f32(V2))); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 5, 4>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vcombine_f32(vrev64_f32(vget_high_f32(V1)), - vrev64_f32(vget_low_f32(V2))); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 2, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vtrnq_f32(V1, V2).val[0]; -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 5, 3, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vtrnq_f32(V1, V2).val[1]; -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 1, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vzipq_f32(V1, V2).val[0]; -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 6, 3, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vzipq_f32(V1, V2).val[1]; -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 2, 4, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vuzpq_f32(V1, V2).val[0]; -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 3, 5, 7>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vuzpq_f32(V1, V2).val[1]; -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 2, 3, 4>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vextq_f32(V1, V2, 1); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 4, 5>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vextq_f32(V1, V2, 2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 4, 5, 6>(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - return vextq_f32(V1, V2, 3); -} - -#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ - -//------------------------------------------------------------------------------ - -// General swizzle template -template -inline XMVECTOR XM_CALLCONV XMVectorSwizzle(FXMVECTOR V) noexcept { - static_assert(SwizzleX <= 3, "SwizzleX template parameter out of range"); - static_assert(SwizzleY <= 3, "SwizzleY template parameter out of range"); - static_assert(SwizzleZ <= 3, "SwizzleZ template parameter out of range"); - static_assert(SwizzleW <= 3, "SwizzleW template parameter out of range"); - -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - return XM_PERMUTE_PS(V, - _MM_SHUFFLE(SwizzleW, SwizzleZ, SwizzleY, SwizzleX)); -#else - - return XMVectorSwizzle(V, SwizzleX, SwizzleY, SwizzleZ, SwizzleW); - -#endif -} - -// Specialized swizzles -template <> -constexpr XMVECTOR XM_CALLCONV -XMVectorSwizzle<0, 1, 2, 3>(FXMVECTOR V) noexcept { - return V; -} - -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 0, 1>(FXMVECTOR V) noexcept { - return _mm_movelh_ps(V, V); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 2, 3>(FXMVECTOR V) noexcept { - return _mm_movehl_ps(V, V); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 1, 1>(FXMVECTOR V) noexcept { - return _mm_unpacklo_ps(V, V); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 3, 3>(FXMVECTOR V) noexcept { - return _mm_unpackhi_ps(V, V); -} -#endif - -#if defined(_XM_SSE3_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 2, 2>(FXMVECTOR V) noexcept { - return _mm_moveldup_ps(V); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { - return _mm_movehdup_ps(V); -} -#endif - -#if defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) && \ - defined(_XM_FAVOR_INTEL_) -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { - return _mm_broadcastss_ps(V); -} -#endif - -#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { - return vdupq_lane_f32(vget_low_f32(V), 0); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 1, 1>(FXMVECTOR V) noexcept { - return vdupq_lane_f32(vget_low_f32(V), 1); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 2, 2>(FXMVECTOR V) noexcept { - return vdupq_lane_f32(vget_high_f32(V), 0); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 3, 3, 3>(FXMVECTOR V) noexcept { - return vdupq_lane_f32(vget_high_f32(V), 1); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 3, 2>(FXMVECTOR V) noexcept { - return vrev64q_f32(V); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 0, 1>(FXMVECTOR V) noexcept { - float32x2_t vt = vget_low_f32(V); - return vcombine_f32(vt, vt); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 2, 3>(FXMVECTOR V) noexcept { - float32x2_t vt = vget_high_f32(V); - return vcombine_f32(vt, vt); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 1, 0>(FXMVECTOR V) noexcept { - float32x2_t vt = vrev64_f32(vget_low_f32(V)); - return vcombine_f32(vt, vt); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 3, 2>(FXMVECTOR V) noexcept { - float32x2_t vt = vrev64_f32(vget_high_f32(V)); - return vcombine_f32(vt, vt); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 3, 2>(FXMVECTOR V) noexcept { - return vcombine_f32(vget_low_f32(V), vrev64_f32(vget_high_f32(V))); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 2, 3>(FXMVECTOR V) noexcept { - return vcombine_f32(vrev64_f32(vget_low_f32(V)), vget_high_f32(V)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 1, 0>(FXMVECTOR V) noexcept { - return vcombine_f32(vget_high_f32(V), vrev64_f32(vget_low_f32(V))); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 0, 1>(FXMVECTOR V) noexcept { - return vcombine_f32(vrev64_f32(vget_high_f32(V)), vget_low_f32(V)); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 1, 0>(FXMVECTOR V) noexcept { - return vcombine_f32(vrev64_f32(vget_high_f32(V)), - vrev64_f32(vget_low_f32(V))); -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 2, 2>(FXMVECTOR V) noexcept { - return vtrnq_f32(V, V).val[0]; -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { - return vtrnq_f32(V, V).val[1]; -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 1, 1>(FXMVECTOR V) noexcept { - return vzipq_f32(V, V).val[0]; -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 3, 3>(FXMVECTOR V) noexcept { - return vzipq_f32(V, V).val[1]; -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 2, 0, 2>(FXMVECTOR V) noexcept { - return vuzpq_f32(V, V).val[0]; -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 3, 1, 3>(FXMVECTOR V) noexcept { - return vuzpq_f32(V, V).val[1]; -} - -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 2, 3, 0>(FXMVECTOR V) noexcept { - return vextq_f32(V, V, 1); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 0, 1>(FXMVECTOR V) noexcept { - return vextq_f32(V, V, 2); -} -template <> -inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 0, 1, 2>(FXMVECTOR V) noexcept { - return vextq_f32(V, V, 3); -} - -#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ - -//------------------------------------------------------------------------------ - -template -inline XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, - FXMVECTOR V2) noexcept { - static_assert(Elements < 4, "Elements template parameter out of range"); - return XMVectorPermute(V1, V2); -} - -template -inline XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V) noexcept { - static_assert(Elements < 4, "Elements template parameter out of range"); - return XMVectorSwizzle(V); -} - -template -inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V) noexcept { - static_assert(Elements < 4, "Elements template parameter out of range"); - return XMVectorSwizzle<(4 - Elements) & 3, (5 - Elements) & 3, - (6 - Elements) & 3, (7 - Elements) & 3>(V); -} - -template -inline XMVECTOR XM_CALLCONV XMVectorInsert(FXMVECTOR VD, - FXMVECTOR VS) noexcept { - XMVECTOR Control = XMVectorSelectControl(Select0 & 1, Select1 & 1, - Select2 & 1, Select3 & 1); - return XMVectorSelect(VD, XMVectorRotateLeft(VS), - Control); -} - -/**************************************************************************** - * - * Globals - * - ****************************************************************************/ - -// The purpose of the following global constants is to prevent redundant -// reloading of the constants when they are referenced by more than one -// separate inline math routine called within the same function. Declaring -// a constant locally within a routine is sufficient to prevent redundant -// reloads of that constant when that single routine is called multiple -// times in a function, but if the constant is used (and declared) in a -// separate math routine it would be reloaded. - -#ifndef XMGLOBALCONST -#if defined(__GNUC__) && !defined(__MINGW32__) -#define XMGLOBALCONST extern const __attribute__((weak)) -#else -#define XMGLOBALCONST extern const __declspec(selectany) -#endif -#endif - -XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = { - {{-0.16666667f, +0.0083333310f, -0.00019840874f, +2.7525562e-06f}}}; -XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = { - {{-2.3889859e-08f, -0.16665852f /*Est1*/, +0.0083139502f /*Est2*/, - -0.00018524670f /*Est3*/}}}; -XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = { - {{-0.5f, +0.041666638f, -0.0013888378f, +2.4760495e-05f}}}; -XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = { - {{-2.6051615e-07f, -0.49992746f /*Est1*/, +0.041493919f /*Est2*/, - -0.0012712436f /*Est3*/}}}; -XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = { - {{1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f}}}; -XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = { - {{2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f}}}; -XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = { - {{5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f}}}; -XMGLOBALCONST XMVECTORF32 g_XMArcCoefficients0 = { - {{+1.5707963050f, -0.2145988016f, +0.0889789874f, -0.0501743046f}}}; -XMGLOBALCONST XMVECTORF32 g_XMArcCoefficients1 = { - {{+0.0308918810f, -0.0170881256f, +0.0066700901f, -0.0012624911f}}}; -XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = { - {{-0.3333314528f, +0.1999355085f, -0.1420889944f, +0.1065626393f}}}; -XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = { - {{-0.0752896400f, +0.0429096138f, -0.0161657367f, +0.0028662257f}}}; -XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients0 = { - {{+0.999866f, +0.999866f, +0.999866f, +0.999866f}}}; -XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients1 = { - {{-0.3302995f, +0.180141f, -0.085133f, +0.0208351f}}}; -XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = { - {{2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI}}}; -XMGLOBALCONST XMVECTORF32 g_XMArcEstCoefficients = { - {{+1.5707288f, -0.2121144f, +0.0742610f, -0.0187293f}}}; -XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = { - {{XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI}}}; -XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = {{{1.0f, 0.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = {{{0.0f, 1.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = {{{0.0f, 0.0f, 1.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = {{{0.0f, 0.0f, 0.0f, 1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = {{{-1.0f, 0.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = {{{0.0f, -1.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = {{{0.0f, 0.0f, -1.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = {{{0.0f, 0.0f, 0.0f, -1.0f}}}; -XMGLOBALCONST XMVECTORU32 g_XMNegativeZero = { - {{0x80000000, 0x80000000, 0x80000000, 0x80000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMNegate3 = { - {{0x80000000, 0x80000000, 0x80000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskXY = { - {{0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMMask3 = { - {{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskX = { - {{0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskY = { - {{0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskZ = { - {{0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskW = { - {{0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF}}}; -XMGLOBALCONST XMVECTORF32 g_XMOne = {{{1.0f, 1.0f, 1.0f, 1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMOne3 = {{{1.0f, 1.0f, 1.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMZero = {{{0.0f, 0.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMTwo = {{{2.f, 2.f, 2.f, 2.f}}}; -XMGLOBALCONST XMVECTORF32 g_XMFour = {{{4.f, 4.f, 4.f, 4.f}}}; -XMGLOBALCONST XMVECTORF32 g_XMSix = {{{6.f, 6.f, 6.f, 6.f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = {{{-1.0f, -1.0f, -1.0f, -1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMOneHalf = {{{0.5f, 0.5f, 0.5f, 0.5f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = { - {{-0.5f, -0.5f, -0.5f, -0.5f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = { - {{-XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegativePi = {{{-XM_PI, -XM_PI, -XM_PI, -XM_PI}}}; -XMGLOBALCONST XMVECTORF32 g_XMHalfPi = { - {{XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2}}}; -XMGLOBALCONST XMVECTORF32 g_XMPi = {{{XM_PI, XM_PI, XM_PI, XM_PI}}}; -XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = { - {{XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI}}}; -XMGLOBALCONST XMVECTORF32 g_XMTwoPi = {{{XM_2PI, XM_2PI, XM_2PI, XM_2PI}}}; -XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = { - {{XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI}}}; -XMGLOBALCONST XMVECTORF32 g_XMEpsilon = { - {{1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f}}}; -XMGLOBALCONST XMVECTORI32 g_XMInfinity = { - {{0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000}}}; -XMGLOBALCONST XMVECTORI32 g_XMQNaN = { - {{0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000}}}; -XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = { - {{0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF}}}; -XMGLOBALCONST XMVECTORI32 g_XMAbsMask = { - {{0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF}}}; -XMGLOBALCONST XMVECTORI32 g_XMFltMin = { - {{0x00800000, 0x00800000, 0x00800000, 0x00800000}}}; -XMGLOBALCONST XMVECTORI32 g_XMFltMax = { - {{0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF}}}; -XMGLOBALCONST XMVECTORU32 g_XMNegOneMask = { - {{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskA8R8G8B8 = { - {{0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipA8R8G8B8 = { - {{0x00000000, 0x00000000, 0x00000000, 0x80000000}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = { - {{0.0f, 0.0f, 0.0f, float(0x80000000U)}}}; -XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = { - {{1.0f / (255.0f * float(0x10000)), 1.0f / (255.0f * float(0x100)), - 1.0f / 255.0f, 1.0f / (255.0f * float(0x1000000))}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskA2B10G10R10 = { - {{0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipA2B10G10R10 = { - {{0x00000200, 0x00080000, 0x20000000, 0x80000000}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = { - {{-512.0f, -512.0f * float(0x400), -512.0f * float(0x100000), - float(0x80000000U)}}}; -XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = { - {{1.0f / 511.0f, 1.0f / (511.0f * float(0x400)), - 1.0f / (511.0f * float(0x100000)), 1.0f / (3.0f * float(0x40000000))}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16 = { - {{0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = { - {{0x00008000, 0x00000000, 0x00000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = {{{-32768.0f, 0.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = { - {{1.0f / 32767.0f, 1.0f / (32767.0f * 65536.0f), 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16Z16W16 = { - {{0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000}}}; -XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = { - {{0x00008000, 0x00008000, 0x00000000, 0x00000000}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = { - {{-32768.0f, -32768.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = { - {{1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / (32767.0f * 65536.0f), - 1.0f / (32767.0f * 65536.0f)}}}; -XMGLOBALCONST XMVECTORF32 g_XMNoFraction = { - {{8388608.0f, 8388608.0f, 8388608.0f, 8388608.0f}}}; -XMGLOBALCONST XMVECTORI32 g_XMMaskByte = { - {{0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegateX = {{{-1.0f, 1.0f, 1.0f, 1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegateY = {{{1.0f, -1.0f, 1.0f, 1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegateZ = {{{1.0f, 1.0f, -1.0f, 1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMNegateW = {{{1.0f, 1.0f, 1.0f, -1.0f}}}; -XMGLOBALCONST XMVECTORU32 g_XMSelect0101 = { - {{XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1}}}; -XMGLOBALCONST XMVECTORU32 g_XMSelect1010 = { - {{XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0}}}; -XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { - {{0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD}}}; -XMGLOBALCONST XMVECTORU32 g_XMSelect1000 = { - {{XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0}}}; -XMGLOBALCONST XMVECTORU32 g_XMSelect1100 = { - {{XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0}}}; -XMGLOBALCONST XMVECTORU32 g_XMSelect1110 = { - {{XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0}}}; -XMGLOBALCONST XMVECTORU32 g_XMSelect1011 = { - {{XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = { - {{1.0f, 1.0f / 65536.0f, 0.0f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = { - {{1.0f, 1.0f, 1.0f / 65536.0f, 1.0f / 65536.0f}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipY = {{{0, 0x80000000, 0, 0}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipZ = {{{0, 0, 0x80000000, 0}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipW = {{{0, 0, 0, 0x80000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipYZ = {{{0, 0x80000000, 0x80000000, 0}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipZW = {{{0, 0, 0x80000000, 0x80000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMFlipYW = {{{0, 0x80000000, 0, 0x80000000}}}; -XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = { - {{0x3FF, 0x3FF << 10, 0x3FF << 20, static_cast(0xC0000000)}}}; -XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = { - {{0x200, 0x200 << 10, 0x200 << 20, 0}}}; -XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {{{0, 0, 0, 32768.0f * 65536.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = { - {{-512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 0}}}; -XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = { - {{1.0f, 1.0f / 1024.0f, 1.0f / (1024.0f * 1024.0f), - 1.0f / (1024.0f * 1024.0f * 1024.0f)}}}; -XMGLOBALCONST XMVECTORU32 g_XMMaskByte4 = { - {{0xFF, 0xFF00, 0xFF0000, 0xFF000000}}}; -XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = { - {{0x80, 0x8000, 0x800000, 0x00000000}}}; -XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = { - {{-128.0f, -128.0f * 256.0f, -128.0f * 65536.0f, 0}}}; -XMGLOBALCONST XMVECTORF32 g_XMFixUnsigned = { - {{32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f, - 32768.0f * 65536.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMMaxInt = { - {{65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f, - 65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMMaxUInt = { - {{65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f, - 65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMUnsignedFix = { - {{32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f, - 32768.0f * 65536.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMsrgbScale = {{{12.92f, 12.92f, 12.92f, 1.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMsrgbA = {{{0.055f, 0.055f, 0.055f, 0.0f}}}; -XMGLOBALCONST XMVECTORF32 g_XMsrgbA1 = {{{1.055f, 1.055f, 1.055f, 1.0f}}}; -XMGLOBALCONST XMVECTORI32 g_XMExponentBias = {{{127, 127, 127, 127}}}; -XMGLOBALCONST XMVECTORI32 g_XMSubnormalExponent = {{{-126, -126, -126, -126}}}; -XMGLOBALCONST XMVECTORI32 g_XMNumTrailing = {{{23, 23, 23, 23}}}; -XMGLOBALCONST XMVECTORI32 g_XMMinNormal = { - {{0x00800000, 0x00800000, 0x00800000, 0x00800000}}}; -XMGLOBALCONST XMVECTORU32 g_XMNegInfinity = { - {{0xFF800000, 0xFF800000, 0xFF800000, 0xFF800000}}}; -XMGLOBALCONST XMVECTORU32 g_XMNegQNaN = { - {{0xFFC00000, 0xFFC00000, 0xFFC00000, 0xFFC00000}}}; -XMGLOBALCONST XMVECTORI32 g_XMBin128 = { - {{0x43000000, 0x43000000, 0x43000000, 0x43000000}}}; -XMGLOBALCONST XMVECTORU32 g_XMBinNeg150 = { - {{0xC3160000, 0xC3160000, 0xC3160000, 0xC3160000}}}; -XMGLOBALCONST XMVECTORI32 g_XM253 = {{{253, 253, 253, 253}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst1 = { - {{-6.93147182e-1f, -6.93147182e-1f, -6.93147182e-1f, -6.93147182e-1f}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst2 = { - {{+2.40226462e-1f, +2.40226462e-1f, +2.40226462e-1f, +2.40226462e-1f}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst3 = { - {{-5.55036440e-2f, -5.55036440e-2f, -5.55036440e-2f, -5.55036440e-2f}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst4 = { - {{+9.61597636e-3f, +9.61597636e-3f, +9.61597636e-3f, +9.61597636e-3f}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst5 = { - {{-1.32823968e-3f, -1.32823968e-3f, -1.32823968e-3f, -1.32823968e-3f}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst6 = { - {{+1.47491097e-4f, +1.47491097e-4f, +1.47491097e-4f, +1.47491097e-4f}}}; -XMGLOBALCONST XMVECTORF32 g_XMExpEst7 = { - {{-1.08635004e-5f, -1.08635004e-5f, -1.08635004e-5f, -1.08635004e-5f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst0 = { - {{+1.442693f, +1.442693f, +1.442693f, +1.442693f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst1 = { - {{-0.721242f, -0.721242f, -0.721242f, -0.721242f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst2 = { - {{+0.479384f, +0.479384f, +0.479384f, +0.479384f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst3 = { - {{-0.350295f, -0.350295f, -0.350295f, -0.350295f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst4 = { - {{+0.248590f, +0.248590f, +0.248590f, +0.248590f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst5 = { - {{-0.145700f, -0.145700f, -0.145700f, -0.145700f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst6 = { - {{+0.057148f, +0.057148f, +0.057148f, +0.057148f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLogEst7 = { - {{-0.010578f, -0.010578f, -0.010578f, -0.010578f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLgE = { - {{+1.442695f, +1.442695f, +1.442695f, +1.442695f}}}; -XMGLOBALCONST XMVECTORF32 g_XMInvLgE = { - {{+6.93147182e-1f, +6.93147182e-1f, +6.93147182e-1f, +6.93147182e-1f}}}; -XMGLOBALCONST XMVECTORF32 g_XMLg10 = { - {{+3.321928f, +3.321928f, +3.321928f, +3.321928f}}}; -XMGLOBALCONST XMVECTORF32 g_XMInvLg10 = { - {{+3.010299956e-1f, +3.010299956e-1f, +3.010299956e-1f, +3.010299956e-1f}}}; -XMGLOBALCONST XMVECTORF32 g_UByteMax = {{{255.0f, 255.0f, 255.0f, 255.0f}}}; -XMGLOBALCONST XMVECTORF32 g_ByteMin = {{{-127.0f, -127.0f, -127.0f, -127.0f}}}; -XMGLOBALCONST XMVECTORF32 g_ByteMax = {{{127.0f, 127.0f, 127.0f, 127.0f}}}; -XMGLOBALCONST XMVECTORF32 g_ShortMin = { - {{-32767.0f, -32767.0f, -32767.0f, -32767.0f}}}; -XMGLOBALCONST XMVECTORF32 g_ShortMax = { - {{32767.0f, 32767.0f, 32767.0f, 32767.0f}}}; -XMGLOBALCONST XMVECTORF32 g_UShortMax = { - {{65535.0f, 65535.0f, 65535.0f, 65535.0f}}}; - -/**************************************************************************** - * - * Implementation - * - ****************************************************************************/ - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4068 4214 4204 4365 4616 4640 6001 6101) -// C4068/4616: ignore unknown pragmas -// C4214/4204: nonstandard extension used -// C4365/4640: Off by default noise -// C6001/6101: False positives -#endif - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") -#pragma prefast(disable : 26495, "Union initialization confuses /analyze") -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wfloat-equal" -#pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1, - uint32_t C2, - uint32_t C3) noexcept { -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = (0 - (C0 & 1)) & 0x3F800000; - vResult.u[1] = (0 - (C1 & 1)) & 0x3F800000; - vResult.u[2] = (0 - (C2 & 1)) & 0x3F800000; - vResult.u[3] = (0 - (C3 & 1)) & 0x3F800000; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = (0 - (C0 & 1)) & 0x3F800000; - vResult.u[1] = (0 - (C1 & 1)) & 0x3F800000; - vResult.u[2] = (0 - (C2 & 1)) & 0x3F800000; - vResult.u[3] = (0 - (C3 & 1)) & 0x3F800000; - return vResult.v; -#else // XM_SSE_INTRINSICS_ - static const XMVECTORU32 g_vMask1 = {{{1, 1, 1, 1}}}; - // Move the parms to a vector - __m128i vTemp = _mm_set_epi32(static_cast(C3), static_cast(C2), - static_cast(C1), static_cast(C0)); - // Mask off the low bits - vTemp = _mm_and_si128(vTemp, g_vMask1); - // 0xFFFFFFFF on true bits - vTemp = _mm_cmpeq_epi32(vTemp, g_vMask1); - // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f - vTemp = _mm_and_si128(vTemp, g_XMOne); - return _mm_castsi128_ps(vTemp); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV -XMVectorSplatConstant(int32_t IntConstant, uint32_t DivExponent) noexcept { - assert(IntConstant >= -16 && IntConstant <= 15); - assert(DivExponent < 32); -#if defined(_XM_NO_INTRINSICS_) - - using DirectX::XMConvertVectorIntToFloat; - - XMVECTORI32 V = {{{IntConstant, IntConstant, IntConstant, IntConstant}}}; - return XMConvertVectorIntToFloat(V.v, DivExponent); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Splat the int - int32x4_t vScale = vdupq_n_s32(IntConstant); - // Convert to a float - XMVECTOR vResult = vcvtq_f32_s32(vScale); - // Convert DivExponent into 1.0f/(1<(&vScale)[0]); - return vResult; -#else // XM_SSE_INTRINSICS_ - // Splat the int - __m128i vScale = _mm_set1_epi32(IntConstant); - // Convert to a float - XMVECTOR vResult = _mm_cvtepi32_ps(vScale); - // Convert DivExponent into 1.0f/(1<(uScale)); - // Multiply by the reciprocal (Perform a right shift by DivExponent) - vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(vScale)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV -XMVectorSplatConstantInt(int32_t IntConstant) noexcept { - assert(IntConstant >= -16 && IntConstant <= 15); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORI32 V = {{{IntConstant, IntConstant, IntConstant, IntConstant}}}; - return V.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t V = vdupq_n_s32(IntConstant); - return reinterpret_cast(&V)[0]; -#else // XM_SSE_INTRINSICS_ - __m128i V = _mm_set1_epi32(IntConstant); - return _mm_castsi128_ps(V); -#endif -} - -#include "DirectXMathConvert.inl" -#include "DirectXMathVector.inl" -#include "DirectXMathMatrix.inl" -#include "DirectXMathMisc.inl" - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -} // namespace DirectX +//------------------------------------------------------------------------------------- +// DirectXMath.h -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#ifndef __cplusplus +#error DirectX Math requires C++ +#endif + +#define DIRECTX_MATH_VERSION 320 + +#if defined(_MSC_VER) && (_MSC_VER < 1910) +#error DirectX Math requires Visual C++ 2017 or later. +#endif + +#if defined(_MSC_VER) && !defined(_M_ARM) && !defined(_M_ARM64) && \ + !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC) && (!_MANAGED) && \ + (!_M_CEE) && (!defined(_M_IX86_FP) || (_M_IX86_FP > 1)) && \ + !defined(_XM_NO_INTRINSICS_) && !defined(_XM_VECTORCALL_) +#define _XM_VECTORCALL_ 1 +#endif + +#if _XM_VECTORCALL_ +#define XM_CALLCONV __vectorcall +#elif defined(__GNUC__) +#define XM_CALLCONV +#else +#define XM_CALLCONV __fastcall +#endif + +#ifndef XM_DEPRECATED +#if (__cplusplus >= 201402L) +#define XM_DEPRECATED [[deprecated]] +#elif defined(__GNUC__) +#define XM_DEPRECATED __attribute__((deprecated)) +#else +#define XM_DEPRECATED \ + __declspec(deprecated( \ + "This is deprecated and will be removed in a future version.")) +#endif +#endif + +#if !defined(_XM_AVX2_INTRINSICS_) && defined(__AVX2__) && \ + !defined(_XM_NO_INTRINSICS_) +#define _XM_AVX2_INTRINSICS_ +#endif + +#if !defined(_XM_FMA3_INTRINSICS_) && defined(_XM_AVX2_INTRINSICS_) && \ + !defined(_XM_NO_INTRINSICS_) +#define _XM_FMA3_INTRINSICS_ +#endif + +#if !defined(_XM_F16C_INTRINSICS_) && defined(_XM_AVX2_INTRINSICS_) && \ + !defined(_XM_NO_INTRINSICS_) +#define _XM_F16C_INTRINSICS_ +#endif + +#if !defined(_XM_F16C_INTRINSICS_) && defined(__F16C__) && \ + !defined(_XM_NO_INTRINSICS_) +#define _XM_F16C_INTRINSICS_ +#endif + +#if defined(_XM_FMA3_INTRINSICS_) && !defined(_XM_AVX_INTRINSICS_) +#define _XM_AVX_INTRINSICS_ +#endif + +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_AVX_INTRINSICS_) +#define _XM_AVX_INTRINSICS_ +#endif + +#if !defined(_XM_AVX_INTRINSICS_) && defined(__AVX__) && \ + !defined(_XM_NO_INTRINSICS_) +#define _XM_AVX_INTRINSICS_ +#endif + +#if defined(_XM_AVX_INTRINSICS_) && !defined(_XM_SSE4_INTRINSICS_) +#define _XM_SSE4_INTRINSICS_ +#endif + +#if defined(_XM_SSE4_INTRINSICS_) && !defined(_XM_SSE3_INTRINSICS_) +#define _XM_SSE3_INTRINSICS_ +#endif + +#if defined(_XM_SSE3_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) +#define _XM_SSE_INTRINSICS_ +#endif + +#if !defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) && \ + !defined(_XM_NO_INTRINSICS_) +#if (defined(_M_IX86) || defined(_M_X64) || __i386__ || __x86_64__) && \ + !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC) +#define _XM_SSE_INTRINSICS_ +#elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ + defined(_M_ARM64EC) || __arm__ || __aarch64__ +#define _XM_ARM_NEON_INTRINSICS_ +#elif !defined(_XM_NO_INTRINSICS_) +#error DirectX Math does not support this target +#endif +#endif // !_XM_ARM_NEON_INTRINSICS_ && !_XM_SSE_INTRINSICS_ && + // !_XM_NO_INTRINSICS_ + +#if defined(_XM_SSE_INTRINSICS_) && defined(_MSC_VER) && (_MSC_VER >= 1920) && \ + !defined(__clang__) && !defined(_XM_SVML_INTRINSICS_) && \ + !defined(_XM_DISABLE_INTEL_SVML_) +#define _XM_SVML_INTRINSICS_ +#endif + +#if !defined(_XM_NO_XMVECTOR_OVERLOADS_) && \ + (defined(__clang__) || defined(__GNUC__)) && !defined(_XM_NO_INTRINSICS_) +#define _XM_NO_XMVECTOR_OVERLOADS_ +#endif + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4514 4820) +// C4514/4820: Off by default noise +#endif +#include +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#ifndef _XM_NO_INTRINSICS_ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4987) +// C4987: Off by default noise +#endif +#if defined(_MSC_VER) || defined(__MINGW32__) +#include +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#if (defined(__clang__) || defined(__GNUC__)) && (__x86_64__ || __i386__) && \ + !defined(__MINGW32__) +#include +#endif + +#ifdef _XM_SSE_INTRINSICS_ +#include +#include + +#ifdef _XM_SSE3_INTRINSICS_ +#include +#endif + +#ifdef _XM_SSE4_INTRINSICS_ +#include +#endif + +#ifdef _XM_AVX_INTRINSICS_ +#include +#endif + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && \ + (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC)) +#include +#else +#include +#endif +#endif +#endif // !_XM_NO_INTRINSICS_ + +#include "sal.h" +#include + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4005 4668) +// C4005/4668: Old header issue +#endif +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#if (__cplusplus >= 201703L) +#define XM_ALIGNED_DATA(x) alignas(x) +#define XM_ALIGNED_STRUCT(x) struct alignas(x) +#elif defined(__GNUC__) +#define XM_ALIGNED_DATA(x) __attribute__((aligned(x))) +#define XM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) +#else +#define XM_ALIGNED_DATA(x) __declspec(align(x)) +#define XM_ALIGNED_STRUCT(x) __declspec(align(x)) struct +#endif + +#if (__cplusplus >= 202002L) +#include +#endif + +/**************************************************************************** + * + * Conditional intrinsics + * + ****************************************************************************/ + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +#if defined(_XM_NO_MOVNT_) +#define XM_STREAM_PS(p, a) _mm_store_ps((p), (a)) +#define XM256_STREAM_PS(p, a) _mm256_store_ps((p), (a)) +#define XM_SFENCE() +#else +#define XM_STREAM_PS(p, a) _mm_stream_ps((p), (a)) +#define XM256_STREAM_PS(p, a) _mm256_stream_ps((p), (a)) +#define XM_SFENCE() _mm_sfence() +#endif + +#if defined(_XM_FMA3_INTRINSICS_) +#define XM_FMADD_PS(a, b, c) _mm_fmadd_ps((a), (b), (c)) +#define XM_FNMADD_PS(a, b, c) _mm_fnmadd_ps((a), (b), (c)) +#else +#define XM_FMADD_PS(a, b, c) _mm_add_ps(_mm_mul_ps((a), (b)), (c)) +#define XM_FNMADD_PS(a, b, c) _mm_sub_ps((c), _mm_mul_ps((a), (b))) +#endif + +#if defined(_XM_AVX_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) +#define XM_PERMUTE_PS(v, c) _mm_permute_ps((v), c) +#else +#define XM_PERMUTE_PS(v, c) _mm_shuffle_ps((v), (v), c) +#endif + +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 11) +#define XM_LOADU_SI16(p) \ + _mm_cvtsi32_si128(*reinterpret_cast(p)) +#else +#define XM_LOADU_SI16(p) _mm_loadu_si16(p) +#endif + +#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +#if defined(__clang__) || defined(__GNUC__) +#define XM_PREFETCH(a) __builtin_prefetch(a) +#elif defined(_MSC_VER) +#define XM_PREFETCH(a) __prefetch(a) +#else +#define XM_PREFETCH(a) +#endif + +#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +namespace DirectX { + +/**************************************************************************** + * + * Constant definitions + * + ****************************************************************************/ + +#if defined(__XNAMATH_H__) && defined(XM_PI) +#undef XM_PI +#undef XM_2PI +#undef XM_1DIVPI +#undef XM_1DIV2PI +#undef XM_PIDIV2 +#undef XM_PIDIV4 +#undef XM_SELECT_0 +#undef XM_SELECT_1 +#undef XM_PERMUTE_0X +#undef XM_PERMUTE_0Y +#undef XM_PERMUTE_0Z +#undef XM_PERMUTE_0W +#undef XM_PERMUTE_1X +#undef XM_PERMUTE_1Y +#undef XM_PERMUTE_1Z +#undef XM_PERMUTE_1W +#undef XM_CRMASK_CR6 +#undef XM_CRMASK_CR6TRUE +#undef XM_CRMASK_CR6FALSE +#undef XM_CRMASK_CR6BOUNDS +#undef XM_CACHE_LINE_SIZE +#endif + +constexpr float XM_PI = 3.141592654f; +constexpr float XM_2PI = 6.283185307f; +constexpr float XM_1DIVPI = 0.318309886f; +constexpr float XM_1DIV2PI = 0.159154943f; +constexpr float XM_PIDIV2 = 1.570796327f; +constexpr float XM_PIDIV4 = 0.785398163f; + +constexpr uint32_t XM_SELECT_0 = 0x00000000; +constexpr uint32_t XM_SELECT_1 = 0xFFFFFFFF; + +constexpr uint32_t XM_PERMUTE_0X = 0; +constexpr uint32_t XM_PERMUTE_0Y = 1; +constexpr uint32_t XM_PERMUTE_0Z = 2; +constexpr uint32_t XM_PERMUTE_0W = 3; +constexpr uint32_t XM_PERMUTE_1X = 4; +constexpr uint32_t XM_PERMUTE_1Y = 5; +constexpr uint32_t XM_PERMUTE_1Z = 6; +constexpr uint32_t XM_PERMUTE_1W = 7; + +constexpr uint32_t XM_SWIZZLE_X = 0; +constexpr uint32_t XM_SWIZZLE_Y = 1; +constexpr uint32_t XM_SWIZZLE_Z = 2; +constexpr uint32_t XM_SWIZZLE_W = 3; + +constexpr uint32_t XM_CRMASK_CR6 = 0x000000F0; +constexpr uint32_t XM_CRMASK_CR6TRUE = 0x00000080; +constexpr uint32_t XM_CRMASK_CR6FALSE = 0x00000020; +constexpr uint32_t XM_CRMASK_CR6BOUNDS = XM_CRMASK_CR6FALSE; + +#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ + defined(_M_ARM64EC) || __arm__ || __aarch64__ +constexpr size_t XM_CACHE_LINE_SIZE = 128; +#else +constexpr size_t XM_CACHE_LINE_SIZE = 64; +#endif + +/**************************************************************************** + * + * Macros + * + ****************************************************************************/ + +#if defined(__XNAMATH_H__) && defined(XMComparisonAllTrue) +#undef XMComparisonAllTrue +#undef XMComparisonAnyTrue +#undef XMComparisonAllFalse +#undef XMComparisonAnyFalse +#undef XMComparisonMixed +#undef XMComparisonAllInBounds +#undef XMComparisonAnyOutOfBounds +#endif + +// Unit conversion + +constexpr float XMConvertToRadians(float fDegrees) noexcept { + return fDegrees * (XM_PI / 180.0f); +} +constexpr float XMConvertToDegrees(float fRadians) noexcept { + return fRadians * (180.0f / XM_PI); +} + +// Condition register evaluation proceeding a recording (R) comparison + +constexpr bool XMComparisonAllTrue(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE; +} +constexpr bool XMComparisonAnyTrue(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE; +} +constexpr bool XMComparisonAllFalse(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE; +} +constexpr bool XMComparisonAnyFalse(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE; +} +constexpr bool XMComparisonMixed(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6) == 0; +} +constexpr bool XMComparisonAllInBounds(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS; +} +constexpr bool XMComparisonAnyOutOfBounds(uint32_t CR) noexcept { + return (CR & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS; +} + +/**************************************************************************** + * + * Data types + * + ****************************************************************************/ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4068 4201 4365 4324 4820) +// C4068: ignore unknown pragmas +// C4201: nonstandard extension used : nameless struct/union +// C4365: Off by default noise +// C4324/4820: padding warnings +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#endif + +//------------------------------------------------------------------------------ +#if defined(_XM_NO_INTRINSICS_) +struct __vector4 { + union { + float vector4_f32[4]; + uint32_t vector4_u32[4]; + }; +}; +#endif // _XM_NO_INTRINSICS_ + +//------------------------------------------------------------------------------ +// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte +// boundary and mapped to hardware vector registers +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +using XMVECTOR = __m128; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +using XMVECTOR = float32x4_t; +#else +using XMVECTOR = __vector4; +#endif + +// Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86, +// ARM, ARM64, and vector call; by reference otherwise +#if (defined(_M_IX86) || defined(_M_ARM) || defined(_M_ARM64) || \ + _XM_VECTORCALL_ || __i386__ || __arm__ || __aarch64__) && \ + !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR FXMVECTOR; +#else +typedef const XMVECTOR& FXMVECTOR; +#endif + +// Fix-up for (4th) XMVECTOR parameter to pass in-register for ARM, ARM64, and +// vector call; by reference otherwise +#if (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ + defined(_M_ARM64EC) || _XM_VECTORCALL_ || __arm__ || __aarch64__) && \ + !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR GXMVECTOR; +#else +typedef const XMVECTOR& GXMVECTOR; +#endif + +// Fix-up for (5th & 6th) XMVECTOR parameter to pass in-register for ARM64 and +// vector call; by reference otherwise +#if (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ + defined(_M_ARM64EC) || _XM_VECTORCALL_ || __aarch64__) && \ + !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR HXMVECTOR; +#else +typedef const XMVECTOR& HXMVECTOR; +#endif + +// Fix-up for (7th+) XMVECTOR parameters to pass by reference +typedef const XMVECTOR& CXMVECTOR; + +//------------------------------------------------------------------------------ +// Conversion types for constants +XM_ALIGNED_STRUCT(16) XMVECTORF32 { + union { + float f[4]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } + inline operator const float*() const noexcept { return f; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ + (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { + return vreinterpretq_s32_f32(v); + } + inline operator uint32x4_t() const noexcept { + return vreinterpretq_u32_f32(v); + } +#endif +}; + +XM_ALIGNED_STRUCT(16) XMVECTORI32 { + union { + int32_t i[4]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ + (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { + return vreinterpretq_s32_f32(v); + } + inline operator uint32x4_t() const noexcept { + return vreinterpretq_u32_f32(v); + } +#endif +}; + +XM_ALIGNED_STRUCT(16) XMVECTORU8 { + union { + uint8_t u[16]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ + (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { + return vreinterpretq_s32_f32(v); + } + inline operator uint32x4_t() const noexcept { + return vreinterpretq_u32_f32(v); + } +#endif +}; + +XM_ALIGNED_STRUCT(16) XMVECTORU32 { + union { + uint32_t u[4]; + XMVECTOR v; + }; + + inline operator XMVECTOR() const noexcept { return v; } +#ifdef _XM_NO_INTRINSICS_ +#elif defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const noexcept { return _mm_castps_si128(v); } + inline operator __m128d() const noexcept { return _mm_castps_pd(v); } +#elif defined(_XM_ARM_NEON_INTRINSICS_) && \ + (defined(__GNUC__) || defined(_ARM64_DISTINCT_NEON_TYPES)) + inline operator int32x4_t() const noexcept { + return vreinterpretq_s32_f32(v); + } + inline operator uint32x4_t() const noexcept { + return vreinterpretq_u32_f32(v); + } +#endif +}; + +//------------------------------------------------------------------------------ +// Vector operators + +#ifndef _XM_NO_XMVECTOR_OVERLOADS_ +XMVECTOR XM_CALLCONV operator+(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV operator-(FXMVECTOR V) noexcept; + +XMVECTOR& XM_CALLCONV operator+=(XMVECTOR& V1, FXMVECTOR V2) noexcept; +XMVECTOR& XM_CALLCONV operator-=(XMVECTOR& V1, FXMVECTOR V2) noexcept; +XMVECTOR& XM_CALLCONV operator*=(XMVECTOR& V1, FXMVECTOR V2) noexcept; +XMVECTOR& XM_CALLCONV operator/=(XMVECTOR& V1, FXMVECTOR V2) noexcept; + +XMVECTOR& operator*=(XMVECTOR& V, float S) noexcept; +XMVECTOR& operator/=(XMVECTOR& V, float S) noexcept; + +XMVECTOR XM_CALLCONV operator+(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV operator-(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV operator*(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV operator/(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV operator*(FXMVECTOR V, float S) noexcept; +XMVECTOR XM_CALLCONV operator*(float S, FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV operator/(FXMVECTOR V, float S) noexcept; +#endif /* !_XM_NO_XMVECTOR_OVERLOADS_ */ + +//------------------------------------------------------------------------------ +// Matrix type: Sixteen 32 bit floating point components aligned on a +// 16 byte boundary and mapped to four hardware vector registers + +struct XMMATRIX; + +// Fix-up for (1st) XMMATRIX parameter to pass in-register for ARM64 and vector +// call; by reference otherwise +#if (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || \ + defined(_M_ARM64EC) || _XM_VECTORCALL_ || __aarch64__) && \ + !defined(_XM_NO_INTRINSICS_) +typedef const XMMATRIX FXMMATRIX; +#else +typedef const XMMATRIX& FXMMATRIX; +#endif + +// Fix-up for (2nd+) XMMATRIX parameters to pass by reference +typedef const XMMATRIX& CXMMATRIX; + +#ifdef _XM_NO_INTRINSICS_ +struct XMMATRIX +#else +XM_ALIGNED_STRUCT(16) +XMMATRIX +#endif +{ +#ifdef _XM_NO_INTRINSICS_ + union { + XMVECTOR r[4]; + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + }; + float m[4][4]; + }; +#else + XMVECTOR r[4]; +#endif + + XMMATRIX() = default; + + XMMATRIX(const XMMATRIX&) = default; + +#if defined(_MSC_VER) && (_MSC_FULL_VER < 191426431) + XMMATRIX& operator=(const XMMATRIX& M) noexcept { + r[0] = M.r[0]; + r[1] = M.r[1]; + r[2] = M.r[2]; + r[3] = M.r[3]; + return *this; + } +#else + XMMATRIX& operator=(const XMMATRIX&) = default; + + XMMATRIX(XMMATRIX&&) = default; + XMMATRIX& operator=(XMMATRIX&&) = default; +#endif + + constexpr XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, + CXMVECTOR R3) noexcept + : r{R0, R1, R2, R3} {} + XMMATRIX(float m00, float m01, float m02, float m03, float m10, float m11, + float m12, float m13, float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33) noexcept; + explicit XMMATRIX(_In_reads_(16) const float* pArray) noexcept; + +#ifdef _XM_NO_INTRINSICS_ + float operator()(size_t Row, size_t Column) const noexcept { + return m[Row][Column]; + } + float& operator()(size_t Row, size_t Column) noexcept { + return m[Row][Column]; + } +#endif + + XMMATRIX operator+() const noexcept { return *this; } + XMMATRIX operator-() const noexcept; + + XMMATRIX& XM_CALLCONV operator+=(FXMMATRIX M) noexcept; + XMMATRIX& XM_CALLCONV operator-=(FXMMATRIX M) noexcept; + XMMATRIX& XM_CALLCONV operator*=(FXMMATRIX M) noexcept; + XMMATRIX& operator*=(float S) noexcept; + XMMATRIX& operator/=(float S) noexcept; + + XMMATRIX XM_CALLCONV operator+(FXMMATRIX M) const noexcept; + XMMATRIX XM_CALLCONV operator-(FXMMATRIX M) const noexcept; + XMMATRIX XM_CALLCONV operator*(FXMMATRIX M) const noexcept; + XMMATRIX operator*(float S) const noexcept; + XMMATRIX operator/(float S) const noexcept; + + friend XMMATRIX XM_CALLCONV operator*(float S, FXMMATRIX M) noexcept; +}; + +//------------------------------------------------------------------------------ +// 2D Vector; 32 bit floating point components +struct XMFLOAT2 { + float x; + float y; + + XMFLOAT2() = default; + + XMFLOAT2(const XMFLOAT2&) = default; + XMFLOAT2& operator=(const XMFLOAT2&) = default; + + XMFLOAT2(XMFLOAT2&&) = default; + XMFLOAT2& operator=(XMFLOAT2&&) = default; + + constexpr XMFLOAT2(float _x, float _y) noexcept : x(_x), y(_y) {} + explicit XMFLOAT2(_In_reads_(2) const float* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMFLOAT2&) const = default; + auto operator<=>(const XMFLOAT2&) const = default; +#endif +}; + +// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary +XM_ALIGNED_STRUCT(16) XMFLOAT2A : public XMFLOAT2 { using XMFLOAT2::XMFLOAT2; }; + +//------------------------------------------------------------------------------ +// 2D Vector; 32 bit signed integer components +struct XMINT2 { + int32_t x; + int32_t y; + + XMINT2() = default; + + XMINT2(const XMINT2&) = default; + XMINT2& operator=(const XMINT2&) = default; + + XMINT2(XMINT2&&) = default; + XMINT2& operator=(XMINT2&&) = default; + + constexpr XMINT2(int32_t _x, int32_t _y) noexcept : x(_x), y(_y) {} + explicit XMINT2(_In_reads_(2) const int32_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMINT2&) const = default; + auto operator<=>(const XMINT2&) const = default; +#endif +}; + +// 2D Vector; 32 bit unsigned integer components +struct XMUINT2 { + uint32_t x; + uint32_t y; + + XMUINT2() = default; + + XMUINT2(const XMUINT2&) = default; + XMUINT2& operator=(const XMUINT2&) = default; + + XMUINT2(XMUINT2&&) = default; + XMUINT2& operator=(XMUINT2&&) = default; + + constexpr XMUINT2(uint32_t _x, uint32_t _y) noexcept : x(_x), y(_y) {} + explicit XMUINT2(_In_reads_(2) const uint32_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMUINT2&) const = default; + auto operator<=>(const XMUINT2&) const = default; +#endif +}; + +//------------------------------------------------------------------------------ +// 3D Vector; 32 bit floating point components +struct XMFLOAT3 { + float x; + float y; + float z; + + XMFLOAT3() = default; + + XMFLOAT3(const XMFLOAT3&) = default; + XMFLOAT3& operator=(const XMFLOAT3&) = default; + + XMFLOAT3(XMFLOAT3&&) = default; + XMFLOAT3& operator=(XMFLOAT3&&) = default; + + constexpr XMFLOAT3(float _x, float _y, float _z) noexcept + : x(_x), y(_y), z(_z) {} + explicit XMFLOAT3(_In_reads_(3) const float* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} +}; + +// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary +XM_ALIGNED_STRUCT(16) XMFLOAT3A : public XMFLOAT3 { using XMFLOAT3::XMFLOAT3; }; + +//------------------------------------------------------------------------------ +// 3D Vector; 32 bit signed integer components +struct XMINT3 { + int32_t x; + int32_t y; + int32_t z; + + XMINT3() = default; + + XMINT3(const XMINT3&) = default; + XMINT3& operator=(const XMINT3&) = default; + + XMINT3(XMINT3&&) = default; + XMINT3& operator=(XMINT3&&) = default; + + constexpr XMINT3(int32_t _x, int32_t _y, int32_t _z) noexcept + : x(_x), y(_y), z(_z) {} + explicit XMINT3(_In_reads_(3) const int32_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMINT3&) const = default; + auto operator<=>(const XMINT3&) const = default; +#endif +}; + +// 3D Vector; 32 bit unsigned integer components +struct XMUINT3 { + uint32_t x; + uint32_t y; + uint32_t z; + + XMUINT3() = default; + + XMUINT3(const XMUINT3&) = default; + XMUINT3& operator=(const XMUINT3&) = default; + + XMUINT3(XMUINT3&&) = default; + XMUINT3& operator=(XMUINT3&&) = default; + + constexpr XMUINT3(uint32_t _x, uint32_t _y, uint32_t _z) noexcept + : x(_x), y(_y), z(_z) {} + explicit XMUINT3(_In_reads_(3) const uint32_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMUINT3&) const = default; + auto operator<=>(const XMUINT3&) const = default; +#endif +}; + +//------------------------------------------------------------------------------ +// 4D Vector; 32 bit floating point components +struct XMFLOAT4 { + float x; + float y; + float z; + float w; + + XMFLOAT4() = default; + + XMFLOAT4(const XMFLOAT4&) = default; + XMFLOAT4& operator=(const XMFLOAT4&) = default; + + XMFLOAT4(XMFLOAT4&&) = default; + XMFLOAT4& operator=(XMFLOAT4&&) = default; + + constexpr XMFLOAT4(float _x, float _y, float _z, float _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMFLOAT4(_In_reads_(4) const float* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMFLOAT4&) const = default; + auto operator<=>(const XMFLOAT4&) const = default; +#endif +}; + +// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary +XM_ALIGNED_STRUCT(16) XMFLOAT4A : public XMFLOAT4 { using XMFLOAT4::XMFLOAT4; }; + +//------------------------------------------------------------------------------ +// 4D Vector; 32 bit signed integer components +struct XMINT4 { + int32_t x; + int32_t y; + int32_t z; + int32_t w; + + XMINT4() = default; + + XMINT4(const XMINT4&) = default; + XMINT4& operator=(const XMINT4&) = default; + + XMINT4(XMINT4&&) = default; + XMINT4& operator=(XMINT4&&) = default; + + constexpr XMINT4(int32_t _x, int32_t _y, int32_t _z, int32_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMINT4(_In_reads_(4) const int32_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMINT4&) const = default; + auto operator<=>(const XMINT4&) const = default; +#endif +}; + +// 4D Vector; 32 bit unsigned integer components +struct XMUINT4 { + uint32_t x; + uint32_t y; + uint32_t z; + uint32_t w; + + XMUINT4() = default; + + XMUINT4(const XMUINT4&) = default; + XMUINT4& operator=(const XMUINT4&) = default; + + XMUINT4(XMUINT4&&) = default; + XMUINT4& operator=(XMUINT4&&) = default; + + constexpr XMUINT4(uint32_t _x, uint32_t _y, uint32_t _z, + uint32_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUINT4(_In_reads_(4) const uint32_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + +#if (__cplusplus >= 202002L) + bool operator==(const XMUINT4&) const = default; + auto operator<=>(const XMUINT4&) const = default; +#endif +}; + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +#pragma clang diagnostic ignored "-Wnested-anon-types" +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" +#endif + +//------------------------------------------------------------------------------ +// 3x3 Matrix: 32 bit floating point components +struct XMFLOAT3X3 { + union { + struct { + float _11, _12, _13; + float _21, _22, _23; + float _31, _32, _33; + }; + float m[3][3]; + }; + + XMFLOAT3X3() = default; + + XMFLOAT3X3(const XMFLOAT3X3&) = default; + XMFLOAT3X3& operator=(const XMFLOAT3X3&) = default; + + XMFLOAT3X3(XMFLOAT3X3&&) = default; + XMFLOAT3X3& operator=(XMFLOAT3X3&&) = default; + + constexpr XMFLOAT3X3(float m00, float m01, float m02, float m10, float m11, + float m12, float m20, float m21, float m22) noexcept + : _11(m00), + _12(m01), + _13(m02), + _21(m10), + _22(m11), + _23(m12), + _31(m20), + _32(m21), + _33(m22) {} + explicit XMFLOAT3X3(_In_reads_(9) const float* pArray) noexcept; + + float operator()(size_t Row, size_t Column) const noexcept { + return m[Row][Column]; + } + float& operator()(size_t Row, size_t Column) noexcept { + return m[Row][Column]; + } + +#if (__cplusplus >= 202002L) + bool operator==(const XMFLOAT3X3&) const = delete; + auto operator<=>(const XMFLOAT3X3&) const = delete; +#endif +}; + +//------------------------------------------------------------------------------ +// 4x3 Row-major Matrix: 32 bit floating point components +struct XMFLOAT4X3 { + union { + struct { + float _11, _12, _13; + float _21, _22, _23; + float _31, _32, _33; + float _41, _42, _43; + }; + float m[4][3]; + float f[12]; + }; + + XMFLOAT4X3() = default; + + XMFLOAT4X3(const XMFLOAT4X3&) = default; + XMFLOAT4X3& operator=(const XMFLOAT4X3&) = default; + + XMFLOAT4X3(XMFLOAT4X3&&) = default; + XMFLOAT4X3& operator=(XMFLOAT4X3&&) = default; + + constexpr XMFLOAT4X3(float m00, float m01, float m02, float m10, float m11, + float m12, float m20, float m21, float m22, float m30, + float m31, float m32) noexcept + : _11(m00), + _12(m01), + _13(m02), + _21(m10), + _22(m11), + _23(m12), + _31(m20), + _32(m21), + _33(m22), + _41(m30), + _42(m31), + _43(m32) {} + explicit XMFLOAT4X3(_In_reads_(12) const float* pArray) noexcept; + + float operator()(size_t Row, size_t Column) const noexcept { + return m[Row][Column]; + } + float& operator()(size_t Row, size_t Column) noexcept { + return m[Row][Column]; + } + +#if (__cplusplus >= 202002L) + bool operator==(const XMFLOAT4X3&) const = delete; + auto operator<=>(const XMFLOAT4X3&) const = delete; +#endif +}; + +// 4x3 Row-major Matrix: 32 bit floating point components aligned on a 16 byte +// boundary +XM_ALIGNED_STRUCT(16) XMFLOAT4X3A : public XMFLOAT4X3 { + using XMFLOAT4X3::XMFLOAT4X3; +}; + +//------------------------------------------------------------------------------ +// 3x4 Column-major Matrix: 32 bit floating point components +struct XMFLOAT3X4 { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + }; + float m[3][4]; + float f[12]; + }; + + XMFLOAT3X4() = default; + + XMFLOAT3X4(const XMFLOAT3X4&) = default; + XMFLOAT3X4& operator=(const XMFLOAT3X4&) = default; + + XMFLOAT3X4(XMFLOAT3X4&&) = default; + XMFLOAT3X4& operator=(XMFLOAT3X4&&) = default; + + constexpr XMFLOAT3X4(float m00, float m01, float m02, float m03, float m10, + float m11, float m12, float m13, float m20, float m21, + float m22, float m23) noexcept + : _11(m00), + _12(m01), + _13(m02), + _14(m03), + _21(m10), + _22(m11), + _23(m12), + _24(m13), + _31(m20), + _32(m21), + _33(m22), + _34(m23) {} + explicit XMFLOAT3X4(_In_reads_(12) const float* pArray) noexcept; + + float operator()(size_t Row, size_t Column) const noexcept { + return m[Row][Column]; + } + float& operator()(size_t Row, size_t Column) noexcept { + return m[Row][Column]; + } + +#if (__cplusplus >= 202002L) + bool operator==(const XMFLOAT3X4&) const = delete; + auto operator<=>(const XMFLOAT3X4&) const = delete; +#endif +}; + +// 3x4 Column-major Matrix: 32 bit floating point components aligned on a 16 +// byte boundary +XM_ALIGNED_STRUCT(16) XMFLOAT3X4A : public XMFLOAT3X4 { + using XMFLOAT3X4::XMFLOAT3X4; +}; + +//------------------------------------------------------------------------------ +// 4x4 Matrix: 32 bit floating point components +struct XMFLOAT4X4 { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + }; + float m[4][4]; + }; + + XMFLOAT4X4() = default; + + XMFLOAT4X4(const XMFLOAT4X4&) = default; + XMFLOAT4X4& operator=(const XMFLOAT4X4&) = default; + + XMFLOAT4X4(XMFLOAT4X4&&) = default; + XMFLOAT4X4& operator=(XMFLOAT4X4&&) = default; + + constexpr XMFLOAT4X4(float m00, float m01, float m02, float m03, float m10, + float m11, float m12, float m13, float m20, float m21, + float m22, float m23, float m30, float m31, float m32, + float m33) noexcept + : _11(m00), + _12(m01), + _13(m02), + _14(m03), + _21(m10), + _22(m11), + _23(m12), + _24(m13), + _31(m20), + _32(m21), + _33(m22), + _34(m23), + _41(m30), + _42(m31), + _43(m32), + _44(m33) {} + explicit XMFLOAT4X4(_In_reads_(16) const float* pArray) noexcept; + + float operator()(size_t Row, size_t Column) const noexcept { + return m[Row][Column]; + } + float& operator()(size_t Row, size_t Column) noexcept { + return m[Row][Column]; + } + +#if (__cplusplus >= 202002L) + bool operator==(const XMFLOAT4X4&) const = delete; + auto operator<=>(const XMFLOAT4X4&) const = delete; +#endif +}; + +// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary +XM_ALIGNED_STRUCT(16) XMFLOAT4X4A : public XMFLOAT4X4 { + using XMFLOAT4X4::XMFLOAT4X4; +}; + +//////////////////////////////////////////////////////////////////////////////// + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Data conversion operations + * + ****************************************************************************/ + +XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat(FXMVECTOR VInt, + uint32_t DivExponent) noexcept; +XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt(FXMVECTOR VFloat, + uint32_t MulExponent) noexcept; +XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat(FXMVECTOR VUInt, + uint32_t DivExponent) noexcept; +XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt(FXMVECTOR VFloat, + uint32_t MulExponent) noexcept; + +#if defined(__XNAMATH_H__) && defined(XMVectorSetBinaryConstant) +#undef XMVectorSetBinaryConstant +#undef XMVectorSplatConstant +#undef XMVectorSplatConstantInt +#endif + +XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1, + uint32_t C2, + uint32_t C3) noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatConstant(int32_t IntConstant, + uint32_t DivExponent) noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatConstantInt(int32_t IntConstant) noexcept; + +/**************************************************************************** + * + * Load operations + * + ****************************************************************************/ + +XMVECTOR XM_CALLCONV XMLoadInt(_In_ const uint32_t* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat(_In_ const float* pSource) noexcept; + +XMVECTOR XM_CALLCONV XMLoadInt2(_In_reads_(2) const uint32_t* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadInt2A(_In_reads_(2) + const uint32_t* PSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat2(_In_ const XMFLOAT2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat2A(_In_ const XMFLOAT2A* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadSInt2(_In_ const XMINT2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUInt2(_In_ const XMUINT2* pSource) noexcept; + +XMVECTOR XM_CALLCONV XMLoadInt3(_In_reads_(3) const uint32_t* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadInt3A(_In_reads_(3) + const uint32_t* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat3(_In_ const XMFLOAT3* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat3A(_In_ const XMFLOAT3A* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadSInt3(_In_ const XMINT3* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUInt3(_In_ const XMUINT3* pSource) noexcept; + +XMVECTOR XM_CALLCONV XMLoadInt4(_In_reads_(4) const uint32_t* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadInt4A(_In_reads_(4) + const uint32_t* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat4(_In_ const XMFLOAT4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat4A(_In_ const XMFLOAT4A* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadSInt4(_In_ const XMINT4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUInt4(_In_ const XMUINT4* pSource) noexcept; + +XMMATRIX XM_CALLCONV XMLoadFloat3x3(_In_ const XMFLOAT3X3* pSource) noexcept; +XMMATRIX XM_CALLCONV XMLoadFloat4x3(_In_ const XMFLOAT4X3* pSource) noexcept; +XMMATRIX XM_CALLCONV XMLoadFloat4x3A(_In_ const XMFLOAT4X3A* pSource) noexcept; +XMMATRIX XM_CALLCONV XMLoadFloat3x4(_In_ const XMFLOAT3X4* pSource) noexcept; +XMMATRIX XM_CALLCONV XMLoadFloat3x4A(_In_ const XMFLOAT3X4A* pSource) noexcept; +XMMATRIX XM_CALLCONV XMLoadFloat4x4(_In_ const XMFLOAT4X4* pSource) noexcept; +XMMATRIX XM_CALLCONV XMLoadFloat4x4A(_In_ const XMFLOAT4X4A* pSource) noexcept; + +/**************************************************************************** + * + * Store operations + * + ****************************************************************************/ + +void XM_CALLCONV XMStoreInt(_Out_ uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat(_Out_ float* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreInt2(_Out_writes_(2) uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreInt2A(_Out_writes_(2) uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat2(_Out_ XMFLOAT2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat2A(_Out_ XMFLOAT2A* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreSInt2(_Out_ XMINT2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUInt2(_Out_ XMUINT2* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreInt3(_Out_writes_(3) uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreInt3A(_Out_writes_(3) uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat3(_Out_ XMFLOAT3* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat3A(_Out_ XMFLOAT3A* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreSInt3(_Out_ XMINT3* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUInt3(_Out_ XMUINT3* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreInt4(_Out_writes_(4) uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreInt4A(_Out_writes_(4) uint32_t* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat4(_Out_ XMFLOAT4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat4A(_Out_ XMFLOAT4A* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreSInt4(_Out_ XMINT4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUInt4(_Out_ XMUINT4* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreFloat3x3(_Out_ XMFLOAT3X3* pDestination, + _In_ FXMMATRIX M) noexcept; +void XM_CALLCONV XMStoreFloat4x3(_Out_ XMFLOAT4X3* pDestination, + _In_ FXMMATRIX M) noexcept; +void XM_CALLCONV XMStoreFloat4x3A(_Out_ XMFLOAT4X3A* pDestination, + _In_ FXMMATRIX M) noexcept; +void XM_CALLCONV XMStoreFloat3x4(_Out_ XMFLOAT3X4* pDestination, + _In_ FXMMATRIX M) noexcept; +void XM_CALLCONV XMStoreFloat3x4A(_Out_ XMFLOAT3X4A* pDestination, + _In_ FXMMATRIX M) noexcept; +void XM_CALLCONV XMStoreFloat4x4(_Out_ XMFLOAT4X4* pDestination, + _In_ FXMMATRIX M) noexcept; +void XM_CALLCONV XMStoreFloat4x4A(_Out_ XMFLOAT4X4A* pDestination, + _In_ FXMMATRIX M) noexcept; + +/**************************************************************************** + * + * General vector operations + * + ****************************************************************************/ + +XMVECTOR XM_CALLCONV XMVectorZero() noexcept; +XMVECTOR XM_CALLCONV XMVectorSet(float x, float y, float z, float w) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetInt(uint32_t x, uint32_t y, uint32_t z, + uint32_t w) noexcept; +XMVECTOR XM_CALLCONV XMVectorReplicate(float Value) noexcept; +XMVECTOR XM_CALLCONV XMVectorReplicatePtr(_In_ const float* pValue) noexcept; +XMVECTOR XM_CALLCONV XMVectorReplicateInt(uint32_t Value) noexcept; +XMVECTOR XM_CALLCONV +XMVectorReplicateIntPtr(_In_ const uint32_t* pValue) noexcept; +XMVECTOR XM_CALLCONV XMVectorTrueInt() noexcept; +XMVECTOR XM_CALLCONV XMVectorFalseInt() noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatY(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatZ(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatW(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatOne() noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatInfinity() noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatQNaN() noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatEpsilon() noexcept; +XMVECTOR XM_CALLCONV XMVectorSplatSignMask() noexcept; + +float XM_CALLCONV XMVectorGetByIndex(FXMVECTOR V, size_t i) noexcept; +float XM_CALLCONV XMVectorGetX(FXMVECTOR V) noexcept; +float XM_CALLCONV XMVectorGetY(FXMVECTOR V) noexcept; +float XM_CALLCONV XMVectorGetZ(FXMVECTOR V) noexcept; +float XM_CALLCONV XMVectorGetW(FXMVECTOR V) noexcept; + +void XM_CALLCONV XMVectorGetByIndexPtr(_Out_ float* f, _In_ FXMVECTOR V, + _In_ size_t i) noexcept; +void XM_CALLCONV XMVectorGetXPtr(_Out_ float* x, _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorGetYPtr(_Out_ float* y, _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorGetZPtr(_Out_ float* z, _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorGetWPtr(_Out_ float* w, _In_ FXMVECTOR V) noexcept; + +uint32_t XM_CALLCONV XMVectorGetIntByIndex(FXMVECTOR V, size_t i) noexcept; +uint32_t XM_CALLCONV XMVectorGetIntX(FXMVECTOR V) noexcept; +uint32_t XM_CALLCONV XMVectorGetIntY(FXMVECTOR V) noexcept; +uint32_t XM_CALLCONV XMVectorGetIntZ(FXMVECTOR V) noexcept; +uint32_t XM_CALLCONV XMVectorGetIntW(FXMVECTOR V) noexcept; + +void XM_CALLCONV XMVectorGetIntByIndexPtr(_Out_ uint32_t* x, _In_ FXMVECTOR V, + _In_ size_t i) noexcept; +void XM_CALLCONV XMVectorGetIntXPtr(_Out_ uint32_t* x, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorGetIntYPtr(_Out_ uint32_t* y, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorGetIntZPtr(_Out_ uint32_t* z, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorGetIntWPtr(_Out_ uint32_t* w, + _In_ FXMVECTOR V) noexcept; + +XMVECTOR XM_CALLCONV XMVectorSetByIndex(FXMVECTOR V, float f, + size_t i) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetX(FXMVECTOR V, float x) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetY(FXMVECTOR V, float y) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetZ(FXMVECTOR V, float z) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetW(FXMVECTOR V, float w) noexcept; + +XMVECTOR XM_CALLCONV XMVectorSetByIndexPtr(_In_ FXMVECTOR V, + _In_ const float* f, + _In_ size_t i) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetXPtr(_In_ FXMVECTOR V, + _In_ const float* x) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetYPtr(_In_ FXMVECTOR V, + _In_ const float* y) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetZPtr(_In_ FXMVECTOR V, + _In_ const float* z) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetWPtr(_In_ FXMVECTOR V, + _In_ const float* w) noexcept; + +XMVECTOR XM_CALLCONV XMVectorSetIntByIndex(FXMVECTOR V, uint32_t x, + size_t i) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w) noexcept; + +XMVECTOR XM_CALLCONV XMVectorSetIntByIndexPtr(_In_ FXMVECTOR V, + _In_ const uint32_t* x, + _In_ size_t i) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntXPtr(_In_ FXMVECTOR V, + _In_ const uint32_t* x) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntYPtr(_In_ FXMVECTOR V, + _In_ const uint32_t* y) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntZPtr(_In_ FXMVECTOR V, + _In_ const uint32_t* z) noexcept; +XMVECTOR XM_CALLCONV XMVectorSetIntWPtr(_In_ FXMVECTOR V, + _In_ const uint32_t* w) noexcept; + +#if defined(__XNAMATH_H__) && defined(XMVectorSwizzle) +#undef XMVectorSwizzle +#endif + +XMVECTOR XM_CALLCONV XMVectorSwizzle(FXMVECTOR V, uint32_t E0, uint32_t E1, + uint32_t E2, uint32_t E3) noexcept; +XMVECTOR XM_CALLCONV XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, + uint32_t PermuteX, uint32_t PermuteY, + uint32_t PermuteZ, + uint32_t PermuteW) noexcept; +XMVECTOR XM_CALLCONV XMVectorSelectControl(uint32_t VectorIndex0, + uint32_t VectorIndex1, + uint32_t VectorIndex2, + uint32_t VectorIndex3) noexcept; +XMVECTOR XM_CALLCONV XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR Control) noexcept; +XMVECTOR XM_CALLCONV XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2) noexcept; + +#if defined(__XNAMATH_H__) && defined(XMVectorShiftLeft) +#undef XMVectorShiftLeft +#undef XMVectorRotateLeft +#undef XMVectorRotateRight +#undef XMVectorInsert +#endif + +XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, + uint32_t Elements) noexcept; +XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V, + uint32_t Elements) noexcept; +XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, + uint32_t Elements) noexcept; +XMVECTOR XM_CALLCONV XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, + uint32_t VSLeftRotateElements, + uint32_t Select0, uint32_t Select1, + uint32_t Select2, + uint32_t Select3) noexcept; + +XMVECTOR XM_CALLCONV XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorEqualR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorEqualIntR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V, + _In_ FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR Epsilon) noexcept; +XMVECTOR XM_CALLCONV XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorGreaterR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorGreaterOrEqual(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorGreaterOrEqualR(_Out_ uint32_t* pCR, + _In_ FXMVECTOR V1, + _In_ FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorLess(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; +XMVECTOR XM_CALLCONV XMVectorInBoundsR(_Out_ uint32_t* pCR, _In_ FXMVECTOR V, + _In_ FXMVECTOR Bounds) noexcept; + +XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorIsInfinite(FXMVECTOR V) noexcept; + +XMVECTOR XM_CALLCONV XMVectorMin(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorMax(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorTruncate(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorFloor(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorCeiling(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, + FXMVECTOR Max) noexcept; +XMVECTOR XM_CALLCONV XMVectorSaturate(FXMVECTOR V) noexcept; + +XMVECTOR XM_CALLCONV XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; + +XMVECTOR XM_CALLCONV XMVectorNegate(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorSum(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorSubtractAngles(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR V3) noexcept; +XMVECTOR XM_CALLCONV XMVectorDivide(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorNegativeMultiplySubtract(FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3) noexcept; +XMVECTOR XM_CALLCONV XMVectorScale(FXMVECTOR V, float ScaleFactor) noexcept; +XMVECTOR XM_CALLCONV XMVectorReciprocalEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorReciprocal(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSqrtEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSqrt(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorReciprocalSqrtEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorExp10(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorExpE(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorLog(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorPow(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorAbs(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorMod(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVectorModAngles(FXMVECTOR Angles) noexcept; +XMVECTOR XM_CALLCONV XMVectorSin(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSinEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorCos(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorCosEst(FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorSinCos(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, + _In_ FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorTan(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorTanEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorSinH(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorCosH(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorTanH(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorASin(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorASinEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorACos(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorACosEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorATan(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorATanEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVectorATan2(FXMVECTOR Y, FXMVECTOR X) noexcept; +XMVECTOR XM_CALLCONV XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X) noexcept; +XMVECTOR XM_CALLCONV XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, float t) noexcept; +XMVECTOR XM_CALLCONV XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, + FXMVECTOR T) noexcept; +XMVECTOR XM_CALLCONV XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, + FXMVECTOR Position1, GXMVECTOR Tangent1, + float t) noexcept; +XMVECTOR XM_CALLCONV XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, + FXMVECTOR Position1, GXMVECTOR Tangent1, + HXMVECTOR T) noexcept; +XMVECTOR XM_CALLCONV XMVectorCatmullRom(FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR Position3, float t) noexcept; +XMVECTOR XM_CALLCONV XMVectorCatmullRomV(FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR Position3, + HXMVECTOR T) noexcept; +XMVECTOR XM_CALLCONV XMVectorBaryCentric(FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, float f, + float g) noexcept; +XMVECTOR XM_CALLCONV XMVectorBaryCentricV(FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, GXMVECTOR F, + HXMVECTOR G) noexcept; + +/**************************************************************************** + * + * 2D vector operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR Epsilon) noexcept; +bool XM_CALLCONV XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector2GreaterOrEqualR(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + +bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept; +bool XM_CALLCONV XMVector2IsInfinite(FXMVECTOR V) noexcept; + +XMVECTOR XM_CALLCONV XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector2LengthSq(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2ReciprocalLengthEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2ReciprocalLength(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2LengthEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2Length(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2NormalizeEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2Normalize(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2ClampLength(FXMVECTOR V, float LengthMin, + float LengthMax) noexcept; +XMVECTOR XM_CALLCONV XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, + FXMVECTOR LengthMax) noexcept; +XMVECTOR XM_CALLCONV XMVector2Reflect(FXMVECTOR Incident, + FXMVECTOR Normal) noexcept; +XMVECTOR XM_CALLCONV XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, + float RefractionIndex) noexcept; +XMVECTOR XM_CALLCONV XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, + FXMVECTOR RefractionIndex) noexcept; +XMVECTOR XM_CALLCONV XMVector2Orthogonal(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, + FXMVECTOR N2) noexcept; +XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormals(FXMVECTOR N1, + FXMVECTOR N2) noexcept; +XMVECTOR XM_CALLCONV XMVector2AngleBetweenVectors(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector2LinePointDistance(FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point) noexcept; +XMVECTOR XM_CALLCONV XMVector2IntersectLine(FXMVECTOR Line1Point1, + FXMVECTOR Line1Point2, + FXMVECTOR Line2Point1, + GXMVECTOR Line2Point2) noexcept; +XMVECTOR XM_CALLCONV XMVector2Transform(FXMVECTOR V, FXMMATRIX M) noexcept; +XMFLOAT4* XM_CALLCONV XMVector2TransformStream( + _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) + XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) + const XMFLOAT2* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; +XMVECTOR XM_CALLCONV XMVector2TransformCoord(FXMVECTOR V, FXMMATRIX M) noexcept; +XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream( + _Out_writes_bytes_(sizeof(XMFLOAT2) + OutputStride * (VectorCount - 1)) + XMFLOAT2* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) + const XMFLOAT2* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; +XMVECTOR XM_CALLCONV XMVector2TransformNormal(FXMVECTOR V, + FXMMATRIX M) noexcept; +XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream( + _Out_writes_bytes_(sizeof(XMFLOAT2) + OutputStride * (VectorCount - 1)) + XMFLOAT2* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT2) + InputStride * (VectorCount - 1)) + const XMFLOAT2* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; + +/**************************************************************************** + * + * 3D vector operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR Epsilon) noexcept; +bool XM_CALLCONV XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector3GreaterOrEqualR(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + +bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept; +bool XM_CALLCONV XMVector3IsInfinite(FXMVECTOR V) noexcept; + +XMVECTOR XM_CALLCONV XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector3LengthSq(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3ReciprocalLengthEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3ReciprocalLength(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3LengthEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3Length(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3NormalizeEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3Normalize(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3ClampLength(FXMVECTOR V, float LengthMin, + float LengthMax) noexcept; +XMVECTOR XM_CALLCONV XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, + FXMVECTOR LengthMax) noexcept; +XMVECTOR XM_CALLCONV XMVector3Reflect(FXMVECTOR Incident, + FXMVECTOR Normal) noexcept; +XMVECTOR XM_CALLCONV XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, + float RefractionIndex) noexcept; +XMVECTOR XM_CALLCONV XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, + FXMVECTOR RefractionIndex) noexcept; +XMVECTOR XM_CALLCONV XMVector3Orthogonal(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, + FXMVECTOR N2) noexcept; +XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormals(FXMVECTOR N1, + FXMVECTOR N2) noexcept; +XMVECTOR XM_CALLCONV XMVector3AngleBetweenVectors(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector3LinePointDistance(FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point) noexcept; +void XM_CALLCONV XMVector3ComponentsFromNormal(_Out_ XMVECTOR* pParallel, + _Out_ XMVECTOR* pPerpendicular, + _In_ FXMVECTOR V, + _In_ FXMVECTOR Normal) noexcept; +XMVECTOR XM_CALLCONV XMVector3Rotate(FXMVECTOR V, + FXMVECTOR RotationQuaternion) noexcept; +XMVECTOR XM_CALLCONV +XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion) noexcept; +XMVECTOR XM_CALLCONV XMVector3Transform(FXMVECTOR V, FXMMATRIX M) noexcept; +XMFLOAT4* XM_CALLCONV XMVector3TransformStream( + _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) + XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) + const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; +XMVECTOR XM_CALLCONV XMVector3TransformCoord(FXMVECTOR V, FXMMATRIX M) noexcept; +XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream( + _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) + XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) + const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; +XMVECTOR XM_CALLCONV XMVector3TransformNormal(FXMVECTOR V, + FXMMATRIX M) noexcept; +XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream( + _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) + XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) + const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; +XMVECTOR XM_CALLCONV XMVector3Project(FXMVECTOR V, float ViewportX, + float ViewportY, float ViewportWidth, + float ViewportHeight, float ViewportMinZ, + float ViewportMaxZ, FXMMATRIX Projection, + CXMMATRIX View, CXMMATRIX World) noexcept; +XMFLOAT3* XM_CALLCONV XMVector3ProjectStream( + _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) + XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) + const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ float ViewportX, + _In_ float ViewportY, _In_ float ViewportWidth, _In_ float ViewportHeight, + _In_ float ViewportMinZ, _In_ float ViewportMaxZ, _In_ FXMMATRIX Projection, + _In_ CXMMATRIX View, _In_ CXMMATRIX World) noexcept; +XMVECTOR XM_CALLCONV XMVector3Unproject(FXMVECTOR V, float ViewportX, + float ViewportY, float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, float ViewportMaxZ, + FXMMATRIX Projection, CXMMATRIX View, + CXMMATRIX World) noexcept; +XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream( + _Out_writes_bytes_(sizeof(XMFLOAT3) + OutputStride * (VectorCount - 1)) + XMFLOAT3* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT3) + InputStride * (VectorCount - 1)) + const XMFLOAT3* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, _In_ float ViewportX, + _In_ float ViewportY, _In_ float ViewportWidth, _In_ float ViewportHeight, + _In_ float ViewportMinZ, _In_ float ViewportMaxZ, _In_ FXMMATRIX Projection, + _In_ CXMMATRIX View, _In_ CXMMATRIX World) noexcept; + +/**************************************************************************** + * + * 4D vector operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR Epsilon) noexcept; +bool XM_CALLCONV XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +uint32_t XM_CALLCONV XMVector4GreaterOrEqualR(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4Less(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2) noexcept; +bool XM_CALLCONV XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds) noexcept; + +bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept; +bool XM_CALLCONV XMVector4IsInfinite(FXMVECTOR V) noexcept; + +XMVECTOR XM_CALLCONV XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, + FXMVECTOR V3) noexcept; +XMVECTOR XM_CALLCONV XMVector4LengthSq(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4ReciprocalLengthEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4ReciprocalLength(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4LengthEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4Length(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4NormalizeEst(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4Normalize(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4ClampLength(FXMVECTOR V, float LengthMin, + float LengthMax) noexcept; +XMVECTOR XM_CALLCONV XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, + FXMVECTOR LengthMax) noexcept; +XMVECTOR XM_CALLCONV XMVector4Reflect(FXMVECTOR Incident, + FXMVECTOR Normal) noexcept; +XMVECTOR XM_CALLCONV XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, + float RefractionIndex) noexcept; +XMVECTOR XM_CALLCONV XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, + FXMVECTOR RefractionIndex) noexcept; +XMVECTOR XM_CALLCONV XMVector4Orthogonal(FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, + FXMVECTOR N2) noexcept; +XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormals(FXMVECTOR N1, + FXMVECTOR N2) noexcept; +XMVECTOR XM_CALLCONV XMVector4AngleBetweenVectors(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMVector4Transform(FXMVECTOR V, FXMMATRIX M) noexcept; +XMFLOAT4* XM_CALLCONV XMVector4TransformStream( + _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (VectorCount - 1)) + XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (VectorCount - 1)) + const XMFLOAT4* pInputStream, + _In_ size_t InputStride, _In_ size_t VectorCount, + _In_ FXMMATRIX M) noexcept; + +/**************************************************************************** + * + * Matrix operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept; +bool XM_CALLCONV XMMatrixIsInfinite(FXMMATRIX M) noexcept; +bool XM_CALLCONV XMMatrixIsIdentity(FXMMATRIX M) noexcept; + +XMMATRIX XM_CALLCONV XMMatrixMultiply(FXMMATRIX M1, CXMMATRIX M2) noexcept; +XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose(FXMMATRIX M1, + CXMMATRIX M2) noexcept; +XMMATRIX XM_CALLCONV XMMatrixTranspose(FXMMATRIX M) noexcept; +XMMATRIX XM_CALLCONV XMMatrixInverse(_Out_opt_ XMVECTOR* pDeterminant, + _In_ FXMMATRIX M) noexcept; +XMMATRIX XM_CALLCONV XMMatrixVectorTensorProduct(FXMVECTOR V1, + FXMVECTOR V2) noexcept; +XMVECTOR XM_CALLCONV XMMatrixDeterminant(FXMMATRIX M) noexcept; + +_Success_(return) bool XM_CALLCONV + XMMatrixDecompose(_Out_ XMVECTOR* outScale, _Out_ XMVECTOR* outRotQuat, + _Out_ XMVECTOR* outTrans, _In_ FXMMATRIX M) noexcept; + +XMMATRIX XM_CALLCONV XMMatrixIdentity() noexcept; +XMMATRIX XM_CALLCONV XMMatrixSet(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, + float m33) noexcept; +XMMATRIX XM_CALLCONV XMMatrixTranslation(float OffsetX, float OffsetY, + float OffsetZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(FXMVECTOR Offset) noexcept; +XMMATRIX XM_CALLCONV XMMatrixScaling(float ScaleX, float ScaleY, + float ScaleZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale) noexcept; +XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle) noexcept; +XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle) noexcept; +XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle) noexcept; + +// Rotates about y-axis (Yaw), then x-axis (Pitch), then z-axis (Roll) +XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw(float Pitch, float Yaw, + float Roll) noexcept; + +// Rotates about y-axis (Angles.y), then x-axis (Angles.x), then z-axis +// (Angles.z) +XMMATRIX XM_CALLCONV +XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles) noexcept; + +XMMATRIX XM_CALLCONV XMMatrixRotationNormal(FXMVECTOR NormalAxis, + float Angle) noexcept; +XMMATRIX XM_CALLCONV XMMatrixRotationAxis(FXMVECTOR Axis, float Angle) noexcept; +XMMATRIX XM_CALLCONV XMMatrixRotationQuaternion(FXMVECTOR Quaternion) noexcept; +XMMATRIX XM_CALLCONV XMMatrixTransformation2D( + FXMVECTOR ScalingOrigin, float ScalingOrientation, FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, float Rotation, GXMVECTOR Translation) noexcept; +XMMATRIX XM_CALLCONV XMMatrixTransformation( + FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, + FXMVECTOR Scaling, GXMVECTOR RotationOrigin, HXMVECTOR RotationQuaternion, + HXMVECTOR Translation) noexcept; +XMMATRIX XM_CALLCONV +XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, + float Rotation, FXMVECTOR Translation) noexcept; +XMMATRIX XM_CALLCONV XMMatrixAffineTransformation( + FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, + GXMVECTOR Translation) noexcept; +XMMATRIX XM_CALLCONV XMMatrixReflect(FXMVECTOR ReflectionPlane) noexcept; +XMMATRIX XM_CALLCONV XMMatrixShadow(FXMVECTOR ShadowPlane, + FXMVECTOR LightPosition) noexcept; + +XMMATRIX XM_CALLCONV XMMatrixLookAtLH(FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection) noexcept; +XMMATRIX XM_CALLCONV XMMatrixLookAtRH(FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection) noexcept; +XMMATRIX XM_CALLCONV XMMatrixLookToLH(FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection) noexcept; +XMMATRIX XM_CALLCONV XMMatrixLookToRH(FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection) noexcept; +XMMATRIX XM_CALLCONV XMMatrixPerspectiveLH(float ViewWidth, float ViewHeight, + float NearZ, float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixPerspectiveRH(float ViewWidth, float ViewHeight, + float NearZ, float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovLH(float FovAngleY, + float AspectRatio, float NearZ, + float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovRH(float FovAngleY, + float AspectRatio, float NearZ, + float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterLH(float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, float NearZ, + float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterRH(float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, float NearZ, + float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixOrthographicLH(float ViewWidth, float ViewHeight, + float NearZ, float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixOrthographicRH(float ViewWidth, float ViewHeight, + float NearZ, float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterLH(float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, float NearZ, + float FarZ) noexcept; +XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterRH(float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, float NearZ, + float FarZ) noexcept; + +/**************************************************************************** + * + * Quaternion operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; +bool XM_CALLCONV XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; + +bool XM_CALLCONV XMQuaternionIsNaN(FXMVECTOR Q) noexcept; +bool XM_CALLCONV XMQuaternionIsInfinite(FXMVECTOR Q) noexcept; +bool XM_CALLCONV XMQuaternionIsIdentity(FXMVECTOR Q) noexcept; + +XMVECTOR XM_CALLCONV XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionLengthSq(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionReciprocalLength(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionLength(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionNormalizeEst(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionNormalize(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionConjugate(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionInverse(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionLn(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionExp(FXMVECTOR Q) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, + float t) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, + FXMVECTOR T) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, + GXMVECTOR Q3, float t) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, + FXMVECTOR Q2, GXMVECTOR Q3, + HXMVECTOR T) noexcept; +void XM_CALLCONV XMQuaternionSquadSetup(_Out_ XMVECTOR* pA, _Out_ XMVECTOR* pB, + _Out_ XMVECTOR* pC, _In_ FXMVECTOR Q0, + _In_ FXMVECTOR Q1, _In_ FXMVECTOR Q2, + _In_ GXMVECTOR Q3) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, + FXMVECTOR Q2, float f, + float g) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, + FXMVECTOR Q2, GXMVECTOR F, + HXMVECTOR G) noexcept; + +XMVECTOR XM_CALLCONV XMQuaternionIdentity() noexcept; + +// Rotates about y-axis (Yaw), then x-axis (Pitch), then z-axis (Roll) +XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYaw(float Pitch, float Yaw, + float Roll) noexcept; + +// Rotates about y-axis (Angles.y), then x-axis (Angles.x), then z-axis +// (Angles.z) +XMVECTOR XM_CALLCONV +XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles) noexcept; + +XMVECTOR XM_CALLCONV XMQuaternionRotationNormal(FXMVECTOR NormalAxis, + float Angle) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionRotationAxis(FXMVECTOR Axis, + float Angle) noexcept; +XMVECTOR XM_CALLCONV XMQuaternionRotationMatrix(FXMMATRIX M) noexcept; + +void XM_CALLCONV XMQuaternionToAxisAngle(_Out_ XMVECTOR* pAxis, + _Out_ float* pAngle, + _In_ FXMVECTOR Q) noexcept; + +/**************************************************************************** + * + * Plane operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2) noexcept; +bool XM_CALLCONV XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, + FXMVECTOR Epsilon) noexcept; +bool XM_CALLCONV XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2) noexcept; + +bool XM_CALLCONV XMPlaneIsNaN(FXMVECTOR P) noexcept; +bool XM_CALLCONV XMPlaneIsInfinite(FXMVECTOR P) noexcept; + +XMVECTOR XM_CALLCONV XMPlaneDot(FXMVECTOR P, FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V) noexcept; +XMVECTOR XM_CALLCONV XMPlaneNormalizeEst(FXMVECTOR P) noexcept; +XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept; +XMVECTOR XM_CALLCONV XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2) noexcept; +void XM_CALLCONV XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, + _Out_ XMVECTOR* pLinePoint2, + _In_ FXMVECTOR P1, + _In_ FXMVECTOR P2) noexcept; + +// Transforms a plane given an inverse transpose matrix +XMVECTOR XM_CALLCONV XMPlaneTransform(FXMVECTOR P, FXMMATRIX ITM) noexcept; + +// Transforms an array of planes given an inverse transpose matrix +XMFLOAT4* XM_CALLCONV XMPlaneTransformStream( + _Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (PlaneCount - 1)) + XMFLOAT4* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (PlaneCount - 1)) + const XMFLOAT4* pInputStream, + _In_ size_t InputStride, _In_ size_t PlaneCount, + _In_ FXMMATRIX ITM) noexcept; + +XMVECTOR XM_CALLCONV XMPlaneFromPointNormal(FXMVECTOR Point, + FXMVECTOR Normal) noexcept; +XMVECTOR XM_CALLCONV XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, + FXMVECTOR Point3) noexcept; + +/**************************************************************************** + * + * Color operations + * + ****************************************************************************/ + +bool XM_CALLCONV XMColorEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; +bool XM_CALLCONV XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; +bool XM_CALLCONV XMColorGreater(FXMVECTOR C1, FXMVECTOR C2) noexcept; +bool XM_CALLCONV XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; +bool XM_CALLCONV XMColorLess(FXMVECTOR C1, FXMVECTOR C2) noexcept; +bool XM_CALLCONV XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2) noexcept; + +bool XM_CALLCONV XMColorIsNaN(FXMVECTOR C) noexcept; +bool XM_CALLCONV XMColorIsInfinite(FXMVECTOR C) noexcept; + +XMVECTOR XM_CALLCONV XMColorNegative(FXMVECTOR C) noexcept; +XMVECTOR XM_CALLCONV XMColorModulate(FXMVECTOR C1, FXMVECTOR C2) noexcept; +XMVECTOR XM_CALLCONV XMColorAdjustSaturation(FXMVECTOR C, + float Saturation) noexcept; +XMVECTOR XM_CALLCONV XMColorAdjustContrast(FXMVECTOR C, + float Contrast) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToHSV(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorHSVToRGB(FXMVECTOR hsv) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToYUV(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorYUVToRGB(FXMVECTOR yuv) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToYUV_HD(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorYUVToRGB_HD(FXMVECTOR yuv) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToYUV_UHD(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorYUVToRGB_UHD(FXMVECTOR yuv) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToXYZ(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorXYZToRGB(FXMVECTOR xyz) noexcept; + +XMVECTOR XM_CALLCONV XMColorXYZToSRGB(FXMVECTOR xyz) noexcept; +XMVECTOR XM_CALLCONV XMColorSRGBToXYZ(FXMVECTOR srgb) noexcept; + +XMVECTOR XM_CALLCONV XMColorRGBToSRGB(FXMVECTOR rgb) noexcept; +XMVECTOR XM_CALLCONV XMColorSRGBToRGB(FXMVECTOR srgb) noexcept; + +/**************************************************************************** + * + * Miscellaneous operations + * + ****************************************************************************/ + +bool XMVerifyCPUSupport() noexcept; + +XMVECTOR XM_CALLCONV XMFresnelTerm(FXMVECTOR CosIncidentAngle, + FXMVECTOR RefractionIndex) noexcept; + +bool XMScalarNearEqual(float S1, float S2, float Epsilon) noexcept; +float XMScalarModAngle(float Value) noexcept; + +float XMScalarSin(float Value) noexcept; +float XMScalarSinEst(float Value) noexcept; + +float XMScalarCos(float Value) noexcept; +float XMScalarCosEst(float Value) noexcept; + +void XMScalarSinCos(_Out_ float* pSin, _Out_ float* pCos, float Value) noexcept; +void XMScalarSinCosEst(_Out_ float* pSin, _Out_ float* pCos, + float Value) noexcept; + +float XMScalarASin(float Value) noexcept; +float XMScalarASinEst(float Value) noexcept; + +float XMScalarACos(float Value) noexcept; +float XMScalarACosEst(float Value) noexcept; + +/**************************************************************************** + * + * Templates + * + ****************************************************************************/ + +#if defined(__XNAMATH_H__) && defined(XMMin) +#undef XMMin +#undef XMMax +#endif + +template +inline T XMMin(T a, T b) noexcept { + return (a < b) ? a : b; +} +template +inline T XMMax(T a, T b) noexcept { + return (a > b) ? a : b; +} + +//------------------------------------------------------------------------------ + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +// PermuteHelper internal template (SSE only) +namespace MathInternal { +// Slow path fallback for permutes that do not map to a single SSE shuffle +// opcode. +template +struct PermuteHelper { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { + static const XMVECTORU32 selectMask = {{{ + WhichX ? 0xFFFFFFFF : 0, + WhichY ? 0xFFFFFFFF : 0, + WhichZ ? 0xFFFFFFFF : 0, + WhichW ? 0xFFFFFFFF : 0, + }}}; + + XMVECTOR shuffled1 = XM_PERMUTE_PS(v1, Shuffle); + XMVECTOR shuffled2 = XM_PERMUTE_PS(v2, Shuffle); + + XMVECTOR masked1 = _mm_andnot_ps(selectMask, shuffled1); + XMVECTOR masked2 = _mm_and_ps(selectMask, shuffled2); + + return _mm_or_ps(masked1, masked2); + } +}; + +// Fast path for permutes that only read from the first vector. +template +struct PermuteHelper { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR) noexcept { + return XM_PERMUTE_PS(v1, Shuffle); + } +}; + +// Fast path for permutes that only read from the second vector. +template +struct PermuteHelper { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR, FXMVECTOR v2) noexcept { + return XM_PERMUTE_PS(v2, Shuffle); + } +}; + +// Fast path for permutes that read XY from the first vector, ZW from the +// second. +template +struct PermuteHelper { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { + return _mm_shuffle_ps(v1, v2, Shuffle); + } +}; + +// Fast path for permutes that read XY from the second vector, ZW from the +// first. +template +struct PermuteHelper { + static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) noexcept { + return _mm_shuffle_ps(v2, v1, Shuffle); + } +}; +} // namespace MathInternal + +#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +// General permute template +template +inline XMVECTOR XM_CALLCONV XMVectorPermute(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + static_assert(PermuteX <= 7, "PermuteX template parameter out of range"); + static_assert(PermuteY <= 7, "PermuteY template parameter out of range"); + static_assert(PermuteZ <= 7, "PermuteZ template parameter out of range"); + static_assert(PermuteW <= 7, "PermuteW template parameter out of range"); + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + constexpr uint32_t Shuffle = + _MM_SHUFFLE(PermuteW & 3, PermuteZ & 3, PermuteY & 3, PermuteX & 3); + + constexpr bool WhichX = PermuteX > 3; + constexpr bool WhichY = PermuteY > 3; + constexpr bool WhichZ = PermuteZ > 3; + constexpr bool WhichW = PermuteW > 3; + + return MathInternal::PermuteHelper::Permute(V1, V2); +#else + + return XMVectorPermute(V1, V2, PermuteX, PermuteY, PermuteZ, PermuteW); + +#endif +} + +// Special-case permute templates +template <> +constexpr XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 2, 3>(FXMVECTOR V1, + FXMVECTOR) noexcept { + return V1; +} +template <> +constexpr XMVECTOR XM_CALLCONV +XMVectorPermute<4, 5, 6, 7>(FXMVECTOR, FXMVECTOR V2) noexcept { + return V2; +} + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 4, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_movelh_ps(V1, V2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<6, 7, 2, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_movehl_ps(V1, V2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 1, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_unpacklo_ps(V1, V2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 6, 3, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_unpackhi_ps(V1, V2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_castpd_ps(_mm_unpackhi_pd(_mm_castps_pd(V1), _mm_castps_pd(V2))); +} +#endif + +#if defined(_XM_SSE4_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 2, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x1); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 2, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 2, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x3); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x4); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 6, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x5); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 6, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x6); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 6, 3>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x7); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 2, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x8); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 2, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0x9); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 2, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0xA); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 5, 2, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0xB); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0xC); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<4, 1, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0xD); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 5, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return _mm_blend_ps(V1, V2, 0xE); +} +#endif + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +// If the indices are all in the range 0-3 or 4-7, then use XMVectorSwizzle +// instead The mirror cases are not spelled out here as the programmer can +// always swap the arguments (i.e. prefer permutes where the X element comes +// from the V1 vector instead of the V2 vector) + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 4, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_low_f32(V1), vget_low_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 4, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vget_low_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 5, 4>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_low_f32(V1), vrev64_f32(vget_low_f32(V2))); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 5, 4>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_low_f32(V1)), + vrev64_f32(vget_low_f32(V2))); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_high_f32(V1), vget_high_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vget_high_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 7, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_high_f32(V1), vrev64_f32(vget_high_f32(V2))); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 7, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_high_f32(V1)), + vrev64_f32(vget_high_f32(V2))); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_low_f32(V1), vget_high_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 6, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_low_f32(V1)), vget_high_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 1, 7, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_low_f32(V1), vrev64_f32(vget_high_f32(V2))); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 0, 7, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_low_f32(V1)), + vrev64_f32(vget_high_f32(V2))); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 4, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_high_f32(V1)), vget_low_f32(V2)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 5, 4>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vget_high_f32(V1), vrev64_f32(vget_low_f32(V2))); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 2, 5, 4>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vcombine_f32(vrev64_f32(vget_high_f32(V1)), + vrev64_f32(vget_low_f32(V2))); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 2, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vtrnq_f32(V1, V2).val[0]; +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 5, 3, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vtrnq_f32(V1, V2).val[1]; +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 4, 1, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vzipq_f32(V1, V2).val[0]; +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 6, 3, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vzipq_f32(V1, V2).val[1]; +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<0, 2, 4, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vuzpq_f32(V1, V2).val[0]; +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 3, 5, 7>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vuzpq_f32(V1, V2).val[1]; +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<1, 2, 3, 4>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vextq_f32(V1, V2, 1); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<2, 3, 4, 5>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vextq_f32(V1, V2, 2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorPermute<3, 4, 5, 6>(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + return vextq_f32(V1, V2, 3); +} + +#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +//------------------------------------------------------------------------------ + +// General swizzle template +template +inline XMVECTOR XM_CALLCONV XMVectorSwizzle(FXMVECTOR V) noexcept { + static_assert(SwizzleX <= 3, "SwizzleX template parameter out of range"); + static_assert(SwizzleY <= 3, "SwizzleY template parameter out of range"); + static_assert(SwizzleZ <= 3, "SwizzleZ template parameter out of range"); + static_assert(SwizzleW <= 3, "SwizzleW template parameter out of range"); + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + return XM_PERMUTE_PS(V, + _MM_SHUFFLE(SwizzleW, SwizzleZ, SwizzleY, SwizzleX)); +#else + + return XMVectorSwizzle(V, SwizzleX, SwizzleY, SwizzleZ, SwizzleW); + +#endif +} + +// Specialized swizzles +template <> +constexpr XMVECTOR XM_CALLCONV +XMVectorSwizzle<0, 1, 2, 3>(FXMVECTOR V) noexcept { + return V; +} + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 0, 1>(FXMVECTOR V) noexcept { + return _mm_movelh_ps(V, V); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 2, 3>(FXMVECTOR V) noexcept { + return _mm_movehl_ps(V, V); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 1, 1>(FXMVECTOR V) noexcept { + return _mm_unpacklo_ps(V, V); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 3, 3>(FXMVECTOR V) noexcept { + return _mm_unpackhi_ps(V, V); +} +#endif + +#if defined(_XM_SSE3_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 2, 2>(FXMVECTOR V) noexcept { + return _mm_moveldup_ps(V); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { + return _mm_movehdup_ps(V); +} +#endif + +#if defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) && \ + defined(_XM_FAVOR_INTEL_) +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { + return _mm_broadcastss_ps(V); +} +#endif + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { + return vdupq_lane_f32(vget_low_f32(V), 0); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 1, 1>(FXMVECTOR V) noexcept { + return vdupq_lane_f32(vget_low_f32(V), 1); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 2, 2>(FXMVECTOR V) noexcept { + return vdupq_lane_f32(vget_high_f32(V), 0); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 3, 3, 3>(FXMVECTOR V) noexcept { + return vdupq_lane_f32(vget_high_f32(V), 1); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 3, 2>(FXMVECTOR V) noexcept { + return vrev64q_f32(V); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 0, 1>(FXMVECTOR V) noexcept { + float32x2_t vt = vget_low_f32(V); + return vcombine_f32(vt, vt); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 2, 3>(FXMVECTOR V) noexcept { + float32x2_t vt = vget_high_f32(V); + return vcombine_f32(vt, vt); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 1, 0>(FXMVECTOR V) noexcept { + float32x2_t vt = vrev64_f32(vget_low_f32(V)); + return vcombine_f32(vt, vt); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 3, 2>(FXMVECTOR V) noexcept { + float32x2_t vt = vrev64_f32(vget_high_f32(V)); + return vcombine_f32(vt, vt); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 1, 3, 2>(FXMVECTOR V) noexcept { + return vcombine_f32(vget_low_f32(V), vrev64_f32(vget_high_f32(V))); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 0, 2, 3>(FXMVECTOR V) noexcept { + return vcombine_f32(vrev64_f32(vget_low_f32(V)), vget_high_f32(V)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 1, 0>(FXMVECTOR V) noexcept { + return vcombine_f32(vget_high_f32(V), vrev64_f32(vget_low_f32(V))); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 0, 1>(FXMVECTOR V) noexcept { + return vcombine_f32(vrev64_f32(vget_high_f32(V)), vget_low_f32(V)); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 2, 1, 0>(FXMVECTOR V) noexcept { + return vcombine_f32(vrev64_f32(vget_high_f32(V)), + vrev64_f32(vget_low_f32(V))); +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 2, 2>(FXMVECTOR V) noexcept { + return vtrnq_f32(V, V).val[0]; +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { + return vtrnq_f32(V, V).val[1]; +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 1, 1>(FXMVECTOR V) noexcept { + return vzipq_f32(V, V).val[0]; +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 2, 3, 3>(FXMVECTOR V) noexcept { + return vzipq_f32(V, V).val[1]; +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 2, 0, 2>(FXMVECTOR V) noexcept { + return vuzpq_f32(V, V).val[0]; +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 3, 1, 3>(FXMVECTOR V) noexcept { + return vuzpq_f32(V, V).val[1]; +} + +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 2, 3, 0>(FXMVECTOR V) noexcept { + return vextq_f32(V, V, 1); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<2, 3, 0, 1>(FXMVECTOR V) noexcept { + return vextq_f32(V, V, 2); +} +template <> +inline XMVECTOR XM_CALLCONV XMVectorSwizzle<3, 0, 1, 2>(FXMVECTOR V) noexcept { + return vextq_f32(V, V, 3); +} + +#endif // _XM_ARM_NEON_INTRINSICS_ && !_XM_NO_INTRINSICS_ + +//------------------------------------------------------------------------------ + +template +inline XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, + FXMVECTOR V2) noexcept { + static_assert(Elements < 4, "Elements template parameter out of range"); + return XMVectorPermute(V1, V2); +} + +template +inline XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V) noexcept { + static_assert(Elements < 4, "Elements template parameter out of range"); + return XMVectorSwizzle(V); +} + +template +inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V) noexcept { + static_assert(Elements < 4, "Elements template parameter out of range"); + return XMVectorSwizzle<(4 - Elements) & 3, (5 - Elements) & 3, + (6 - Elements) & 3, (7 - Elements) & 3>(V); +} + +template +inline XMVECTOR XM_CALLCONV XMVectorInsert(FXMVECTOR VD, + FXMVECTOR VS) noexcept { + XMVECTOR Control = XMVectorSelectControl(Select0 & 1, Select1 & 1, + Select2 & 1, Select3 & 1); + return XMVectorSelect(VD, XMVectorRotateLeft(VS), + Control); +} + +/**************************************************************************** + * + * Globals + * + ****************************************************************************/ + +// The purpose of the following global constants is to prevent redundant +// reloading of the constants when they are referenced by more than one +// separate inline math routine called within the same function. Declaring +// a constant locally within a routine is sufficient to prevent redundant +// reloads of that constant when that single routine is called multiple +// times in a function, but if the constant is used (and declared) in a +// separate math routine it would be reloaded. + +#ifndef XMGLOBALCONST +#if defined(__GNUC__) && !defined(__MINGW32__) +#define XMGLOBALCONST extern const __attribute__((weak)) +#else +#define XMGLOBALCONST extern const __declspec(selectany) +#endif +#endif + +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = { + {{-0.16666667f, +0.0083333310f, -0.00019840874f, +2.7525562e-06f}}}; +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = { + {{-2.3889859e-08f, -0.16665852f /*Est1*/, +0.0083139502f /*Est2*/, + -0.00018524670f /*Est3*/}}}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = { + {{-0.5f, +0.041666638f, -0.0013888378f, +2.4760495e-05f}}}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = { + {{-2.6051615e-07f, -0.49992746f /*Est1*/, +0.041493919f /*Est2*/, + -0.0012712436f /*Est3*/}}}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = { + {{1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f}}}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = { + {{2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f}}}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = { + {{5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f}}}; +XMGLOBALCONST XMVECTORF32 g_XMArcCoefficients0 = { + {{+1.5707963050f, -0.2145988016f, +0.0889789874f, -0.0501743046f}}}; +XMGLOBALCONST XMVECTORF32 g_XMArcCoefficients1 = { + {{+0.0308918810f, -0.0170881256f, +0.0066700901f, -0.0012624911f}}}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = { + {{-0.3333314528f, +0.1999355085f, -0.1420889944f, +0.1065626393f}}}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = { + {{-0.0752896400f, +0.0429096138f, -0.0161657367f, +0.0028662257f}}}; +XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients0 = { + {{+0.999866f, +0.999866f, +0.999866f, +0.999866f}}}; +XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients1 = { + {{-0.3302995f, +0.180141f, -0.085133f, +0.0208351f}}}; +XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = { + {{2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI}}}; +XMGLOBALCONST XMVECTORF32 g_XMArcEstCoefficients = { + {{+1.5707288f, -0.2121144f, +0.0742610f, -0.0187293f}}}; +XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = { + {{XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI}}}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = {{{1.0f, 0.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = {{{0.0f, 1.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = {{{0.0f, 0.0f, 1.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = {{{0.0f, 0.0f, 0.0f, 1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = {{{-1.0f, 0.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = {{{0.0f, -1.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = {{{0.0f, 0.0f, -1.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = {{{0.0f, 0.0f, 0.0f, -1.0f}}}; +XMGLOBALCONST XMVECTORU32 g_XMNegativeZero = { + {{0x80000000, 0x80000000, 0x80000000, 0x80000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMNegate3 = { + {{0x80000000, 0x80000000, 0x80000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskXY = { + {{0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMMask3 = { + {{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskX = { + {{0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskY = { + {{0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskZ = { + {{0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskW = { + {{0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF}}}; +XMGLOBALCONST XMVECTORF32 g_XMOne = {{{1.0f, 1.0f, 1.0f, 1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMOne3 = {{{1.0f, 1.0f, 1.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMZero = {{{0.0f, 0.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMTwo = {{{2.f, 2.f, 2.f, 2.f}}}; +XMGLOBALCONST XMVECTORF32 g_XMFour = {{{4.f, 4.f, 4.f, 4.f}}}; +XMGLOBALCONST XMVECTORF32 g_XMSix = {{{6.f, 6.f, 6.f, 6.f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = {{{-1.0f, -1.0f, -1.0f, -1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMOneHalf = {{{0.5f, 0.5f, 0.5f, 0.5f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = { + {{-0.5f, -0.5f, -0.5f, -0.5f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = { + {{-XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegativePi = {{{-XM_PI, -XM_PI, -XM_PI, -XM_PI}}}; +XMGLOBALCONST XMVECTORF32 g_XMHalfPi = { + {{XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2}}}; +XMGLOBALCONST XMVECTORF32 g_XMPi = {{{XM_PI, XM_PI, XM_PI, XM_PI}}}; +XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = { + {{XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI}}}; +XMGLOBALCONST XMVECTORF32 g_XMTwoPi = {{{XM_2PI, XM_2PI, XM_2PI, XM_2PI}}}; +XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = { + {{XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI}}}; +XMGLOBALCONST XMVECTORF32 g_XMEpsilon = { + {{1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f}}}; +XMGLOBALCONST XMVECTORI32 g_XMInfinity = { + {{0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000}}}; +XMGLOBALCONST XMVECTORI32 g_XMQNaN = { + {{0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000}}}; +XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = { + {{0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF}}}; +XMGLOBALCONST XMVECTORI32 g_XMAbsMask = { + {{0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF}}}; +XMGLOBALCONST XMVECTORI32 g_XMFltMin = { + {{0x00800000, 0x00800000, 0x00800000, 0x00800000}}}; +XMGLOBALCONST XMVECTORI32 g_XMFltMax = { + {{0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF}}}; +XMGLOBALCONST XMVECTORU32 g_XMNegOneMask = { + {{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskA8R8G8B8 = { + {{0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipA8R8G8B8 = { + {{0x00000000, 0x00000000, 0x00000000, 0x80000000}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = { + {{0.0f, 0.0f, 0.0f, float(0x80000000U)}}}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = { + {{1.0f / (255.0f * float(0x10000)), 1.0f / (255.0f * float(0x100)), + 1.0f / 255.0f, 1.0f / (255.0f * float(0x1000000))}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskA2B10G10R10 = { + {{0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipA2B10G10R10 = { + {{0x00000200, 0x00080000, 0x20000000, 0x80000000}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = { + {{-512.0f, -512.0f * float(0x400), -512.0f * float(0x100000), + float(0x80000000U)}}}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = { + {{1.0f / 511.0f, 1.0f / (511.0f * float(0x400)), + 1.0f / (511.0f * float(0x100000)), 1.0f / (3.0f * float(0x40000000))}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16 = { + {{0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = { + {{0x00008000, 0x00000000, 0x00000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = {{{-32768.0f, 0.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = { + {{1.0f / 32767.0f, 1.0f / (32767.0f * 65536.0f), 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16Z16W16 = { + {{0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000}}}; +XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = { + {{0x00008000, 0x00008000, 0x00000000, 0x00000000}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = { + {{-32768.0f, -32768.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = { + {{1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / (32767.0f * 65536.0f), + 1.0f / (32767.0f * 65536.0f)}}}; +XMGLOBALCONST XMVECTORF32 g_XMNoFraction = { + {{8388608.0f, 8388608.0f, 8388608.0f, 8388608.0f}}}; +XMGLOBALCONST XMVECTORI32 g_XMMaskByte = { + {{0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegateX = {{{-1.0f, 1.0f, 1.0f, 1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegateY = {{{1.0f, -1.0f, 1.0f, 1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegateZ = {{{1.0f, 1.0f, -1.0f, 1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMNegateW = {{{1.0f, 1.0f, 1.0f, -1.0f}}}; +XMGLOBALCONST XMVECTORU32 g_XMSelect0101 = { + {{XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1}}}; +XMGLOBALCONST XMVECTORU32 g_XMSelect1010 = { + {{XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0}}}; +XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { + {{0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD}}}; +XMGLOBALCONST XMVECTORU32 g_XMSelect1000 = { + {{XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0}}}; +XMGLOBALCONST XMVECTORU32 g_XMSelect1100 = { + {{XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0}}}; +XMGLOBALCONST XMVECTORU32 g_XMSelect1110 = { + {{XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0}}}; +XMGLOBALCONST XMVECTORU32 g_XMSelect1011 = { + {{XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = { + {{1.0f, 1.0f / 65536.0f, 0.0f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = { + {{1.0f, 1.0f, 1.0f / 65536.0f, 1.0f / 65536.0f}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipY = {{{0, 0x80000000, 0, 0}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipZ = {{{0, 0, 0x80000000, 0}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipW = {{{0, 0, 0, 0x80000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipYZ = {{{0, 0x80000000, 0x80000000, 0}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipZW = {{{0, 0, 0x80000000, 0x80000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMFlipYW = {{{0, 0x80000000, 0, 0x80000000}}}; +XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = { + {{0x3FF, 0x3FF << 10, 0x3FF << 20, static_cast(0xC0000000)}}}; +XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = { + {{0x200, 0x200 << 10, 0x200 << 20, 0}}}; +XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {{{0, 0, 0, 32768.0f * 65536.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = { + {{-512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 0}}}; +XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = { + {{1.0f, 1.0f / 1024.0f, 1.0f / (1024.0f * 1024.0f), + 1.0f / (1024.0f * 1024.0f * 1024.0f)}}}; +XMGLOBALCONST XMVECTORU32 g_XMMaskByte4 = { + {{0xFF, 0xFF00, 0xFF0000, 0xFF000000}}}; +XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = { + {{0x80, 0x8000, 0x800000, 0x00000000}}}; +XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = { + {{-128.0f, -128.0f * 256.0f, -128.0f * 65536.0f, 0}}}; +XMGLOBALCONST XMVECTORF32 g_XMFixUnsigned = { + {{32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f, + 32768.0f * 65536.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMMaxInt = { + {{65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f, + 65536.0f * 32768.0f - 128.0f, 65536.0f * 32768.0f - 128.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMMaxUInt = { + {{65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f, + 65536.0f * 65536.0f - 256.0f, 65536.0f * 65536.0f - 256.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMUnsignedFix = { + {{32768.0f * 65536.0f, 32768.0f * 65536.0f, 32768.0f * 65536.0f, + 32768.0f * 65536.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMsrgbScale = {{{12.92f, 12.92f, 12.92f, 1.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMsrgbA = {{{0.055f, 0.055f, 0.055f, 0.0f}}}; +XMGLOBALCONST XMVECTORF32 g_XMsrgbA1 = {{{1.055f, 1.055f, 1.055f, 1.0f}}}; +XMGLOBALCONST XMVECTORI32 g_XMExponentBias = {{{127, 127, 127, 127}}}; +XMGLOBALCONST XMVECTORI32 g_XMSubnormalExponent = {{{-126, -126, -126, -126}}}; +XMGLOBALCONST XMVECTORI32 g_XMNumTrailing = {{{23, 23, 23, 23}}}; +XMGLOBALCONST XMVECTORI32 g_XMMinNormal = { + {{0x00800000, 0x00800000, 0x00800000, 0x00800000}}}; +XMGLOBALCONST XMVECTORU32 g_XMNegInfinity = { + {{0xFF800000, 0xFF800000, 0xFF800000, 0xFF800000}}}; +XMGLOBALCONST XMVECTORU32 g_XMNegQNaN = { + {{0xFFC00000, 0xFFC00000, 0xFFC00000, 0xFFC00000}}}; +XMGLOBALCONST XMVECTORI32 g_XMBin128 = { + {{0x43000000, 0x43000000, 0x43000000, 0x43000000}}}; +XMGLOBALCONST XMVECTORU32 g_XMBinNeg150 = { + {{0xC3160000, 0xC3160000, 0xC3160000, 0xC3160000}}}; +XMGLOBALCONST XMVECTORI32 g_XM253 = {{{253, 253, 253, 253}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst1 = { + {{-6.93147182e-1f, -6.93147182e-1f, -6.93147182e-1f, -6.93147182e-1f}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst2 = { + {{+2.40226462e-1f, +2.40226462e-1f, +2.40226462e-1f, +2.40226462e-1f}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst3 = { + {{-5.55036440e-2f, -5.55036440e-2f, -5.55036440e-2f, -5.55036440e-2f}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst4 = { + {{+9.61597636e-3f, +9.61597636e-3f, +9.61597636e-3f, +9.61597636e-3f}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst5 = { + {{-1.32823968e-3f, -1.32823968e-3f, -1.32823968e-3f, -1.32823968e-3f}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst6 = { + {{+1.47491097e-4f, +1.47491097e-4f, +1.47491097e-4f, +1.47491097e-4f}}}; +XMGLOBALCONST XMVECTORF32 g_XMExpEst7 = { + {{-1.08635004e-5f, -1.08635004e-5f, -1.08635004e-5f, -1.08635004e-5f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst0 = { + {{+1.442693f, +1.442693f, +1.442693f, +1.442693f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst1 = { + {{-0.721242f, -0.721242f, -0.721242f, -0.721242f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst2 = { + {{+0.479384f, +0.479384f, +0.479384f, +0.479384f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst3 = { + {{-0.350295f, -0.350295f, -0.350295f, -0.350295f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst4 = { + {{+0.248590f, +0.248590f, +0.248590f, +0.248590f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst5 = { + {{-0.145700f, -0.145700f, -0.145700f, -0.145700f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst6 = { + {{+0.057148f, +0.057148f, +0.057148f, +0.057148f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLogEst7 = { + {{-0.010578f, -0.010578f, -0.010578f, -0.010578f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLgE = { + {{+1.442695f, +1.442695f, +1.442695f, +1.442695f}}}; +XMGLOBALCONST XMVECTORF32 g_XMInvLgE = { + {{+6.93147182e-1f, +6.93147182e-1f, +6.93147182e-1f, +6.93147182e-1f}}}; +XMGLOBALCONST XMVECTORF32 g_XMLg10 = { + {{+3.321928f, +3.321928f, +3.321928f, +3.321928f}}}; +XMGLOBALCONST XMVECTORF32 g_XMInvLg10 = { + {{+3.010299956e-1f, +3.010299956e-1f, +3.010299956e-1f, +3.010299956e-1f}}}; +XMGLOBALCONST XMVECTORF32 g_UByteMax = {{{255.0f, 255.0f, 255.0f, 255.0f}}}; +XMGLOBALCONST XMVECTORF32 g_ByteMin = {{{-127.0f, -127.0f, -127.0f, -127.0f}}}; +XMGLOBALCONST XMVECTORF32 g_ByteMax = {{{127.0f, 127.0f, 127.0f, 127.0f}}}; +XMGLOBALCONST XMVECTORF32 g_ShortMin = { + {{-32767.0f, -32767.0f, -32767.0f, -32767.0f}}}; +XMGLOBALCONST XMVECTORF32 g_ShortMax = { + {{32767.0f, 32767.0f, 32767.0f, 32767.0f}}}; +XMGLOBALCONST XMVECTORF32 g_UShortMax = { + {{65535.0f, 65535.0f, 65535.0f, 65535.0f}}}; + +/**************************************************************************** + * + * Implementation + * + ****************************************************************************/ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4068 4214 4204 4365 4616 4640 6001 6101) +// C4068/4616: ignore unknown pragmas +// C4214/4204: nonstandard extension used +// C4365/4640: Off by default noise +// C6001/6101: False positives +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#pragma prefast(disable : 26495, "Union initialization confuses /analyze") +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wfloat-equal" +#pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1, + uint32_t C2, + uint32_t C3) noexcept { +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = (0 - (C0 & 1)) & 0x3F800000; + vResult.u[1] = (0 - (C1 & 1)) & 0x3F800000; + vResult.u[2] = (0 - (C2 & 1)) & 0x3F800000; + vResult.u[3] = (0 - (C3 & 1)) & 0x3F800000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = (0 - (C0 & 1)) & 0x3F800000; + vResult.u[1] = (0 - (C1 & 1)) & 0x3F800000; + vResult.u[2] = (0 - (C2 & 1)) & 0x3F800000; + vResult.u[3] = (0 - (C3 & 1)) & 0x3F800000; + return vResult.v; +#else // XM_SSE_INTRINSICS_ + static const XMVECTORU32 g_vMask1 = {{{1, 1, 1, 1}}}; + // Move the parms to a vector + __m128i vTemp = _mm_set_epi32(static_cast(C3), static_cast(C2), + static_cast(C1), static_cast(C0)); + // Mask off the low bits + vTemp = _mm_and_si128(vTemp, g_vMask1); + // 0xFFFFFFFF on true bits + vTemp = _mm_cmpeq_epi32(vTemp, g_vMask1); + // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f + vTemp = _mm_and_si128(vTemp, g_XMOne); + return _mm_castsi128_ps(vTemp); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV +XMVectorSplatConstant(int32_t IntConstant, uint32_t DivExponent) noexcept { + assert(IntConstant >= -16 && IntConstant <= 15); + assert(DivExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + + using DirectX::XMConvertVectorIntToFloat; + + XMVECTORI32 V = {{{IntConstant, IntConstant, IntConstant, IntConstant}}}; + return XMConvertVectorIntToFloat(V.v, DivExponent); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Splat the int + int32x4_t vScale = vdupq_n_s32(IntConstant); + // Convert to a float + XMVECTOR vResult = vcvtq_f32_s32(vScale); + // Convert DivExponent into 1.0f/(1<(&vScale)[0]); + return vResult; +#else // XM_SSE_INTRINSICS_ + // Splat the int + __m128i vScale = _mm_set1_epi32(IntConstant); + // Convert to a float + XMVECTOR vResult = _mm_cvtepi32_ps(vScale); + // Convert DivExponent into 1.0f/(1<(uScale)); + // Multiply by the reciprocal (Perform a right shift by DivExponent) + vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(vScale)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV +XMVectorSplatConstantInt(int32_t IntConstant) noexcept { + assert(IntConstant >= -16 && IntConstant <= 15); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORI32 V = {{{IntConstant, IntConstant, IntConstant, IntConstant}}}; + return V.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t V = vdupq_n_s32(IntConstant); + return reinterpret_cast(&V)[0]; +#else // XM_SSE_INTRINSICS_ + __m128i V = _mm_set1_epi32(IntConstant); + return _mm_castsi128_ps(V); +#endif +} + +#include "DirectXMathConvert.inl" +#include "DirectXMathVector.inl" +#include "DirectXMathMatrix.inl" +#include "DirectXMathMisc.inl" + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +} // namespace DirectX diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathConvert.inl b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathConvert.inl similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathConvert.inl rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathConvert.inl index 782d29595..aaf9ef119 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathConvert.inl +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathConvert.inl @@ -1,2201 +1,2201 @@ -//------------------------------------------------------------------------------------- -// DirectXMathConvert.inl -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -/**************************************************************************** - * - * Data conversion - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4701) -// C4701: false positives -#endif - -inline XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat -( - FXMVECTOR VInt, - uint32_t DivExponent -) noexcept -{ - assert(DivExponent < 32); -#if defined(_XM_NO_INTRINSICS_) - float fScale = 1.0f / static_cast(1U << DivExponent); - uint32_t ElementIndex = 0; - XMVECTOR Result; - do - { - auto iTemp = static_cast(VInt.vector4_u32[ElementIndex]); - Result.vector4_f32[ElementIndex] = static_cast(iTemp)* fScale; - } - while (++ElementIndex < 4); - return Result; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fScale = 1.0f / static_cast(1U << DivExponent); - float32x4_t vResult = vcvtq_f32_s32(vreinterpretq_s32_f32(VInt)); - return vmulq_n_f32(vResult, fScale); -#else // _XM_SSE_INTRINSICS_ - // Convert to floats - XMVECTOR vResult = _mm_cvtepi32_ps(_mm_castps_si128(VInt)); - // Convert DivExponent into 1.0f/(1<(uScale)); - vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(vScale)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt -( - FXMVECTOR VFloat, - uint32_t MulExponent -) noexcept -{ - assert(MulExponent < 32); -#if defined(_XM_NO_INTRINSICS_) - // Get the scalar factor. - auto fScale = static_cast(1U << MulExponent); - uint32_t ElementIndex = 0; - XMVECTOR Result; - do - { - int32_t iResult; - float fTemp = VFloat.vector4_f32[ElementIndex] * fScale; - if (fTemp <= -(65536.0f * 32768.0f)) - { - iResult = (-0x7FFFFFFF) - 1; - } - else if (fTemp > (65536.0f * 32768.0f) - 128.0f) - { - iResult = 0x7FFFFFFF; - } - else - { - iResult = static_cast(fTemp); - } - Result.vector4_u32[ElementIndex] = static_cast(iResult); - } - while (++ElementIndex < 4); - return Result; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmulq_n_f32(VFloat, static_cast(1U << MulExponent)); - // In case of positive overflow, detect it - uint32x4_t vOverflow = vcgtq_f32(vResult, g_XMMaxInt); - // Float to int conversion - int32x4_t vResulti = vcvtq_s32_f32(vResult); - // If there was positive overflow, set to 0x7FFFFFFF - vResult = vreinterpretq_f32_u32(vandq_u32(vOverflow, g_XMAbsMask)); - vOverflow = vbicq_u32(vreinterpretq_u32_s32(vResulti), vOverflow); - vOverflow = vorrq_u32(vOverflow, vreinterpretq_u32_f32(vResult)); - return vreinterpretq_f32_u32(vOverflow); -#else // _XM_SSE_INTRINSICS_ - XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); - vResult = _mm_mul_ps(vResult, VFloat); - // In case of positive overflow, detect it - XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxInt); - // Float to int conversion - __m128i vResulti = _mm_cvttps_epi32(vResult); - // If there was positive overflow, set to 0x7FFFFFFF - vResult = _mm_and_ps(vOverflow, g_XMAbsMask); - vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); - vOverflow = _mm_or_ps(vOverflow, vResult); - return vOverflow; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat -( - FXMVECTOR VUInt, - uint32_t DivExponent -) noexcept -{ - assert(DivExponent < 32); -#if defined(_XM_NO_INTRINSICS_) - float fScale = 1.0f / static_cast(1U << DivExponent); - uint32_t ElementIndex = 0; - XMVECTOR Result; - do - { - Result.vector4_f32[ElementIndex] = static_cast(VUInt.vector4_u32[ElementIndex])* fScale; - } - while (++ElementIndex < 4); - return Result; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fScale = 1.0f / static_cast(1U << DivExponent); - float32x4_t vResult = vcvtq_f32_u32(vreinterpretq_u32_f32(VUInt)); - return vmulq_n_f32(vResult, fScale); -#else // _XM_SSE_INTRINSICS_ - // For the values that are higher than 0x7FFFFFFF, a fixup is needed - // Determine which ones need the fix. - XMVECTOR vMask = _mm_and_ps(VUInt, g_XMNegativeZero); - // Force all values positive - XMVECTOR vResult = _mm_xor_ps(VUInt, vMask); - // Convert to floats - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Convert 0x80000000 -> 0xFFFFFFFF - __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); - // For only the ones that are too big, add the fixup - vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); - vResult = _mm_add_ps(vResult, vMask); - // Convert DivExponent into 1.0f/(1<(uScale)); - vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(iMask)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt -( - FXMVECTOR VFloat, - uint32_t MulExponent -) noexcept -{ - assert(MulExponent < 32); -#if defined(_XM_NO_INTRINSICS_) - // Get the scalar factor. - auto fScale = static_cast(1U << MulExponent); - uint32_t ElementIndex = 0; - XMVECTOR Result; - do - { - uint32_t uResult; - float fTemp = VFloat.vector4_f32[ElementIndex] * fScale; - if (fTemp <= 0.0f) - { - uResult = 0; - } - else if (fTemp >= (65536.0f * 65536.0f)) - { - uResult = 0xFFFFFFFFU; - } - else - { - uResult = static_cast(fTemp); - } - Result.vector4_u32[ElementIndex] = uResult; - } - while (++ElementIndex < 4); - return Result; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmulq_n_f32(VFloat, static_cast(1U << MulExponent)); - // In case of overflow, detect it - uint32x4_t vOverflow = vcgtq_f32(vResult, g_XMMaxUInt); - // Float to int conversion - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - // If there was overflow, set to 0xFFFFFFFFU - vResult = vreinterpretq_f32_u32(vbicq_u32(vResulti, vOverflow)); - vOverflow = vorrq_u32(vOverflow, vreinterpretq_u32_f32(vResult)); - return vreinterpretq_f32_u32(vOverflow); -#else // _XM_SSE_INTRINSICS_ - XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); - vResult = _mm_mul_ps(vResult, VFloat); - // Clamp to >=0 - vResult = _mm_max_ps(vResult, g_XMZero); - // Any numbers that are too big, set to 0xFFFFFFFFU - XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); - XMVECTOR vValue = g_XMUnsignedFix; - // Too large for a signed integer? - XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); - // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise - vValue = _mm_and_ps(vValue, vMask); - // Perform fixup only on numbers too large (Keeps low bit precision) - vResult = _mm_sub_ps(vResult, vValue); - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Convert from signed to unsigned pnly if greater than 0x80000000 - vMask = _mm_and_ps(vMask, g_XMNegativeZero); - vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); - // On those that are too large, set to 0xFFFFFFFF - vResult = _mm_or_ps(vResult, vOverflow); - return vResult; -#endif -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * Vector and matrix load operations - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt(const uint32_t* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = *pSource; - V.vector4_u32[1] = 0; - V.vector4_u32[2] = 0; - V.vector4_u32[3] = 0; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t zero = vdupq_n_u32(0); - return vreinterpretq_f32_u32(vld1q_lane_u32(pSource, zero, 0)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_load_ss(reinterpret_cast(pSource)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat(const float* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = *pSource; - V.vector4_f32[1] = 0.f; - V.vector4_f32[2] = 0.f; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t zero = vdupq_n_f32(0); - return vld1q_lane_f32(pSource, zero, 0); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_load_ss(pSource); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt2(const uint32_t* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = pSource[0]; - V.vector4_u32[1] = pSource[1]; - V.vector4_u32[2] = 0; - V.vector4_u32[3] = 0; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t x = vld1_u32(pSource); - uint32x2_t zero = vdup_n_u32(0); - return vreinterpretq_f32_u32(vcombine_u32(x, zero)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt2A(const uint32_t* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = pSource[0]; - V.vector4_u32[1] = pSource[1]; - V.vector4_u32[2] = 0; - V.vector4_u32[3] = 0; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - uint32x2_t x = vld1_u32_ex(pSource, 64); -#else - uint32x2_t x = vld1_u32(pSource); -#endif - uint32x2_t zero = vdup_n_u32(0); - return vreinterpretq_f32_u32(vcombine_u32(x, zero)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat2(const XMFLOAT2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = pSource->x; - V.vector4_f32[1] = pSource->y; - V.vector4_f32[2] = 0.f; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t x = vld1_f32(reinterpret_cast(pSource)); - float32x2_t zero = vdup_n_f32(0); - return vcombine_f32(x, zero); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat2A(const XMFLOAT2A* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = pSource->x; - V.vector4_f32[1] = pSource->y; - V.vector4_f32[2] = 0.f; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - float32x2_t x = vld1_f32_ex(reinterpret_cast(pSource), 64); -#else - float32x2_t x = vld1_f32(reinterpret_cast(pSource)); -#endif - float32x2_t zero = vdup_n_f32(0); - return vcombine_f32(x, zero); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadSInt2(const XMINT2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = static_cast(pSource->x); - V.vector4_f32[1] = static_cast(pSource->y); - V.vector4_f32[2] = 0.f; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x2_t x = vld1_s32(reinterpret_cast(pSource)); - float32x2_t v = vcvt_f32_s32(x); - float32x2_t zero = vdup_n_f32(0); - return vcombine_f32(v, zero); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 V = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - return _mm_cvtepi32_ps(_mm_castps_si128(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUInt2(const XMUINT2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = static_cast(pSource->x); - V.vector4_f32[1] = static_cast(pSource->y); - V.vector4_f32[2] = 0.f; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t x = vld1_u32(reinterpret_cast(pSource)); - float32x2_t v = vcvt_f32_u32(x); - float32x2_t zero = vdup_n_f32(0); - return vcombine_f32(v, zero); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 V = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - // For the values that are higher than 0x7FFFFFFF, a fixup is needed - // Determine which ones need the fix. - XMVECTOR vMask = _mm_and_ps(V, g_XMNegativeZero); - // Force all values positive - XMVECTOR vResult = _mm_xor_ps(V, vMask); - // Convert to floats - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Convert 0x80000000 -> 0xFFFFFFFF - __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); - // For only the ones that are too big, add the fixup - vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); - vResult = _mm_add_ps(vResult, vMask); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt3(const uint32_t* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = pSource[0]; - V.vector4_u32[1] = pSource[1]; - V.vector4_u32[2] = pSource[2]; - V.vector4_u32[3] = 0; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t x = vld1_u32(pSource); - uint32x2_t zero = vdup_n_u32(0); - uint32x2_t y = vld1_lane_u32(pSource + 2, zero, 0); - return vreinterpretq_f32_u32(vcombine_u32(x, y)); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); - return _mm_insert_ps(xy, z, 0x20); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); - return _mm_movelh_ps(xy, z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt3A(const uint32_t* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = pSource[0]; - V.vector4_u32[1] = pSource[1]; - V.vector4_u32[2] = pSource[2]; - V.vector4_u32[3] = 0; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Reads an extra integer which is zero'd -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - uint32x4_t V = vld1q_u32_ex(pSource, 128); -#else - uint32x4_t V = vld1q_u32(pSource); -#endif - return vreinterpretq_f32_u32(vsetq_lane_u32(0, V, 3)); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); - return _mm_insert_ps(xy, z, 0x20); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); - return _mm_movelh_ps(xy, z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat3(const XMFLOAT3* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = pSource->x; - V.vector4_f32[1] = pSource->y; - V.vector4_f32[2] = pSource->z; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t x = vld1_f32(reinterpret_cast(pSource)); - float32x2_t zero = vdup_n_f32(0); - float32x2_t y = vld1_lane_f32(reinterpret_cast(pSource) + 2, zero, 0); - return vcombine_f32(x, y); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(&pSource->z); - return _mm_insert_ps(xy, z, 0x20); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(&pSource->z); - return _mm_movelh_ps(xy, z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat3A(const XMFLOAT3A* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = pSource->x; - V.vector4_f32[1] = pSource->y; - V.vector4_f32[2] = pSource->z; - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Reads an extra float which is zero'd -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - float32x4_t V = vld1q_f32_ex(reinterpret_cast(pSource), 128); -#else - float32x4_t V = vld1q_f32(reinterpret_cast(pSource)); -#endif - return vsetq_lane_f32(0, V, 3); -#elif defined(_XM_SSE_INTRINSICS_) - // Reads an extra float which is zero'd - __m128 V = _mm_load_ps(&pSource->x); - return _mm_and_ps(V, g_XMMask3); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadSInt3(const XMINT3* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR V; - V.vector4_f32[0] = static_cast(pSource->x); - V.vector4_f32[1] = static_cast(pSource->y); - V.vector4_f32[2] = static_cast(pSource->z); - V.vector4_f32[3] = 0.f; - return V; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x2_t x = vld1_s32(reinterpret_cast(pSource)); - int32x2_t zero = vdup_n_s32(0); - int32x2_t y = vld1_lane_s32(reinterpret_cast(pSource) + 2, zero, 0); - int32x4_t v = vcombine_s32(x, y); - return vcvtq_f32_s32(v); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(reinterpret_cast(&pSource->z)); - __m128 V = _mm_movelh_ps(xy, z); - return _mm_cvtepi32_ps(_mm_castps_si128(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUInt3(const XMUINT3* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = static_cast(pSource->x); - V.vector4_f32[1] = static_cast(pSource->y); - V.vector4_f32[2] = static_cast(pSource->z); - V.vector4_f32[3] = 0.f; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t x = vld1_u32(reinterpret_cast(pSource)); - uint32x2_t zero = vdup_n_u32(0); - uint32x2_t y = vld1_lane_u32(reinterpret_cast(pSource) + 2, zero, 0); - uint32x4_t v = vcombine_u32(x, y); - return vcvtq_f32_u32(v); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); - __m128 z = _mm_load_ss(reinterpret_cast(&pSource->z)); - __m128 V = _mm_movelh_ps(xy, z); - // For the values that are higher than 0x7FFFFFFF, a fixup is needed - // Determine which ones need the fix. - XMVECTOR vMask = _mm_and_ps(V, g_XMNegativeZero); - // Force all values positive - XMVECTOR vResult = _mm_xor_ps(V, vMask); - // Convert to floats - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Convert 0x80000000 -> 0xFFFFFFFF - __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); - // For only the ones that are too big, add the fixup - vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); - vResult = _mm_add_ps(vResult, vMask); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt4(const uint32_t* pSource) noexcept -{ - assert(pSource); - -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = pSource[0]; - V.vector4_u32[1] = pSource[1]; - V.vector4_u32[2] = pSource[2]; - V.vector4_u32[3] = pSource[3]; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vld1q_u32(pSource)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadInt4A(const uint32_t* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_u32[0] = pSource[0]; - V.vector4_u32[1] = pSource[1]; - V.vector4_u32[2] = pSource[2]; - V.vector4_u32[3] = pSource[3]; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - return vld1q_u32_ex(pSource, 128); -#else - return vreinterpretq_f32_u32(vld1q_u32(pSource)); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_load_si128(reinterpret_cast(pSource)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat4(const XMFLOAT4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = pSource->x; - V.vector4_f32[1] = pSource->y; - V.vector4_f32[2] = pSource->z; - V.vector4_f32[3] = pSource->w; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vld1q_f32(reinterpret_cast(pSource)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_loadu_ps(&pSource->x); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat4A(const XMFLOAT4A* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = pSource->x; - V.vector4_f32[1] = pSource->y; - V.vector4_f32[2] = pSource->z; - V.vector4_f32[3] = pSource->w; - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - return vld1q_f32_ex(reinterpret_cast(pSource), 128); -#else - return vld1q_f32(reinterpret_cast(pSource)); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_load_ps(&pSource->x); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadSInt4(const XMINT4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR V; - V.vector4_f32[0] = static_cast(pSource->x); - V.vector4_f32[1] = static_cast(pSource->y); - V.vector4_f32[2] = static_cast(pSource->z); - V.vector4_f32[3] = static_cast(pSource->w); - return V; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t v = vld1q_s32(reinterpret_cast(pSource)); - return vcvtq_f32_s32(v); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); - return _mm_cvtepi32_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUInt4(const XMUINT4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR V; - V.vector4_f32[0] = static_cast(pSource->x); - V.vector4_f32[1] = static_cast(pSource->y); - V.vector4_f32[2] = static_cast(pSource->z); - V.vector4_f32[3] = static_cast(pSource->w); - return V; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t v = vld1q_u32(reinterpret_cast(pSource)); - return vcvtq_f32_u32(v); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); - // For the values that are higher than 0x7FFFFFFF, a fixup is needed - // Determine which ones need the fix. - XMVECTOR vMask = _mm_and_ps(_mm_castsi128_ps(V), g_XMNegativeZero); - // Force all values positive - XMVECTOR vResult = _mm_xor_ps(_mm_castsi128_ps(V), vMask); - // Convert to floats - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Convert 0x80000000 -> 0xFFFFFFFF - __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); - // For only the ones that are too big, add the fixup - vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); - vResult = _mm_add_ps(vResult, vMask); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat3x3(const XMFLOAT3X3* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[0][1]; - M.r[0].vector4_f32[2] = pSource->m[0][2]; - M.r[0].vector4_f32[3] = 0.0f; - - M.r[1].vector4_f32[0] = pSource->m[1][0]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[1][2]; - M.r[1].vector4_f32[3] = 0.0f; - - M.r[2].vector4_f32[0] = pSource->m[2][0]; - M.r[2].vector4_f32[1] = pSource->m[2][1]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = 0.0f; - M.r[3].vector4_f32[0] = 0.0f; - M.r[3].vector4_f32[1] = 0.0f; - M.r[3].vector4_f32[2] = 0.0f; - M.r[3].vector4_f32[3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); - float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); - float32x2_t v2 = vcreate_f32(static_cast(*reinterpret_cast(&pSource->m[2][2]))); - float32x4_t T = vextq_f32(v0, v1, 3); - - XMMATRIX M; - M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); - M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T), g_XMMask3)); - M.r[2] = vcombine_f32(vget_high_f32(v1), v2); - M.r[3] = g_XMIdentityR3; - return M; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 Z = _mm_setzero_ps(); - - __m128 V1 = _mm_loadu_ps(&pSource->m[0][0]); - __m128 V2 = _mm_loadu_ps(&pSource->m[1][1]); - __m128 V3 = _mm_load_ss(&pSource->m[2][2]); - - __m128 T1 = _mm_unpackhi_ps(V1, Z); - __m128 T2 = _mm_unpacklo_ps(V2, Z); - __m128 T3 = _mm_shuffle_ps(V3, T2, _MM_SHUFFLE(0, 1, 0, 0)); - __m128 T4 = _mm_movehl_ps(T2, T3); - __m128 T5 = _mm_movehl_ps(Z, T1); - - XMMATRIX M; - M.r[0] = _mm_movelh_ps(V1, T1); - M.r[1] = _mm_add_ps(T4, T5); - M.r[2] = _mm_shuffle_ps(V2, V3, _MM_SHUFFLE(1, 0, 3, 2)); - M.r[3] = g_XMIdentityR3; - return M; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat4x3(const XMFLOAT4X3* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[0][1]; - M.r[0].vector4_f32[2] = pSource->m[0][2]; - M.r[0].vector4_f32[3] = 0.0f; - - M.r[1].vector4_f32[0] = pSource->m[1][0]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[1][2]; - M.r[1].vector4_f32[3] = 0.0f; - - M.r[2].vector4_f32[0] = pSource->m[2][0]; - M.r[2].vector4_f32[1] = pSource->m[2][1]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = 0.0f; - - M.r[3].vector4_f32[0] = pSource->m[3][0]; - M.r[3].vector4_f32[1] = pSource->m[3][1]; - M.r[3].vector4_f32[2] = pSource->m[3][2]; - M.r[3].vector4_f32[3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); - float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); - float32x4_t v2 = vld1q_f32(&pSource->m[2][2]); - - float32x4_t T1 = vextq_f32(v0, v1, 3); - float32x4_t T2 = vcombine_f32(vget_high_f32(v1), vget_low_f32(v2)); - float32x4_t T3 = vextq_f32(v2, v2, 1); - - XMMATRIX M; - M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); - M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); - M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); - M.r[3] = vsetq_lane_f32(1.f, T3, 3); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - // Use unaligned load instructions to - // load the 12 floats - // vTemp1 = x1,y1,z1,x2 - XMVECTOR vTemp1 = _mm_loadu_ps(&pSource->m[0][0]); - // vTemp2 = y2,z2,x3,y3 - XMVECTOR vTemp2 = _mm_loadu_ps(&pSource->m[1][1]); - // vTemp4 = z3,x4,y4,z4 - XMVECTOR vTemp4 = _mm_loadu_ps(&pSource->m[2][2]); - // vTemp3 = x3,y3,z3,z3 - XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2, vTemp4, _MM_SHUFFLE(0, 0, 3, 2)); - // vTemp2 = y2,z2,x2,x2 - vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(3, 3, 1, 0)); - // vTemp2 = x2,y2,z2,z2 - vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 1, 0, 2)); - // vTemp1 = x1,y1,z1,0 - vTemp1 = _mm_and_ps(vTemp1, g_XMMask3); - // vTemp2 = x2,y2,z2,0 - vTemp2 = _mm_and_ps(vTemp2, g_XMMask3); - // vTemp3 = x3,y3,z3,0 - vTemp3 = _mm_and_ps(vTemp3, g_XMMask3); - // vTemp4i = x4,y4,z4,0 - __m128i vTemp4i = _mm_srli_si128(_mm_castps_si128(vTemp4), 32 / 8); - // vTemp4i = x4,y4,z4,1.0f - vTemp4i = _mm_or_si128(vTemp4i, g_XMIdentityR3); - XMMATRIX M(vTemp1, - vTemp2, - vTemp3, - _mm_castsi128_ps(vTemp4i)); - return M; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat4x3A(const XMFLOAT4X3A* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[0][1]; - M.r[0].vector4_f32[2] = pSource->m[0][2]; - M.r[0].vector4_f32[3] = 0.0f; - - M.r[1].vector4_f32[0] = pSource->m[1][0]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[1][2]; - M.r[1].vector4_f32[3] = 0.0f; - - M.r[2].vector4_f32[0] = pSource->m[2][0]; - M.r[2].vector4_f32[1] = pSource->m[2][1]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = 0.0f; - - M.r[3].vector4_f32[0] = pSource->m[3][0]; - M.r[3].vector4_f32[1] = pSource->m[3][1]; - M.r[3].vector4_f32[2] = pSource->m[3][2]; - M.r[3].vector4_f32[3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - float32x4_t v0 = vld1q_f32_ex(&pSource->m[0][0], 128); - float32x4_t v1 = vld1q_f32_ex(&pSource->m[1][1], 128); - float32x4_t v2 = vld1q_f32_ex(&pSource->m[2][2], 128); -#else - float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); - float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); - float32x4_t v2 = vld1q_f32(&pSource->m[2][2]); -#endif - - float32x4_t T1 = vextq_f32(v0, v1, 3); - float32x4_t T2 = vcombine_f32(vget_high_f32(v1), vget_low_f32(v2)); - float32x4_t T3 = vextq_f32(v2, v2, 1); - - XMMATRIX M; - M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); - M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); - M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); - M.r[3] = vsetq_lane_f32(1.f, T3, 3); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - // Use aligned load instructions to - // load the 12 floats - // vTemp1 = x1,y1,z1,x2 - XMVECTOR vTemp1 = _mm_load_ps(&pSource->m[0][0]); - // vTemp2 = y2,z2,x3,y3 - XMVECTOR vTemp2 = _mm_load_ps(&pSource->m[1][1]); - // vTemp4 = z3,x4,y4,z4 - XMVECTOR vTemp4 = _mm_load_ps(&pSource->m[2][2]); - // vTemp3 = x3,y3,z3,z3 - XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2, vTemp4, _MM_SHUFFLE(0, 0, 3, 2)); - // vTemp2 = y2,z2,x2,x2 - vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(3, 3, 1, 0)); - // vTemp2 = x2,y2,z2,z2 - vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 1, 0, 2)); - // vTemp1 = x1,y1,z1,0 - vTemp1 = _mm_and_ps(vTemp1, g_XMMask3); - // vTemp2 = x2,y2,z2,0 - vTemp2 = _mm_and_ps(vTemp2, g_XMMask3); - // vTemp3 = x3,y3,z3,0 - vTemp3 = _mm_and_ps(vTemp3, g_XMMask3); - // vTemp4i = x4,y4,z4,0 - __m128i vTemp4i = _mm_srli_si128(_mm_castps_si128(vTemp4), 32 / 8); - // vTemp4i = x4,y4,z4,1.0f - vTemp4i = _mm_or_si128(vTemp4i, g_XMIdentityR3); - XMMATRIX M(vTemp1, - vTemp2, - vTemp3, - _mm_castsi128_ps(vTemp4i)); - return M; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat3x4(const XMFLOAT3X4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[1][0]; - M.r[0].vector4_f32[2] = pSource->m[2][0]; - M.r[0].vector4_f32[3] = 0.0f; - - M.r[1].vector4_f32[0] = pSource->m[0][1]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[2][1]; - M.r[1].vector4_f32[3] = 0.0f; - - M.r[2].vector4_f32[0] = pSource->m[0][2]; - M.r[2].vector4_f32[1] = pSource->m[1][2]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = 0.0f; - - M.r[3].vector4_f32[0] = pSource->m[0][3]; - M.r[3].vector4_f32[1] = pSource->m[1][3]; - M.r[3].vector4_f32[2] = pSource->m[2][3]; - M.r[3].vector4_f32[3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2x4_t vTemp0 = vld4_f32(&pSource->_11); - float32x4_t vTemp1 = vld1q_f32(&pSource->_31); - - float32x2_t l = vget_low_f32(vTemp1); - float32x4_t T0 = vcombine_f32(vTemp0.val[0], l); - float32x2_t rl = vrev64_f32(l); - float32x4_t T1 = vcombine_f32(vTemp0.val[1], rl); - - float32x2_t h = vget_high_f32(vTemp1); - float32x4_t T2 = vcombine_f32(vTemp0.val[2], h); - float32x2_t rh = vrev64_f32(h); - float32x4_t T3 = vcombine_f32(vTemp0.val[3], rh); - - XMMATRIX M = {}; - M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T0), g_XMMask3)); - M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); - M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); - M.r[3] = vsetq_lane_f32(1.f, T3, 3); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - M.r[0] = _mm_loadu_ps(&pSource->_11); - M.r[1] = _mm_loadu_ps(&pSource->_21); - M.r[2] = _mm_loadu_ps(&pSource->_31); - M.r[3] = g_XMIdentityR3; - - // x.x,x.y,y.x,y.y - XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); - // x.z,x.w,y.z,y.w - XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - // z.x,z.y,w.x,w.y - XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); - // z.z,z.w,w.z,w.w - XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - XMMATRIX mResult; - - // x.x,y.x,z.x,w.x - mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - // x.y,y.y,z.y,w.y - mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - // x.z,y.z,z.z,w.z - mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - // x.w,y.w,z.w,w.w - mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); - return mResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat3x4A(const XMFLOAT3X4A* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[1][0]; - M.r[0].vector4_f32[2] = pSource->m[2][0]; - M.r[0].vector4_f32[3] = 0.0f; - - M.r[1].vector4_f32[0] = pSource->m[0][1]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[2][1]; - M.r[1].vector4_f32[3] = 0.0f; - - M.r[2].vector4_f32[0] = pSource->m[0][2]; - M.r[2].vector4_f32[1] = pSource->m[1][2]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = 0.0f; - - M.r[3].vector4_f32[0] = pSource->m[0][3]; - M.r[3].vector4_f32[1] = pSource->m[1][3]; - M.r[3].vector4_f32[2] = pSource->m[2][3]; - M.r[3].vector4_f32[3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - float32x2x4_t vTemp0 = vld4_f32_ex(&pSource->_11, 128); - float32x4_t vTemp1 = vld1q_f32_ex(&pSource->_31, 128); -#else - float32x2x4_t vTemp0 = vld4_f32(&pSource->_11); - float32x4_t vTemp1 = vld1q_f32(&pSource->_31); -#endif - - float32x2_t l = vget_low_f32(vTemp1); - float32x4_t T0 = vcombine_f32(vTemp0.val[0], l); - float32x2_t rl = vrev64_f32(l); - float32x4_t T1 = vcombine_f32(vTemp0.val[1], rl); - - float32x2_t h = vget_high_f32(vTemp1); - float32x4_t T2 = vcombine_f32(vTemp0.val[2], h); - float32x2_t rh = vrev64_f32(h); - float32x4_t T3 = vcombine_f32(vTemp0.val[3], rh); - - XMMATRIX M = {}; - M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T0), g_XMMask3)); - M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); - M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); - M.r[3] = vsetq_lane_f32(1.f, T3, 3); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - M.r[0] = _mm_load_ps(&pSource->_11); - M.r[1] = _mm_load_ps(&pSource->_21); - M.r[2] = _mm_load_ps(&pSource->_31); - M.r[3] = g_XMIdentityR3; - - // x.x,x.y,y.x,y.y - XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); - // x.z,x.w,y.z,y.w - XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - // z.x,z.y,w.x,w.y - XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); - // z.z,z.w,w.z,w.w - XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - XMMATRIX mResult; - - // x.x,y.x,z.x,w.x - mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - // x.y,y.y,z.y,w.y - mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - // x.z,y.z,z.z,w.z - mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - // x.w,y.w,z.w,w.w - mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); - return mResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat4x4(const XMFLOAT4X4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[0][1]; - M.r[0].vector4_f32[2] = pSource->m[0][2]; - M.r[0].vector4_f32[3] = pSource->m[0][3]; - - M.r[1].vector4_f32[0] = pSource->m[1][0]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[1][2]; - M.r[1].vector4_f32[3] = pSource->m[1][3]; - - M.r[2].vector4_f32[0] = pSource->m[2][0]; - M.r[2].vector4_f32[1] = pSource->m[2][1]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = pSource->m[2][3]; - - M.r[3].vector4_f32[0] = pSource->m[3][0]; - M.r[3].vector4_f32[1] = pSource->m[3][1]; - M.r[3].vector4_f32[2] = pSource->m[3][2]; - M.r[3].vector4_f32[3] = pSource->m[3][3]; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX M; - M.r[0] = vld1q_f32(reinterpret_cast(&pSource->_11)); - M.r[1] = vld1q_f32(reinterpret_cast(&pSource->_21)); - M.r[2] = vld1q_f32(reinterpret_cast(&pSource->_31)); - M.r[3] = vld1q_f32(reinterpret_cast(&pSource->_41)); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - M.r[0] = _mm_loadu_ps(&pSource->_11); - M.r[1] = _mm_loadu_ps(&pSource->_21); - M.r[2] = _mm_loadu_ps(&pSource->_31); - M.r[3] = _mm_loadu_ps(&pSource->_41); - return M; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMLoadFloat4x4A(const XMFLOAT4X4A* pSource) noexcept -{ - assert(pSource); - assert((reinterpret_cast(pSource) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.r[0].vector4_f32[0] = pSource->m[0][0]; - M.r[0].vector4_f32[1] = pSource->m[0][1]; - M.r[0].vector4_f32[2] = pSource->m[0][2]; - M.r[0].vector4_f32[3] = pSource->m[0][3]; - - M.r[1].vector4_f32[0] = pSource->m[1][0]; - M.r[1].vector4_f32[1] = pSource->m[1][1]; - M.r[1].vector4_f32[2] = pSource->m[1][2]; - M.r[1].vector4_f32[3] = pSource->m[1][3]; - - M.r[2].vector4_f32[0] = pSource->m[2][0]; - M.r[2].vector4_f32[1] = pSource->m[2][1]; - M.r[2].vector4_f32[2] = pSource->m[2][2]; - M.r[2].vector4_f32[3] = pSource->m[2][3]; - - M.r[3].vector4_f32[0] = pSource->m[3][0]; - M.r[3].vector4_f32[1] = pSource->m[3][1]; - M.r[3].vector4_f32[2] = pSource->m[3][2]; - M.r[3].vector4_f32[3] = pSource->m[3][3]; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX M; -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - M.r[0] = vld1q_f32_ex(reinterpret_cast(&pSource->_11), 128); - M.r[1] = vld1q_f32_ex(reinterpret_cast(&pSource->_21), 128); - M.r[2] = vld1q_f32_ex(reinterpret_cast(&pSource->_31), 128); - M.r[3] = vld1q_f32_ex(reinterpret_cast(&pSource->_41), 128); -#else - M.r[0] = vld1q_f32(reinterpret_cast(&pSource->_11)); - M.r[1] = vld1q_f32(reinterpret_cast(&pSource->_21)); - M.r[2] = vld1q_f32(reinterpret_cast(&pSource->_31)); - M.r[3] = vld1q_f32(reinterpret_cast(&pSource->_41)); -#endif - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - M.r[0] = _mm_load_ps(&pSource->_11); - M.r[1] = _mm_load_ps(&pSource->_21); - M.r[2] = _mm_load_ps(&pSource->_31); - M.r[3] = _mm_load_ps(&pSource->_41); - return M; -#endif -} - -/**************************************************************************** - * - * Vector and matrix store operations - * - ****************************************************************************/ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - *pDestination = XMVectorGetIntX(V); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_u32(pDestination, *reinterpret_cast(&V), 0); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_ss(reinterpret_cast(pDestination), V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat -( - float* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - *pDestination = XMVectorGetX(V); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_f32(pDestination, V, 0); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_ss(pDestination, V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt2 -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination[0] = V.vector4_u32[0]; - pDestination[1] = V.vector4_u32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); - vst1_u32(pDestination, VL); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt2A -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - pDestination[0] = V.vector4_u32[0]; - pDestination[1] = V.vector4_u32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1_u32_ex(pDestination, VL, 64); -#else - vst1_u32(pDestination, VL); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat2 -( - XMFLOAT2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = V.vector4_f32[0]; - pDestination->y = V.vector4_f32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - vst1_f32(reinterpret_cast(pDestination), VL); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat2A -( - XMFLOAT2A* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = V.vector4_f32[0]; - pDestination->y = V.vector4_f32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1_f32_ex(reinterpret_cast(pDestination), VL, 64); -#else - vst1_f32(reinterpret_cast(pDestination), VL); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreSInt2 -( - XMINT2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = static_cast(V.vector4_f32[0]); - pDestination->y = static_cast(V.vector4_f32[1]); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t v = vget_low_f32(V); - int32x2_t iv = vcvt_s32_f32(v); - vst1_s32(reinterpret_cast(pDestination), iv); -#elif defined(_XM_SSE_INTRINSICS_) - // In case of positive overflow, detect it - XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); - // Float to int conversion - __m128i vResulti = _mm_cvttps_epi32(V); - // If there was positive overflow, set to 0x7FFFFFFF - XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); - vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); - vOverflow = _mm_or_ps(vOverflow, vResult); - // Write two ints - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vOverflow)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUInt2 -( - XMUINT2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = static_cast(V.vector4_f32[0]); - pDestination->y = static_cast(V.vector4_f32[1]); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t v = vget_low_f32(V); - uint32x2_t iv = vcvt_u32_f32(v); - vst1_u32(reinterpret_cast(pDestination), iv); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to >=0 - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - // Any numbers that are too big, set to 0xFFFFFFFFU - XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); - XMVECTOR vValue = g_XMUnsignedFix; - // Too large for a signed integer? - XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); - // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise - vValue = _mm_and_ps(vValue, vMask); - // Perform fixup only on numbers too large (Keeps low bit precision) - vResult = _mm_sub_ps(vResult, vValue); - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Convert from signed to unsigned pnly if greater than 0x80000000 - vMask = _mm_and_ps(vMask, g_XMNegativeZero); - vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); - // On those that are too large, set to 0xFFFFFFFF - vResult = _mm_or_ps(vResult, vOverflow); - // Write two uints - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vResult)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt3 -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination[0] = V.vector4_u32[0]; - pDestination[1] = V.vector4_u32[1]; - pDestination[2] = V.vector4_u32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); - vst1_u32(pDestination, VL); - vst1q_lane_u32(pDestination + 2, *reinterpret_cast(&V), 2); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); - __m128 z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(reinterpret_cast(&pDestination[2]), z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt3A -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - pDestination[0] = V.vector4_u32[0]; - pDestination[1] = V.vector4_u32[1]; - pDestination[2] = V.vector4_u32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1_u32_ex(pDestination, VL, 64); -#else - vst1_u32(pDestination, VL); -#endif - vst1q_lane_u32(pDestination + 2, *reinterpret_cast(&V), 2); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); - __m128 z = _mm_movehl_ps(V, V); - _mm_store_ss(reinterpret_cast(&pDestination[2]), z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3 -( - XMFLOAT3* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = V.vector4_f32[0]; - pDestination->y = V.vector4_f32[1]; - pDestination->z = V.vector4_f32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - vst1_f32(reinterpret_cast(pDestination), VL); - vst1q_lane_f32(reinterpret_cast(pDestination) + 2, V, 2); -#elif defined(_XM_SSE4_INTRINSICS_) - * reinterpret_cast(&pDestination->x) = _mm_extract_ps(V, 0); - *reinterpret_cast(&pDestination->y) = _mm_extract_ps(V, 1); - *reinterpret_cast(&pDestination->z) = _mm_extract_ps(V, 2); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); - __m128 z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(&pDestination->z, z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3A -( - XMFLOAT3A* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = V.vector4_f32[0]; - pDestination->y = V.vector4_f32[1]; - pDestination->z = V.vector4_f32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1_f32_ex(reinterpret_cast(pDestination), VL, 64); -#else - vst1_f32(reinterpret_cast(pDestination), VL); -#endif - vst1q_lane_f32(reinterpret_cast(pDestination) + 2, V, 2); -#elif defined(_XM_SSE4_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); - *reinterpret_cast(&pDestination->z) = _mm_extract_ps(V, 2); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); - __m128 z = _mm_movehl_ps(V, V); - _mm_store_ss(&pDestination->z, z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreSInt3 -( - XMINT3* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = static_cast(V.vector4_f32[0]); - pDestination->y = static_cast(V.vector4_f32[1]); - pDestination->z = static_cast(V.vector4_f32[2]); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t v = vcvtq_s32_f32(V); - int32x2_t vL = vget_low_s32(v); - vst1_s32(reinterpret_cast(pDestination), vL); - vst1q_lane_s32(reinterpret_cast(pDestination) + 2, v, 2); -#elif defined(_XM_SSE_INTRINSICS_) - // In case of positive overflow, detect it - XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); - // Float to int conversion - __m128i vResulti = _mm_cvttps_epi32(V); - // If there was positive overflow, set to 0x7FFFFFFF - XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); - vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); - vOverflow = _mm_or_ps(vOverflow, vResult); - // Write 3 uints - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vOverflow)); - __m128 z = XM_PERMUTE_PS(vOverflow, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(reinterpret_cast(&pDestination->z), z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUInt3 -( - XMUINT3* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = static_cast(V.vector4_f32[0]); - pDestination->y = static_cast(V.vector4_f32[1]); - pDestination->z = static_cast(V.vector4_f32[2]); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t v = vcvtq_u32_f32(V); - uint32x2_t vL = vget_low_u32(v); - vst1_u32(reinterpret_cast(pDestination), vL); - vst1q_lane_u32(reinterpret_cast(pDestination) + 2, v, 2); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to >=0 - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - // Any numbers that are too big, set to 0xFFFFFFFFU - XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); - XMVECTOR vValue = g_XMUnsignedFix; - // Too large for a signed integer? - XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); - // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise - vValue = _mm_and_ps(vValue, vMask); - // Perform fixup only on numbers too large (Keeps low bit precision) - vResult = _mm_sub_ps(vResult, vValue); - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Convert from signed to unsigned pnly if greater than 0x80000000 - vMask = _mm_and_ps(vMask, g_XMNegativeZero); - vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); - // On those that are too large, set to 0xFFFFFFFF - vResult = _mm_or_ps(vResult, vOverflow); - // Write 3 uints - _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vResult)); - __m128 z = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(reinterpret_cast(&pDestination->z), z); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt4 -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination[0] = V.vector4_u32[0]; - pDestination[1] = V.vector4_u32[1]; - pDestination[2] = V.vector4_u32[2]; - pDestination[3] = V.vector4_u32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_u32(pDestination, vreinterpretq_u32_f32(V)); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreInt4A -( - uint32_t* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - pDestination[0] = V.vector4_u32[0]; - pDestination[1] = V.vector4_u32[1]; - pDestination[2] = V.vector4_u32[2]; - pDestination[3] = V.vector4_u32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1q_u32_ex(pDestination, V, 128); -#else - vst1q_u32(pDestination, vreinterpretq_u32_f32(V)); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(V)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat4 -( - XMFLOAT4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = V.vector4_f32[0]; - pDestination->y = V.vector4_f32[1]; - pDestination->z = V.vector4_f32[2]; - pDestination->w = V.vector4_f32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_f32(reinterpret_cast(pDestination), V); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_storeu_ps(&pDestination->x, V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat4A -( - XMFLOAT4A* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = V.vector4_f32[0]; - pDestination->y = V.vector4_f32[1]; - pDestination->z = V.vector4_f32[2]; - pDestination->w = V.vector4_f32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1q_f32_ex(reinterpret_cast(pDestination), V, 128); -#else - vst1q_f32(reinterpret_cast(pDestination), V); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_ps(&pDestination->x, V); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreSInt4 -( - XMINT4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = static_cast(V.vector4_f32[0]); - pDestination->y = static_cast(V.vector4_f32[1]); - pDestination->z = static_cast(V.vector4_f32[2]); - pDestination->w = static_cast(V.vector4_f32[3]); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t v = vcvtq_s32_f32(V); - vst1q_s32(reinterpret_cast(pDestination), v); -#elif defined(_XM_SSE_INTRINSICS_) - // In case of positive overflow, detect it - XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); - // Float to int conversion - __m128i vResulti = _mm_cvttps_epi32(V); - // If there was positive overflow, set to 0x7FFFFFFF - XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); - vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); - vOverflow = _mm_or_ps(vOverflow, vResult); - _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(vOverflow)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUInt4 -( - XMUINT4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - pDestination->x = static_cast(V.vector4_f32[0]); - pDestination->y = static_cast(V.vector4_f32[1]); - pDestination->z = static_cast(V.vector4_f32[2]); - pDestination->w = static_cast(V.vector4_f32[3]); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t v = vcvtq_u32_f32(V); - vst1q_u32(reinterpret_cast(pDestination), v); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to >=0 - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - // Any numbers that are too big, set to 0xFFFFFFFFU - XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); - XMVECTOR vValue = g_XMUnsignedFix; - // Too large for a signed integer? - XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); - // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise - vValue = _mm_and_ps(vValue, vMask); - // Perform fixup only on numbers too large (Keeps low bit precision) - vResult = _mm_sub_ps(vResult, vValue); - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Convert from signed to unsigned pnly if greater than 0x80000000 - vMask = _mm_and_ps(vMask, g_XMNegativeZero); - vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); - // On those that are too large, set to 0xFFFFFFFF - vResult = _mm_or_ps(vResult, vOverflow); - _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(vResult)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3x3 -( - XMFLOAT3X3* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[0].vector4_f32[1]; - pDestination->m[0][2] = M.r[0].vector4_f32[2]; - - pDestination->m[1][0] = M.r[1].vector4_f32[0]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[1].vector4_f32[2]; - - pDestination->m[2][0] = M.r[2].vector4_f32[0]; - pDestination->m[2][1] = M.r[2].vector4_f32[1]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); - float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); - vst1q_f32(&pDestination->m[0][0], T2); - - T1 = vextq_f32(M.r[1], M.r[1], 1); - T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); - vst1q_f32(&pDestination->m[1][1], T2); - - vst1q_lane_f32(&pDestination->m[2][2], M.r[2], 2); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp1 = M.r[0]; - XMVECTOR vTemp2 = M.r[1]; - XMVECTOR vTemp3 = M.r[2]; - XMVECTOR vWork = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(0, 0, 2, 2)); - vTemp1 = _mm_shuffle_ps(vTemp1, vWork, _MM_SHUFFLE(2, 0, 1, 0)); - _mm_storeu_ps(&pDestination->m[0][0], vTemp1); - vTemp2 = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); - _mm_storeu_ps(&pDestination->m[1][1], vTemp2); - vTemp3 = XM_PERMUTE_PS(vTemp3, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(&pDestination->m[2][2], vTemp3); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat4x3 -( - XMFLOAT4X3* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[0].vector4_f32[1]; - pDestination->m[0][2] = M.r[0].vector4_f32[2]; - - pDestination->m[1][0] = M.r[1].vector4_f32[0]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[1].vector4_f32[2]; - - pDestination->m[2][0] = M.r[2].vector4_f32[0]; - pDestination->m[2][1] = M.r[2].vector4_f32[1]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - - pDestination->m[3][0] = M.r[3].vector4_f32[0]; - pDestination->m[3][1] = M.r[3].vector4_f32[1]; - pDestination->m[3][2] = M.r[3].vector4_f32[2]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); - float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); - vst1q_f32(&pDestination->m[0][0], T2); - - T1 = vextq_f32(M.r[1], M.r[1], 1); - T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); - vst1q_f32(&pDestination->m[1][1], T2); - - T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); - T2 = vextq_f32(T1, M.r[3], 3); - vst1q_f32(&pDestination->m[2][2], T2); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp1 = M.r[0]; - XMVECTOR vTemp2 = M.r[1]; - XMVECTOR vTemp3 = M.r[2]; - XMVECTOR vTemp4 = M.r[3]; - XMVECTOR vTemp2x = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); - vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(2, 2, 0, 0)); - vTemp1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(0, 2, 1, 0)); - vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(0, 0, 2, 2)); - vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 1, 2, 0)); - _mm_storeu_ps(&pDestination->m[0][0], vTemp1); - _mm_storeu_ps(&pDestination->m[1][1], vTemp2x); - _mm_storeu_ps(&pDestination->m[2][2], vTemp3); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat4x3A -( - XMFLOAT4X3A* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[0].vector4_f32[1]; - pDestination->m[0][2] = M.r[0].vector4_f32[2]; - - pDestination->m[1][0] = M.r[1].vector4_f32[0]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[1].vector4_f32[2]; - - pDestination->m[2][0] = M.r[2].vector4_f32[0]; - pDestination->m[2][1] = M.r[2].vector4_f32[1]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - - pDestination->m[3][0] = M.r[3].vector4_f32[0]; - pDestination->m[3][1] = M.r[3].vector4_f32[1]; - pDestination->m[3][2] = M.r[3].vector4_f32[2]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); - float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); - vst1q_f32_ex(&pDestination->m[0][0], T2, 128); - - T1 = vextq_f32(M.r[1], M.r[1], 1); - T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); - vst1q_f32_ex(&pDestination->m[1][1], T2, 128); - - T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); - T2 = vextq_f32(T1, M.r[3], 3); - vst1q_f32_ex(&pDestination->m[2][2], T2, 128); -#else - float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); - float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); - vst1q_f32(&pDestination->m[0][0], T2); - - T1 = vextq_f32(M.r[1], M.r[1], 1); - T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); - vst1q_f32(&pDestination->m[1][1], T2); - - T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); - T2 = vextq_f32(T1, M.r[3], 3); - vst1q_f32(&pDestination->m[2][2], T2); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - // x1,y1,z1,w1 - XMVECTOR vTemp1 = M.r[0]; - // x2,y2,z2,w2 - XMVECTOR vTemp2 = M.r[1]; - // x3,y3,z3,w3 - XMVECTOR vTemp3 = M.r[2]; - // x4,y4,z4,w4 - XMVECTOR vTemp4 = M.r[3]; - // z1,z1,x2,y2 - XMVECTOR vTemp = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(1, 0, 2, 2)); - // y2,z2,x3,y3 (Final) - vTemp2 = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); - // x1,y1,z1,x2 (Final) - vTemp1 = _mm_shuffle_ps(vTemp1, vTemp, _MM_SHUFFLE(2, 0, 1, 0)); - // z3,z3,x4,x4 - vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(0, 0, 2, 2)); - // z3,x4,y4,z4 (Final) - vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 1, 2, 0)); - // Store in 3 operations - _mm_store_ps(&pDestination->m[0][0], vTemp1); - _mm_store_ps(&pDestination->m[1][1], vTemp2); - _mm_store_ps(&pDestination->m[2][2], vTemp3); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3x4 -( - XMFLOAT3X4* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[1].vector4_f32[0]; - pDestination->m[0][2] = M.r[2].vector4_f32[0]; - pDestination->m[0][3] = M.r[3].vector4_f32[0]; - - pDestination->m[1][0] = M.r[0].vector4_f32[1]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[2].vector4_f32[1]; - pDestination->m[1][3] = M.r[3].vector4_f32[1]; - - pDestination->m[2][0] = M.r[0].vector4_f32[2]; - pDestination->m[2][1] = M.r[1].vector4_f32[2]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - pDestination->m[2][3] = M.r[3].vector4_f32[2]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); - float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); - - float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); - float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); - - vst1q_f32(&pDestination->m[0][0], T0.val[0]); - vst1q_f32(&pDestination->m[1][0], T0.val[1]); - vst1q_f32(&pDestination->m[2][0], T1.val[0]); -#elif defined(_XM_SSE_INTRINSICS_) - // x.x,x.y,y.x,y.y - XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); - // x.z,x.w,y.z,y.w - XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - // z.x,z.y,w.x,w.y - XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); - // z.z,z.w,w.z,w.w - XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - - // x.x,y.x,z.x,w.x - XMVECTOR r0 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - // x.y,y.y,z.y,w.y - XMVECTOR r1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - // x.z,y.z,z.z,w.z - XMVECTOR r2 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - - _mm_storeu_ps(&pDestination->m[0][0], r0); - _mm_storeu_ps(&pDestination->m[1][0], r1); - _mm_storeu_ps(&pDestination->m[2][0], r2); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3x4A -( - XMFLOAT3X4A* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[1].vector4_f32[0]; - pDestination->m[0][2] = M.r[2].vector4_f32[0]; - pDestination->m[0][3] = M.r[3].vector4_f32[0]; - - pDestination->m[1][0] = M.r[0].vector4_f32[1]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[2].vector4_f32[1]; - pDestination->m[1][3] = M.r[3].vector4_f32[1]; - - pDestination->m[2][0] = M.r[0].vector4_f32[2]; - pDestination->m[2][1] = M.r[1].vector4_f32[2]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - pDestination->m[2][3] = M.r[3].vector4_f32[2]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); - float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); - - float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); - float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); - -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1q_f32_ex(&pDestination->m[0][0], T0.val[0], 128); - vst1q_f32_ex(&pDestination->m[1][0], T0.val[1], 128); - vst1q_f32_ex(&pDestination->m[2][0], T1.val[0], 128); -#else - vst1q_f32(&pDestination->m[0][0], T0.val[0]); - vst1q_f32(&pDestination->m[1][0], T0.val[1]); - vst1q_f32(&pDestination->m[2][0], T1.val[0]); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - // x.x,x.y,y.x,y.y - XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); - // x.z,x.w,y.z,y.w - XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - // z.x,z.y,w.x,w.y - XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); - // z.z,z.w,w.z,w.w - XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - - // x.x,y.x,z.x,w.x - XMVECTOR r0 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - // x.y,y.y,z.y,w.y - XMVECTOR r1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - // x.z,y.z,z.z,w.z - XMVECTOR r2 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - - _mm_store_ps(&pDestination->m[0][0], r0); - _mm_store_ps(&pDestination->m[1][0], r1); - _mm_store_ps(&pDestination->m[2][0], r2); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat4x4 -( - XMFLOAT4X4* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[0].vector4_f32[1]; - pDestination->m[0][2] = M.r[0].vector4_f32[2]; - pDestination->m[0][3] = M.r[0].vector4_f32[3]; - - pDestination->m[1][0] = M.r[1].vector4_f32[0]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[1].vector4_f32[2]; - pDestination->m[1][3] = M.r[1].vector4_f32[3]; - - pDestination->m[2][0] = M.r[2].vector4_f32[0]; - pDestination->m[2][1] = M.r[2].vector4_f32[1]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - pDestination->m[2][3] = M.r[2].vector4_f32[3]; - - pDestination->m[3][0] = M.r[3].vector4_f32[0]; - pDestination->m[3][1] = M.r[3].vector4_f32[1]; - pDestination->m[3][2] = M.r[3].vector4_f32[2]; - pDestination->m[3][3] = M.r[3].vector4_f32[3]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_f32(reinterpret_cast(&pDestination->_11), M.r[0]); - vst1q_f32(reinterpret_cast(&pDestination->_21), M.r[1]); - vst1q_f32(reinterpret_cast(&pDestination->_31), M.r[2]); - vst1q_f32(reinterpret_cast(&pDestination->_41), M.r[3]); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_storeu_ps(&pDestination->_11, M.r[0]); - _mm_storeu_ps(&pDestination->_21, M.r[1]); - _mm_storeu_ps(&pDestination->_31, M.r[2]); - _mm_storeu_ps(&pDestination->_41, M.r[3]); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat4x4A -( - XMFLOAT4X4A* pDestination, - FXMMATRIX M -) noexcept -{ - assert(pDestination); - assert((reinterpret_cast(pDestination) & 0xF) == 0); -#if defined(_XM_NO_INTRINSICS_) - - pDestination->m[0][0] = M.r[0].vector4_f32[0]; - pDestination->m[0][1] = M.r[0].vector4_f32[1]; - pDestination->m[0][2] = M.r[0].vector4_f32[2]; - pDestination->m[0][3] = M.r[0].vector4_f32[3]; - - pDestination->m[1][0] = M.r[1].vector4_f32[0]; - pDestination->m[1][1] = M.r[1].vector4_f32[1]; - pDestination->m[1][2] = M.r[1].vector4_f32[2]; - pDestination->m[1][3] = M.r[1].vector4_f32[3]; - - pDestination->m[2][0] = M.r[2].vector4_f32[0]; - pDestination->m[2][1] = M.r[2].vector4_f32[1]; - pDestination->m[2][2] = M.r[2].vector4_f32[2]; - pDestination->m[2][3] = M.r[2].vector4_f32[3]; - - pDestination->m[3][0] = M.r[3].vector4_f32[0]; - pDestination->m[3][1] = M.r[3].vector4_f32[1]; - pDestination->m[3][2] = M.r[3].vector4_f32[2]; - pDestination->m[3][3] = M.r[3].vector4_f32[3]; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - vst1q_f32_ex(reinterpret_cast(&pDestination->_11), M.r[0], 128); - vst1q_f32_ex(reinterpret_cast(&pDestination->_21), M.r[1], 128); - vst1q_f32_ex(reinterpret_cast(&pDestination->_31), M.r[2], 128); - vst1q_f32_ex(reinterpret_cast(&pDestination->_41), M.r[3], 128); -#else - vst1q_f32(reinterpret_cast(&pDestination->_11), M.r[0]); - vst1q_f32(reinterpret_cast(&pDestination->_21), M.r[1]); - vst1q_f32(reinterpret_cast(&pDestination->_31), M.r[2]); - vst1q_f32(reinterpret_cast(&pDestination->_41), M.r[3]); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_ps(&pDestination->_11, M.r[0]); - _mm_store_ps(&pDestination->_21, M.r[1]); - _mm_store_ps(&pDestination->_31, M.r[2]); - _mm_store_ps(&pDestination->_41, M.r[3]); -#endif -} - +//------------------------------------------------------------------------------------- +// DirectXMathConvert.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Data conversion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4701) +// C4701: false positives +#endif + +inline XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat +( + FXMVECTOR VInt, + uint32_t DivExponent +) noexcept +{ + assert(DivExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do + { + auto iTemp = static_cast(VInt.vector4_u32[ElementIndex]); + Result.vector4_f32[ElementIndex] = static_cast(iTemp)* fScale; + } + while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + float32x4_t vResult = vcvtq_f32_s32(vreinterpretq_s32_f32(VInt)); + return vmulq_n_f32(vResult, fScale); +#else // _XM_SSE_INTRINSICS_ + // Convert to floats + XMVECTOR vResult = _mm_cvtepi32_ps(_mm_castps_si128(VInt)); + // Convert DivExponent into 1.0f/(1<(uScale)); + vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(vScale)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt +( + FXMVECTOR VFloat, + uint32_t MulExponent +) noexcept +{ + assert(MulExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + // Get the scalar factor. + auto fScale = static_cast(1U << MulExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do + { + int32_t iResult; + float fTemp = VFloat.vector4_f32[ElementIndex] * fScale; + if (fTemp <= -(65536.0f * 32768.0f)) + { + iResult = (-0x7FFFFFFF) - 1; + } + else if (fTemp > (65536.0f * 32768.0f) - 128.0f) + { + iResult = 0x7FFFFFFF; + } + else + { + iResult = static_cast(fTemp); + } + Result.vector4_u32[ElementIndex] = static_cast(iResult); + } + while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmulq_n_f32(VFloat, static_cast(1U << MulExponent)); + // In case of positive overflow, detect it + uint32x4_t vOverflow = vcgtq_f32(vResult, g_XMMaxInt); + // Float to int conversion + int32x4_t vResulti = vcvtq_s32_f32(vResult); + // If there was positive overflow, set to 0x7FFFFFFF + vResult = vreinterpretq_f32_u32(vandq_u32(vOverflow, g_XMAbsMask)); + vOverflow = vbicq_u32(vreinterpretq_u32_s32(vResulti), vOverflow); + vOverflow = vorrq_u32(vOverflow, vreinterpretq_u32_f32(vResult)); + return vreinterpretq_f32_u32(vOverflow); +#else // _XM_SSE_INTRINSICS_ + XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); + vResult = _mm_mul_ps(vResult, VFloat); + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(vResult); + // If there was positive overflow, set to 0x7FFFFFFF + vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + return vOverflow; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat +( + FXMVECTOR VUInt, + uint32_t DivExponent +) noexcept +{ + assert(DivExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do + { + Result.vector4_f32[ElementIndex] = static_cast(VUInt.vector4_u32[ElementIndex])* fScale; + } + while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fScale = 1.0f / static_cast(1U << DivExponent); + float32x4_t vResult = vcvtq_f32_u32(vreinterpretq_u32_f32(VUInt)); + return vmulq_n_f32(vResult, fScale); +#else // _XM_SSE_INTRINSICS_ + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(VUInt, g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(VUInt, vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + // Convert DivExponent into 1.0f/(1<(uScale)); + vResult = _mm_mul_ps(vResult, _mm_castsi128_ps(iMask)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt +( + FXMVECTOR VFloat, + uint32_t MulExponent +) noexcept +{ + assert(MulExponent < 32); +#if defined(_XM_NO_INTRINSICS_) + // Get the scalar factor. + auto fScale = static_cast(1U << MulExponent); + uint32_t ElementIndex = 0; + XMVECTOR Result; + do + { + uint32_t uResult; + float fTemp = VFloat.vector4_f32[ElementIndex] * fScale; + if (fTemp <= 0.0f) + { + uResult = 0; + } + else if (fTemp >= (65536.0f * 65536.0f)) + { + uResult = 0xFFFFFFFFU; + } + else + { + uResult = static_cast(fTemp); + } + Result.vector4_u32[ElementIndex] = uResult; + } + while (++ElementIndex < 4); + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmulq_n_f32(VFloat, static_cast(1U << MulExponent)); + // In case of overflow, detect it + uint32x4_t vOverflow = vcgtq_f32(vResult, g_XMMaxUInt); + // Float to int conversion + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + // If there was overflow, set to 0xFFFFFFFFU + vResult = vreinterpretq_f32_u32(vbicq_u32(vResulti, vOverflow)); + vOverflow = vorrq_u32(vOverflow, vreinterpretq_u32_f32(vResult)); + return vreinterpretq_f32_u32(vOverflow); +#else // _XM_SSE_INTRINSICS_ + XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); + vResult = _mm_mul_ps(vResult, VFloat); + // Clamp to >=0 + vResult = _mm_max_ps(vResult, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + return vResult; +#endif +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Vector and matrix load operations + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt(const uint32_t* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = *pSource; + V.vector4_u32[1] = 0; + V.vector4_u32[2] = 0; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t zero = vdupq_n_u32(0); + return vreinterpretq_f32_u32(vld1q_lane_u32(pSource, zero, 0)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ss(reinterpret_cast(pSource)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat(const float* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = *pSource; + V.vector4_f32[1] = 0.f; + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t zero = vdupq_n_f32(0); + return vld1q_lane_f32(pSource, zero, 0); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ss(pSource); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt2(const uint32_t* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = 0; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(pSource); + uint32x2_t zero = vdup_n_u32(0); + return vreinterpretq_f32_u32(vcombine_u32(x, zero)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt2A(const uint32_t* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = 0; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x2_t x = vld1_u32_ex(pSource, 64); +#else + uint32x2_t x = vld1_u32(pSource); +#endif + uint32x2_t zero = vdup_n_u32(0); + return vreinterpretq_f32_u32(vcombine_u32(x, zero)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat2(const XMFLOAT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t x = vld1_f32(reinterpret_cast(pSource)); + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(x, zero); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat2A(const XMFLOAT2A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x2_t x = vld1_f32_ex(reinterpret_cast(pSource), 64); +#else + float32x2_t x = vld1_f32(reinterpret_cast(pSource)); +#endif + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(x, zero); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadSInt2(const XMINT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x2_t x = vld1_s32(reinterpret_cast(pSource)); + float32x2_t v = vcvt_f32_s32(x); + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(v, zero); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 V = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + return _mm_cvtepi32_ps(_mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUInt2(const XMUINT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = 0.f; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(reinterpret_cast(pSource)); + float32x2_t v = vcvt_f32_u32(x); + float32x2_t zero = vdup_n_f32(0); + return vcombine_f32(v, zero); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 V = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(V, g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(V, vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt3(const uint32_t* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(pSource); + uint32x2_t zero = vdup_n_u32(0); + uint32x2_t y = vld1_lane_u32(pSource + 2, zero, 0); + return vreinterpretq_f32_u32(vcombine_u32(x, y)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_insert_ps(xy, z, 0x20); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_movelh_ps(xy, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt3A(const uint32_t* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = 0; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Reads an extra integer which is zero'd +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x4_t V = vld1q_u32_ex(pSource, 128); +#else + uint32x4_t V = vld1q_u32(pSource); +#endif + return vreinterpretq_f32_u32(vsetq_lane_u32(0, V, 3)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_insert_ps(xy, z, 0x20); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(pSource + 2)); + return _mm_movelh_ps(xy, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3(const XMFLOAT3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t x = vld1_f32(reinterpret_cast(pSource)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t y = vld1_lane_f32(reinterpret_cast(pSource) + 2, zero, 0); + return vcombine_f32(x, y); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(&pSource->z); + return _mm_insert_ps(xy, z, 0x20); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(&pSource->z); + return _mm_movelh_ps(xy, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3A(const XMFLOAT3A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Reads an extra float which is zero'd +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x4_t V = vld1q_f32_ex(reinterpret_cast(pSource), 128); +#else + float32x4_t V = vld1q_f32(reinterpret_cast(pSource)); +#endif + return vsetq_lane_f32(0, V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + // Reads an extra float which is zero'd + __m128 V = _mm_load_ps(&pSource->x); + return _mm_and_ps(V, g_XMMask3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadSInt3(const XMINT3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = 0.f; + return V; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x2_t x = vld1_s32(reinterpret_cast(pSource)); + int32x2_t zero = vdup_n_s32(0); + int32x2_t y = vld1_lane_s32(reinterpret_cast(pSource) + 2, zero, 0); + int32x4_t v = vcombine_s32(x, y); + return vcvtq_f32_s32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(&pSource->z)); + __m128 V = _mm_movelh_ps(xy, z); + return _mm_cvtepi32_ps(_mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUInt3(const XMUINT3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = 0.f; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t x = vld1_u32(reinterpret_cast(pSource)); + uint32x2_t zero = vdup_n_u32(0); + uint32x2_t y = vld1_lane_u32(reinterpret_cast(pSource) + 2, zero, 0); + uint32x4_t v = vcombine_u32(x, y); + return vcvtq_f32_u32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pSource))); + __m128 z = _mm_load_ss(reinterpret_cast(&pSource->z)); + __m128 V = _mm_movelh_ps(xy, z); + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(V, g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(V, vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt4(const uint32_t* pSource) noexcept +{ + assert(pSource); + +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_u32(pSource)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadInt4A(const uint32_t* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + return vld1q_u32_ex(pSource, 128); +#else + return vreinterpretq_f32_u32(vld1q_u32(pSource)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_load_si128(reinterpret_cast(pSource)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat4(const XMFLOAT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = pSource->w; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_f32(reinterpret_cast(pSource)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_loadu_ps(&pSource->x); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat4A(const XMFLOAT4A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = pSource->w; + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + return vld1q_f32_ex(reinterpret_cast(pSource), 128); +#else + return vld1q_f32(reinterpret_cast(pSource)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps(&pSource->x); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadSInt4(const XMINT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = static_cast(pSource->w); + return V; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t v = vld1q_s32(reinterpret_cast(pSource)); + return vcvtq_f32_s32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); + return _mm_cvtepi32_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUInt4(const XMUINT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + V.vector4_f32[0] = static_cast(pSource->x); + V.vector4_f32[1] = static_cast(pSource->y); + V.vector4_f32[2] = static_cast(pSource->z); + V.vector4_f32[3] = static_cast(pSource->w); + return V; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t v = vld1q_u32(reinterpret_cast(pSource)); + return vcvtq_f32_u32(v); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_loadu_si128(reinterpret_cast(pSource)); + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(_mm_castsi128_ps(V), g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(_mm_castsi128_ps(V), vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(_mm_castps_si128(vMask), 31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(_mm_castsi128_ps(iMask), g_XMFixUnsigned); + vResult = _mm_add_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat3x3(const XMFLOAT3X3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + M.r[3].vector4_f32[0] = 0.0f; + M.r[3].vector4_f32[1] = 0.0f; + M.r[3].vector4_f32[2] = 0.0f; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); + float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); + float32x2_t v2 = vcreate_f32(static_cast(*reinterpret_cast(&pSource->m[2][2]))); + float32x4_t T = vextq_f32(v0, v1, 3); + + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T), g_XMMask3)); + M.r[2] = vcombine_f32(vget_high_f32(v1), v2); + M.r[3] = g_XMIdentityR3; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 Z = _mm_setzero_ps(); + + __m128 V1 = _mm_loadu_ps(&pSource->m[0][0]); + __m128 V2 = _mm_loadu_ps(&pSource->m[1][1]); + __m128 V3 = _mm_load_ss(&pSource->m[2][2]); + + __m128 T1 = _mm_unpackhi_ps(V1, Z); + __m128 T2 = _mm_unpacklo_ps(V2, Z); + __m128 T3 = _mm_shuffle_ps(V3, T2, _MM_SHUFFLE(0, 1, 0, 0)); + __m128 T4 = _mm_movehl_ps(T2, T3); + __m128 T5 = _mm_movehl_ps(Z, T1); + + XMMATRIX M; + M.r[0] = _mm_movelh_ps(V1, T1); + M.r[1] = _mm_add_ps(T4, T5); + M.r[2] = _mm_shuffle_ps(V2, V3, _MM_SHUFFLE(1, 0, 3, 2)); + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x3(const XMFLOAT4X3* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); + float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); + float32x4_t v2 = vld1q_f32(&pSource->m[2][2]); + + float32x4_t T1 = vextq_f32(v0, v1, 3); + float32x4_t T2 = vcombine_f32(vget_high_f32(v1), vget_low_f32(v2)); + float32x4_t T3 = vextq_f32(v2, v2, 1); + + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + // Use unaligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_loadu_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_loadu_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_loadu_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2, vTemp4, _MM_SHUFFLE(0, 0, 3, 2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(3, 3, 1, 0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 1, 0, 2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1, g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2, g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3, g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(_mm_castps_si128(vTemp4), 32 / 8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i, g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + _mm_castsi128_ps(vTemp4i)); + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x3A(const XMFLOAT4X3A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x4_t v0 = vld1q_f32_ex(&pSource->m[0][0], 128); + float32x4_t v1 = vld1q_f32_ex(&pSource->m[1][1], 128); + float32x4_t v2 = vld1q_f32_ex(&pSource->m[2][2], 128); +#else + float32x4_t v0 = vld1q_f32(&pSource->m[0][0]); + float32x4_t v1 = vld1q_f32(&pSource->m[1][1]); + float32x4_t v2 = vld1q_f32(&pSource->m[2][2]); +#endif + + float32x4_t T1 = vextq_f32(v0, v1, 3); + float32x4_t T2 = vcombine_f32(vget_high_f32(v1), vget_low_f32(v2)); + float32x4_t T3 = vextq_f32(v2, v2, 1); + + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(v0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + // Use aligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_load_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_load_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_load_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2, vTemp4, _MM_SHUFFLE(0, 0, 3, 2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(3, 3, 1, 0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 1, 0, 2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1, g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2, g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3, g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(_mm_castps_si128(vTemp4), 32 / 8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i, g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + _mm_castsi128_ps(vTemp4i)); + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat3x4(const XMFLOAT3X4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[1][0]; + M.r[0].vector4_f32[2] = pSource->m[2][0]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[0][1]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[2][1]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[0][2]; + M.r[2].vector4_f32[1] = pSource->m[1][2]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[0][3]; + M.r[3].vector4_f32[1] = pSource->m[1][3]; + M.r[3].vector4_f32[2] = pSource->m[2][3]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2x4_t vTemp0 = vld4_f32(&pSource->_11); + float32x4_t vTemp1 = vld1q_f32(&pSource->_31); + + float32x2_t l = vget_low_f32(vTemp1); + float32x4_t T0 = vcombine_f32(vTemp0.val[0], l); + float32x2_t rl = vrev64_f32(l); + float32x4_t T1 = vcombine_f32(vTemp0.val[1], rl); + + float32x2_t h = vget_high_f32(vTemp1); + float32x4_t T2 = vcombine_f32(vTemp0.val[2], h); + float32x2_t rh = vrev64_f32(h); + float32x4_t T3 = vcombine_f32(vTemp0.val[3], rh); + + XMMATRIX M = {}; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_loadu_ps(&pSource->_11); + M.r[1] = _mm_loadu_ps(&pSource->_21); + M.r[2] = _mm_loadu_ps(&pSource->_31); + M.r[3] = g_XMIdentityR3; + + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + XMMATRIX mResult; + + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat3x4A(const XMFLOAT3X4A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[1][0]; + M.r[0].vector4_f32[2] = pSource->m[2][0]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[0][1]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[2][1]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[0][2]; + M.r[2].vector4_f32[1] = pSource->m[1][2]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[0][3]; + M.r[3].vector4_f32[1] = pSource->m[1][3]; + M.r[3].vector4_f32[2] = pSource->m[2][3]; + M.r[3].vector4_f32[3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x2x4_t vTemp0 = vld4_f32_ex(&pSource->_11, 128); + float32x4_t vTemp1 = vld1q_f32_ex(&pSource->_31, 128); +#else + float32x2x4_t vTemp0 = vld4_f32(&pSource->_11); + float32x4_t vTemp1 = vld1q_f32(&pSource->_31); +#endif + + float32x2_t l = vget_low_f32(vTemp1); + float32x4_t T0 = vcombine_f32(vTemp0.val[0], l); + float32x2_t rl = vrev64_f32(l); + float32x4_t T1 = vcombine_f32(vTemp0.val[1], rl); + + float32x2_t h = vget_high_f32(vTemp1); + float32x4_t T2 = vcombine_f32(vTemp0.val[2], h); + float32x2_t rh = vrev64_f32(h); + float32x4_t T3 = vcombine_f32(vTemp0.val[3], rh); + + XMMATRIX M = {}; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T0), g_XMMask3)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T1), g_XMMask3)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T2), g_XMMask3)); + M.r[3] = vsetq_lane_f32(1.f, T3, 3); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_load_ps(&pSource->_11); + M.r[1] = _mm_load_ps(&pSource->_21); + M.r[2] = _mm_load_ps(&pSource->_31); + M.r[3] = g_XMIdentityR3; + + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + XMMATRIX mResult; + + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x4(const XMFLOAT4X4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = pSource->m[0][3]; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = pSource->m[1][3]; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = pSource->m[2][3]; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = pSource->m[3][3]; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = vld1q_f32(reinterpret_cast(&pSource->_11)); + M.r[1] = vld1q_f32(reinterpret_cast(&pSource->_21)); + M.r[2] = vld1q_f32(reinterpret_cast(&pSource->_31)); + M.r[3] = vld1q_f32(reinterpret_cast(&pSource->_41)); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_loadu_ps(&pSource->_11); + M.r[1] = _mm_loadu_ps(&pSource->_21); + M.r[2] = _mm_loadu_ps(&pSource->_31); + M.r[3] = _mm_loadu_ps(&pSource->_41); + return M; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMLoadFloat4x4A(const XMFLOAT4X4A* pSource) noexcept +{ + assert(pSource); + assert((reinterpret_cast(pSource) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = pSource->m[0][3]; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = pSource->m[1][3]; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = pSource->m[2][3]; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = pSource->m[3][3]; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + M.r[0] = vld1q_f32_ex(reinterpret_cast(&pSource->_11), 128); + M.r[1] = vld1q_f32_ex(reinterpret_cast(&pSource->_21), 128); + M.r[2] = vld1q_f32_ex(reinterpret_cast(&pSource->_31), 128); + M.r[3] = vld1q_f32_ex(reinterpret_cast(&pSource->_41), 128); +#else + M.r[0] = vld1q_f32(reinterpret_cast(&pSource->_11)); + M.r[1] = vld1q_f32(reinterpret_cast(&pSource->_21)); + M.r[2] = vld1q_f32(reinterpret_cast(&pSource->_31)); + M.r[3] = vld1q_f32(reinterpret_cast(&pSource->_41)); +#endif + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_load_ps(&pSource->_11); + M.r[1] = _mm_load_ps(&pSource->_21); + M.r[2] = _mm_load_ps(&pSource->_31); + M.r[3] = _mm_load_ps(&pSource->_41); + return M; +#endif +} + +/**************************************************************************** + * + * Vector and matrix store operations + * + ****************************************************************************/ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + *pDestination = XMVectorGetIntX(V); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(pDestination, *reinterpret_cast(&V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(reinterpret_cast(pDestination), V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat +( + float* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + *pDestination = XMVectorGetX(V); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(pDestination, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(pDestination, V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt2 +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); + vst1_u32(pDestination, VL); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt2A +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_u32_ex(pDestination, VL, 64); +#else + vst1_u32(pDestination, VL); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat2 +( + XMFLOAT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + vst1_f32(reinterpret_cast(pDestination), VL); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat2A +( + XMFLOAT2A* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_f32_ex(reinterpret_cast(pDestination), VL, 64); +#else + vst1_f32(reinterpret_cast(pDestination), VL); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreSInt2 +( + XMINT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t v = vget_low_f32(V); + int32x2_t iv = vcvt_s32_f32(v); + vst1_s32(reinterpret_cast(pDestination), iv); +#elif defined(_XM_SSE_INTRINSICS_) + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(V); + // If there was positive overflow, set to 0x7FFFFFFF + XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + // Write two ints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vOverflow)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUInt2 +( + XMUINT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t v = vget_low_f32(V); + uint32x2_t iv = vcvt_u32_f32(v); + vst1_u32(reinterpret_cast(pDestination), iv); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to >=0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + // Write two uints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vResult)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt3 +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); + vst1_u32(pDestination, VL); + vst1q_lane_u32(pDestination + 2, *reinterpret_cast(&V), 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(&pDestination[2]), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt3A +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t VL = vget_low_u32(vreinterpretq_u32_f32(V)); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_u32_ex(pDestination, VL, 64); +#else + vst1_u32(pDestination, VL); +#endif + vst1q_lane_u32(pDestination + 2, *reinterpret_cast(&V), 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = _mm_movehl_ps(V, V); + _mm_store_ss(reinterpret_cast(&pDestination[2]), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3 +( + XMFLOAT3* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + vst1_f32(reinterpret_cast(pDestination), VL); + vst1q_lane_f32(reinterpret_cast(pDestination) + 2, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + * reinterpret_cast(&pDestination->x) = _mm_extract_ps(V, 0); + *reinterpret_cast(&pDestination->y) = _mm_extract_ps(V, 1); + *reinterpret_cast(&pDestination->z) = _mm_extract_ps(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(&pDestination->z, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3A +( + XMFLOAT3A* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1_f32_ex(reinterpret_cast(pDestination), VL, 64); +#else + vst1_f32(reinterpret_cast(pDestination), VL); +#endif + vst1q_lane_f32(reinterpret_cast(pDestination) + 2, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + *reinterpret_cast(&pDestination->z) = _mm_extract_ps(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(V)); + __m128 z = _mm_movehl_ps(V, V); + _mm_store_ss(&pDestination->z, z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreSInt3 +( + XMINT3* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t v = vcvtq_s32_f32(V); + int32x2_t vL = vget_low_s32(v); + vst1_s32(reinterpret_cast(pDestination), vL); + vst1q_lane_s32(reinterpret_cast(pDestination) + 2, v, 2); +#elif defined(_XM_SSE_INTRINSICS_) + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(V); + // If there was positive overflow, set to 0x7FFFFFFF + XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + // Write 3 uints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vOverflow)); + __m128 z = XM_PERMUTE_PS(vOverflow, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(&pDestination->z), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUInt3 +( + XMUINT3* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t v = vcvtq_u32_f32(V); + uint32x2_t vL = vget_low_u32(v); + vst1_u32(reinterpret_cast(pDestination), vL); + vst1q_lane_u32(reinterpret_cast(pDestination) + 2, v, 2); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to >=0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + // Write 3 uints + _mm_store_sd(reinterpret_cast(pDestination), _mm_castps_pd(vResult)); + __m128 z = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(&pDestination->z), z); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt4 +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_u32(pDestination, vreinterpretq_u32_f32(V)); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreInt4A +( + uint32_t* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_u32_ex(pDestination, V, 128); +#else + vst1q_u32(pDestination, vreinterpretq_u32_f32(V)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(V)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4 +( + XMFLOAT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_f32(reinterpret_cast(pDestination), V); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_storeu_ps(&pDestination->x, V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4A +( + XMFLOAT4A* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_f32_ex(reinterpret_cast(pDestination), V, 128); +#else + vst1q_f32(reinterpret_cast(pDestination), V); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ps(&pDestination->x, V); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreSInt4 +( + XMINT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); + pDestination->w = static_cast(V.vector4_f32[3]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t v = vcvtq_s32_f32(V); + vst1q_s32(reinterpret_cast(pDestination), v); +#elif defined(_XM_SSE_INTRINSICS_) + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(V, g_XMMaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(V); + // If there was positive overflow, set to 0x7FFFFFFF + XMVECTOR vResult = _mm_and_ps(vOverflow, g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow, _mm_castsi128_ps(vResulti)); + vOverflow = _mm_or_ps(vOverflow, vResult); + _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(vOverflow)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUInt4 +( + XMUINT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + pDestination->x = static_cast(V.vector4_f32[0]); + pDestination->y = static_cast(V.vector4_f32[1]); + pDestination->z = static_cast(V.vector4_f32[2]); + pDestination->w = static_cast(V.vector4_f32[3]); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t v = vcvtq_u32_f32(V); + vst1q_u32(reinterpret_cast(pDestination), v); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to >=0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult, g_XMMaxUInt); + XMVECTOR vValue = g_XMUnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult, vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue, vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult, vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask, g_XMNegativeZero); + vResult = _mm_xor_ps(_mm_castsi128_ps(vResulti), vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult, vOverflow); + _mm_storeu_si128(reinterpret_cast<__m128i*>(pDestination), _mm_castps_si128(vResult)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3x3 +( + XMFLOAT3X3* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32(&pDestination->m[0][0], T2); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32(&pDestination->m[1][1], T2); + + vst1q_lane_f32(&pDestination->m[2][2], M.r[2], 2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vWork = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(0, 0, 2, 2)); + vTemp1 = _mm_shuffle_ps(vTemp1, vWork, _MM_SHUFFLE(2, 0, 1, 0)); + _mm_storeu_ps(&pDestination->m[0][0], vTemp1); + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); + _mm_storeu_ps(&pDestination->m[1][1], vTemp2); + vTemp3 = XM_PERMUTE_PS(vTemp3, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(&pDestination->m[2][2], vTemp3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x3 +( + XMFLOAT4X3* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32(&pDestination->m[0][0], T2); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32(&pDestination->m[1][1], T2); + + T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); + T2 = vextq_f32(T1, M.r[3], 3); + vst1q_f32(&pDestination->m[2][2], T2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vTemp4 = M.r[3]; + XMVECTOR vTemp2x = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp1, _MM_SHUFFLE(2, 2, 0, 0)); + vTemp1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(0, 2, 1, 0)); + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(0, 0, 2, 2)); + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 1, 2, 0)); + _mm_storeu_ps(&pDestination->m[0][0], vTemp1); + _mm_storeu_ps(&pDestination->m[1][1], vTemp2x); + _mm_storeu_ps(&pDestination->m[2][2], vTemp3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x3A +( + XMFLOAT4X3A* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32_ex(&pDestination->m[0][0], T2, 128); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32_ex(&pDestination->m[1][1], T2, 128); + + T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); + T2 = vextq_f32(T1, M.r[3], 3); + vst1q_f32_ex(&pDestination->m[2][2], T2, 128); +#else + float32x4_t T1 = vextq_f32(M.r[0], M.r[1], 1); + float32x4_t T2 = vbslq_f32(g_XMMask3, M.r[0], T1); + vst1q_f32(&pDestination->m[0][0], T2); + + T1 = vextq_f32(M.r[1], M.r[1], 1); + T2 = vcombine_f32(vget_low_f32(T1), vget_low_f32(M.r[2])); + vst1q_f32(&pDestination->m[1][1], T2); + + T1 = vdupq_lane_f32(vget_high_f32(M.r[2]), 0); + T2 = vextq_f32(T1, M.r[3], 3); + vst1q_f32(&pDestination->m[2][2], T2); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + // x1,y1,z1,w1 + XMVECTOR vTemp1 = M.r[0]; + // x2,y2,z2,w2 + XMVECTOR vTemp2 = M.r[1]; + // x3,y3,z3,w3 + XMVECTOR vTemp3 = M.r[2]; + // x4,y4,z4,w4 + XMVECTOR vTemp4 = M.r[3]; + // z1,z1,x2,y2 + XMVECTOR vTemp = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(1, 0, 2, 2)); + // y2,z2,x3,y3 (Final) + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp3, _MM_SHUFFLE(1, 0, 2, 1)); + // x1,y1,z1,x2 (Final) + vTemp1 = _mm_shuffle_ps(vTemp1, vTemp, _MM_SHUFFLE(2, 0, 1, 0)); + // z3,z3,x4,x4 + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(0, 0, 2, 2)); + // z3,x4,y4,z4 (Final) + vTemp3 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 1, 2, 0)); + // Store in 3 operations + _mm_store_ps(&pDestination->m[0][0], vTemp1); + _mm_store_ps(&pDestination->m[1][1], vTemp2); + _mm_store_ps(&pDestination->m[2][2], vTemp3); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3x4 +( + XMFLOAT3X4* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[1].vector4_f32[0]; + pDestination->m[0][2] = M.r[2].vector4_f32[0]; + pDestination->m[0][3] = M.r[3].vector4_f32[0]; + + pDestination->m[1][0] = M.r[0].vector4_f32[1]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[2].vector4_f32[1]; + pDestination->m[1][3] = M.r[3].vector4_f32[1]; + + pDestination->m[2][0] = M.r[0].vector4_f32[2]; + pDestination->m[2][1] = M.r[1].vector4_f32[2]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); + float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + + vst1q_f32(&pDestination->m[0][0], T0.val[0]); + vst1q_f32(&pDestination->m[1][0], T0.val[1]); + vst1q_f32(&pDestination->m[2][0], T1.val[0]); +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + // x.x,y.x,z.x,w.x + XMVECTOR r0 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + XMVECTOR r1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + XMVECTOR r2 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + + _mm_storeu_ps(&pDestination->m[0][0], r0); + _mm_storeu_ps(&pDestination->m[1][0], r1); + _mm_storeu_ps(&pDestination->m[2][0], r2); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3x4A +( + XMFLOAT3X4A* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[1].vector4_f32[0]; + pDestination->m[0][2] = M.r[2].vector4_f32[0]; + pDestination->m[0][3] = M.r[3].vector4_f32[0]; + + pDestination->m[1][0] = M.r[0].vector4_f32[1]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[2].vector4_f32[1]; + pDestination->m[1][3] = M.r[3].vector4_f32[1]; + + pDestination->m[2][0] = M.r[0].vector4_f32[2]; + pDestination->m[2][1] = M.r[1].vector4_f32[2]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); + float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_f32_ex(&pDestination->m[0][0], T0.val[0], 128); + vst1q_f32_ex(&pDestination->m[1][0], T0.val[1], 128); + vst1q_f32_ex(&pDestination->m[2][0], T1.val[0], 128); +#else + vst1q_f32(&pDestination->m[0][0], T0.val[0]); + vst1q_f32(&pDestination->m[1][0], T0.val[1]); + vst1q_f32(&pDestination->m[2][0], T1.val[0]); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + // x.x,y.x,z.x,w.x + XMVECTOR r0 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + XMVECTOR r1 = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + XMVECTOR r2 = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + + _mm_store_ps(&pDestination->m[0][0], r0); + _mm_store_ps(&pDestination->m[1][0], r1); + _mm_store_ps(&pDestination->m[2][0], r2); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x4 +( + XMFLOAT4X4* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_f32(reinterpret_cast(&pDestination->_11), M.r[0]); + vst1q_f32(reinterpret_cast(&pDestination->_21), M.r[1]); + vst1q_f32(reinterpret_cast(&pDestination->_31), M.r[2]); + vst1q_f32(reinterpret_cast(&pDestination->_41), M.r[3]); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_storeu_ps(&pDestination->_11, M.r[0]); + _mm_storeu_ps(&pDestination->_21, M.r[1]); + _mm_storeu_ps(&pDestination->_31, M.r[2]); + _mm_storeu_ps(&pDestination->_41, M.r[3]); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat4x4A +( + XMFLOAT4X4A* pDestination, + FXMMATRIX M +) noexcept +{ + assert(pDestination); + assert((reinterpret_cast(pDestination) & 0xF) == 0); +#if defined(_XM_NO_INTRINSICS_) + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + vst1q_f32_ex(reinterpret_cast(&pDestination->_11), M.r[0], 128); + vst1q_f32_ex(reinterpret_cast(&pDestination->_21), M.r[1], 128); + vst1q_f32_ex(reinterpret_cast(&pDestination->_31), M.r[2], 128); + vst1q_f32_ex(reinterpret_cast(&pDestination->_41), M.r[3], 128); +#else + vst1q_f32(reinterpret_cast(&pDestination->_11), M.r[0]); + vst1q_f32(reinterpret_cast(&pDestination->_21), M.r[1]); + vst1q_f32(reinterpret_cast(&pDestination->_31), M.r[2]); + vst1q_f32(reinterpret_cast(&pDestination->_41), M.r[3]); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ps(&pDestination->_11, M.r[0]); + _mm_store_ps(&pDestination->_21, M.r[1]); + _mm_store_ps(&pDestination->_31, M.r[2]); + _mm_store_ps(&pDestination->_41, M.r[3]); +#endif +} + diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathMatrix.inl b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathMatrix.inl similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathMatrix.inl rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathMatrix.inl index cce238c5b..36f4f9a74 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathMatrix.inl +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathMatrix.inl @@ -1,3554 +1,3554 @@ -//------------------------------------------------------------------------------------- -// DirectXMathMatrix.inl -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -/**************************************************************************** - * - * Matrix - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -// Return true if any entry in the matrix is NaN -inline bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - size_t i = 16; - auto pWork = reinterpret_cast(&M.m[0][0]); - do - { - // Fetch value into integer unit - uint32_t uTest = pWork[0]; - // Remove sign - uTest &= 0x7FFFFFFFU; - // NaN is 0x7F800001 through 0x7FFFFFFF inclusive - uTest -= 0x7F800001U; - if (uTest < 0x007FFFFFU) - { - break; // NaN found - } - ++pWork; // Next entry - } - while (--i); - return (i != 0); // i == 0 if nothing matched -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Load in registers - float32x4_t vX = M.r[0]; - float32x4_t vY = M.r[1]; - float32x4_t vZ = M.r[2]; - float32x4_t vW = M.r[3]; - // Test themselves to check for NaN - uint32x4_t xmask = vmvnq_u32(vceqq_f32(vX, vX)); - uint32x4_t ymask = vmvnq_u32(vceqq_f32(vY, vY)); - uint32x4_t zmask = vmvnq_u32(vceqq_f32(vZ, vZ)); - uint32x4_t wmask = vmvnq_u32(vceqq_f32(vW, vW)); - // Or all the results - xmask = vorrq_u32(xmask, zmask); - ymask = vorrq_u32(ymask, wmask); - xmask = vorrq_u32(xmask, ymask); - // If any tested true, return true - uint8x8x2_t vTemp = vzip_u8( - vget_low_u8(vreinterpretq_u8_u32(xmask)), - vget_high_u8(vreinterpretq_u8_u32(xmask))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - return (r != 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Load in registers - XMVECTOR vX = M.r[0]; - XMVECTOR vY = M.r[1]; - XMVECTOR vZ = M.r[2]; - XMVECTOR vW = M.r[3]; - // Test themselves to check for NaN - vX = _mm_cmpneq_ps(vX, vX); - vY = _mm_cmpneq_ps(vY, vY); - vZ = _mm_cmpneq_ps(vZ, vZ); - vW = _mm_cmpneq_ps(vW, vW); - // Or all the results - vX = _mm_or_ps(vX, vZ); - vY = _mm_or_ps(vY, vW); - vX = _mm_or_ps(vX, vY); - // If any tested true, return true - return (_mm_movemask_ps(vX) != 0); -#else -#endif -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(pop) -#endif - -//------------------------------------------------------------------------------ - -// Return true if any entry in the matrix is +/-INF -inline bool XM_CALLCONV XMMatrixIsInfinite(FXMMATRIX M) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - size_t i = 16; - auto pWork = reinterpret_cast(&M.m[0][0]); - do - { - // Fetch value into integer unit - uint32_t uTest = pWork[0]; - // Remove sign - uTest &= 0x7FFFFFFFU; - // INF is 0x7F800000 - if (uTest == 0x7F800000U) - { - break; // INF found - } - ++pWork; // Next entry - } - while (--i); - return (i != 0); // i == 0 if nothing matched -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Load in registers - float32x4_t vX = M.r[0]; - float32x4_t vY = M.r[1]; - float32x4_t vZ = M.r[2]; - float32x4_t vW = M.r[3]; - // Mask off the sign bits - vX = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vX), g_XMAbsMask)); - vY = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vY), g_XMAbsMask)); - vZ = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vZ), g_XMAbsMask)); - vW = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vW), g_XMAbsMask)); - // Compare to infinity - uint32x4_t xmask = vceqq_f32(vX, g_XMInfinity); - uint32x4_t ymask = vceqq_f32(vY, g_XMInfinity); - uint32x4_t zmask = vceqq_f32(vZ, g_XMInfinity); - uint32x4_t wmask = vceqq_f32(vW, g_XMInfinity); - // Or the answers together - xmask = vorrq_u32(xmask, zmask); - ymask = vorrq_u32(ymask, wmask); - xmask = vorrq_u32(xmask, ymask); - // If any tested true, return true - uint8x8x2_t vTemp = vzip_u8( - vget_low_u8(vreinterpretq_u8_u32(xmask)), - vget_high_u8(vreinterpretq_u8_u32(xmask))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - return (r != 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Mask off the sign bits - XMVECTOR vTemp1 = _mm_and_ps(M.r[0], g_XMAbsMask); - XMVECTOR vTemp2 = _mm_and_ps(M.r[1], g_XMAbsMask); - XMVECTOR vTemp3 = _mm_and_ps(M.r[2], g_XMAbsMask); - XMVECTOR vTemp4 = _mm_and_ps(M.r[3], g_XMAbsMask); - // Compare to infinity - vTemp1 = _mm_cmpeq_ps(vTemp1, g_XMInfinity); - vTemp2 = _mm_cmpeq_ps(vTemp2, g_XMInfinity); - vTemp3 = _mm_cmpeq_ps(vTemp3, g_XMInfinity); - vTemp4 = _mm_cmpeq_ps(vTemp4, g_XMInfinity); - // Or the answers together - vTemp1 = _mm_or_ps(vTemp1, vTemp2); - vTemp3 = _mm_or_ps(vTemp3, vTemp4); - vTemp1 = _mm_or_ps(vTemp1, vTemp3); - // If any are infinity, the signs are true. - return (_mm_movemask_ps(vTemp1) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -// Return true if the XMMatrix is equal to identity -inline bool XM_CALLCONV XMMatrixIsIdentity(FXMMATRIX M) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - // Use the integer pipeline to reduce branching to a minimum - auto pWork = reinterpret_cast(&M.m[0][0]); - // Convert 1.0f to zero and or them together - uint32_t uOne = pWork[0] ^ 0x3F800000U; - // Or all the 0.0f entries together - uint32_t uZero = pWork[1]; - uZero |= pWork[2]; - uZero |= pWork[3]; - // 2nd row - uZero |= pWork[4]; - uOne |= pWork[5] ^ 0x3F800000U; - uZero |= pWork[6]; - uZero |= pWork[7]; - // 3rd row - uZero |= pWork[8]; - uZero |= pWork[9]; - uOne |= pWork[10] ^ 0x3F800000U; - uZero |= pWork[11]; - // 4th row - uZero |= pWork[12]; - uZero |= pWork[13]; - uZero |= pWork[14]; - uOne |= pWork[15] ^ 0x3F800000U; - // If all zero entries are zero, the uZero==0 - uZero &= 0x7FFFFFFF; // Allow -0.0f - // If all 1.0f entries are 1.0f, then uOne==0 - uOne |= uZero; - return (uOne == 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t xmask = vceqq_f32(M.r[0], g_XMIdentityR0); - uint32x4_t ymask = vceqq_f32(M.r[1], g_XMIdentityR1); - uint32x4_t zmask = vceqq_f32(M.r[2], g_XMIdentityR2); - uint32x4_t wmask = vceqq_f32(M.r[3], g_XMIdentityR3); - xmask = vandq_u32(xmask, zmask); - ymask = vandq_u32(ymask, wmask); - xmask = vandq_u32(xmask, ymask); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(xmask)), vget_high_u8(vreinterpretq_u8_u32(xmask))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - return (r == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp1 = _mm_cmpeq_ps(M.r[0], g_XMIdentityR0); - XMVECTOR vTemp2 = _mm_cmpeq_ps(M.r[1], g_XMIdentityR1); - XMVECTOR vTemp3 = _mm_cmpeq_ps(M.r[2], g_XMIdentityR2); - XMVECTOR vTemp4 = _mm_cmpeq_ps(M.r[3], g_XMIdentityR3); - vTemp1 = _mm_and_ps(vTemp1, vTemp2); - vTemp3 = _mm_and_ps(vTemp3, vTemp4); - vTemp1 = _mm_and_ps(vTemp1, vTemp3); - return (_mm_movemask_ps(vTemp1) == 0x0f); -#endif -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ -// Perform a 4x4 matrix multiply by a 4x4 matrix -inline XMMATRIX XM_CALLCONV XMMatrixMultiply -( - FXMMATRIX M1, - CXMMATRIX M2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMMATRIX mResult; - // Cache the invariants in registers - float x = M1.m[0][0]; - float y = M1.m[0][1]; - float z = M1.m[0][2]; - float w = M1.m[0][3]; - // Perform the operation on the first row - mResult.m[0][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); - mResult.m[0][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); - mResult.m[0][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); - mResult.m[0][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); - // Repeat for all the other rows - x = M1.m[1][0]; - y = M1.m[1][1]; - z = M1.m[1][2]; - w = M1.m[1][3]; - mResult.m[1][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); - mResult.m[1][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); - mResult.m[1][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); - mResult.m[1][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); - x = M1.m[2][0]; - y = M1.m[2][1]; - z = M1.m[2][2]; - w = M1.m[2][3]; - mResult.m[2][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); - mResult.m[2][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); - mResult.m[2][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); - mResult.m[2][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); - x = M1.m[3][0]; - y = M1.m[3][1]; - z = M1.m[3][2]; - w = M1.m[3][3]; - mResult.m[3][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); - mResult.m[3][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); - mResult.m[3][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); - mResult.m[3][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); - return mResult; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX mResult; - float32x2_t VL = vget_low_f32(M1.r[0]); - float32x2_t VH = vget_high_f32(M1.r[0]); - // Perform the operation on the first row - float32x4_t vX = vmulq_lane_f32(M2.r[0], VL, 0); - float32x4_t vY = vmulq_lane_f32(M2.r[1], VL, 1); - float32x4_t vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - float32x4_t vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - mResult.r[0] = vaddq_f32(vZ, vW); - // Repeat for the other 3 rows - VL = vget_low_f32(M1.r[1]); - VH = vget_high_f32(M1.r[1]); - vX = vmulq_lane_f32(M2.r[0], VL, 0); - vY = vmulq_lane_f32(M2.r[1], VL, 1); - vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - mResult.r[1] = vaddq_f32(vZ, vW); - VL = vget_low_f32(M1.r[2]); - VH = vget_high_f32(M1.r[2]); - vX = vmulq_lane_f32(M2.r[0], VL, 0); - vY = vmulq_lane_f32(M2.r[1], VL, 1); - vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - mResult.r[2] = vaddq_f32(vZ, vW); - VL = vget_low_f32(M1.r[3]); - VH = vget_high_f32(M1.r[3]); - vX = vmulq_lane_f32(M2.r[0], VL, 0); - vY = vmulq_lane_f32(M2.r[1], VL, 1); - vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - mResult.r[3] = vaddq_f32(vZ, vW); - return mResult; -#elif defined(_XM_AVX2_INTRINSICS_) - __m256 t0 = _mm256_castps128_ps256(M1.r[0]); - t0 = _mm256_insertf128_ps(t0, M1.r[1], 1); - __m256 t1 = _mm256_castps128_ps256(M1.r[2]); - t1 = _mm256_insertf128_ps(t1, M1.r[3], 1); - - __m256 u0 = _mm256_castps128_ps256(M2.r[0]); - u0 = _mm256_insertf128_ps(u0, M2.r[1], 1); - __m256 u1 = _mm256_castps128_ps256(M2.r[2]); - u1 = _mm256_insertf128_ps(u1, M2.r[3], 1); - - __m256 a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 b0 = _mm256_permute2f128_ps(u0, u0, 0x00); - __m256 c0 = _mm256_mul_ps(a0, b0); - __m256 c1 = _mm256_mul_ps(a1, b0); - - a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(1, 1, 1, 1)); - a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(1, 1, 1, 1)); - b0 = _mm256_permute2f128_ps(u0, u0, 0x11); - __m256 c2 = _mm256_fmadd_ps(a0, b0, c0); - __m256 c3 = _mm256_fmadd_ps(a1, b0, c1); - - a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(2, 2, 2, 2)); - a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 b1 = _mm256_permute2f128_ps(u1, u1, 0x00); - __m256 c4 = _mm256_mul_ps(a0, b1); - __m256 c5 = _mm256_mul_ps(a1, b1); - - a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(3, 3, 3, 3)); - a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(3, 3, 3, 3)); - b1 = _mm256_permute2f128_ps(u1, u1, 0x11); - __m256 c6 = _mm256_fmadd_ps(a0, b1, c4); - __m256 c7 = _mm256_fmadd_ps(a1, b1, c5); - - t0 = _mm256_add_ps(c2, c6); - t1 = _mm256_add_ps(c3, c7); - - XMMATRIX mResult; - mResult.r[0] = _mm256_castps256_ps128(t0); - mResult.r[1] = _mm256_extractf128_ps(t0, 1); - mResult.r[2] = _mm256_castps256_ps128(t1); - mResult.r[3] = _mm256_extractf128_ps(t1, 1); - return mResult; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX mResult; - // Splat the component X,Y,Z then W -#if defined(_XM_AVX_INTRINSICS_) - XMVECTOR vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 0); - XMVECTOR vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 1); - XMVECTOR vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 2); - XMVECTOR vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 3); -#else - // Use vW to hold the original row - XMVECTOR vW = M1.r[0]; - XMVECTOR vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - // Perform the operation on the first row - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - // Perform a binary add to reduce cumulative errors - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - mResult.r[0] = vX; - // Repeat for the other 3 rows -#if defined(_XM_AVX_INTRINSICS_) - vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 0); - vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 1); - vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 2); - vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 3); -#else - vW = M1.r[1]; - vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - mResult.r[1] = vX; -#if defined(_XM_AVX_INTRINSICS_) - vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 0); - vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 1); - vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 2); - vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 3); -#else - vW = M1.r[2]; - vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - mResult.r[2] = vX; -#if defined(_XM_AVX_INTRINSICS_) - vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 0); - vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 1); - vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 2); - vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 3); -#else - vW = M1.r[3]; - vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - mResult.r[3] = vX; - return mResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose -( - FXMMATRIX M1, - CXMMATRIX M2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMMATRIX mResult; - // Cache the invariants in registers - float x = M2.m[0][0]; - float y = M2.m[1][0]; - float z = M2.m[2][0]; - float w = M2.m[3][0]; - // Perform the operation on the first row - mResult.m[0][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); - mResult.m[0][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); - mResult.m[0][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); - mResult.m[0][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); - // Repeat for all the other rows - x = M2.m[0][1]; - y = M2.m[1][1]; - z = M2.m[2][1]; - w = M2.m[3][1]; - mResult.m[1][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); - mResult.m[1][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); - mResult.m[1][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); - mResult.m[1][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); - x = M2.m[0][2]; - y = M2.m[1][2]; - z = M2.m[2][2]; - w = M2.m[3][2]; - mResult.m[2][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); - mResult.m[2][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); - mResult.m[2][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); - mResult.m[2][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); - x = M2.m[0][3]; - y = M2.m[1][3]; - z = M2.m[2][3]; - w = M2.m[3][3]; - mResult.m[3][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); - mResult.m[3][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); - mResult.m[3][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); - mResult.m[3][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); - return mResult; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(M1.r[0]); - float32x2_t VH = vget_high_f32(M1.r[0]); - // Perform the operation on the first row - float32x4_t vX = vmulq_lane_f32(M2.r[0], VL, 0); - float32x4_t vY = vmulq_lane_f32(M2.r[1], VL, 1); - float32x4_t vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - float32x4_t vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - float32x4_t r0 = vaddq_f32(vZ, vW); - // Repeat for the other 3 rows - VL = vget_low_f32(M1.r[1]); - VH = vget_high_f32(M1.r[1]); - vX = vmulq_lane_f32(M2.r[0], VL, 0); - vY = vmulq_lane_f32(M2.r[1], VL, 1); - vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - float32x4_t r1 = vaddq_f32(vZ, vW); - VL = vget_low_f32(M1.r[2]); - VH = vget_high_f32(M1.r[2]); - vX = vmulq_lane_f32(M2.r[0], VL, 0); - vY = vmulq_lane_f32(M2.r[1], VL, 1); - vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - float32x4_t r2 = vaddq_f32(vZ, vW); - VL = vget_low_f32(M1.r[3]); - VH = vget_high_f32(M1.r[3]); - vX = vmulq_lane_f32(M2.r[0], VL, 0); - vY = vmulq_lane_f32(M2.r[1], VL, 1); - vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); - vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); - float32x4_t r3 = vaddq_f32(vZ, vW); - - // Transpose result - float32x4x2_t P0 = vzipq_f32(r0, r2); - float32x4x2_t P1 = vzipq_f32(r1, r3); - - float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); - float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); - - XMMATRIX mResult; - mResult.r[0] = T0.val[0]; - mResult.r[1] = T0.val[1]; - mResult.r[2] = T1.val[0]; - mResult.r[3] = T1.val[1]; - return mResult; -#elif defined(_XM_AVX2_INTRINSICS_) - __m256 t0 = _mm256_castps128_ps256(M1.r[0]); - t0 = _mm256_insertf128_ps(t0, M1.r[1], 1); - __m256 t1 = _mm256_castps128_ps256(M1.r[2]); - t1 = _mm256_insertf128_ps(t1, M1.r[3], 1); - - __m256 u0 = _mm256_castps128_ps256(M2.r[0]); - u0 = _mm256_insertf128_ps(u0, M2.r[1], 1); - __m256 u1 = _mm256_castps128_ps256(M2.r[2]); - u1 = _mm256_insertf128_ps(u1, M2.r[3], 1); - - __m256 a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 b0 = _mm256_permute2f128_ps(u0, u0, 0x00); - __m256 c0 = _mm256_mul_ps(a0, b0); - __m256 c1 = _mm256_mul_ps(a1, b0); - - a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(1, 1, 1, 1)); - a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(1, 1, 1, 1)); - b0 = _mm256_permute2f128_ps(u0, u0, 0x11); - __m256 c2 = _mm256_fmadd_ps(a0, b0, c0); - __m256 c3 = _mm256_fmadd_ps(a1, b0, c1); - - a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(2, 2, 2, 2)); - a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 b1 = _mm256_permute2f128_ps(u1, u1, 0x00); - __m256 c4 = _mm256_mul_ps(a0, b1); - __m256 c5 = _mm256_mul_ps(a1, b1); - - a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(3, 3, 3, 3)); - a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(3, 3, 3, 3)); - b1 = _mm256_permute2f128_ps(u1, u1, 0x11); - __m256 c6 = _mm256_fmadd_ps(a0, b1, c4); - __m256 c7 = _mm256_fmadd_ps(a1, b1, c5); - - t0 = _mm256_add_ps(c2, c6); - t1 = _mm256_add_ps(c3, c7); - - // Transpose result - __m256 vTemp = _mm256_unpacklo_ps(t0, t1); - __m256 vTemp2 = _mm256_unpackhi_ps(t0, t1); - __m256 vTemp3 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); - __m256 vTemp4 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); - vTemp = _mm256_unpacklo_ps(vTemp3, vTemp4); - vTemp2 = _mm256_unpackhi_ps(vTemp3, vTemp4); - t0 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); - t1 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); - - XMMATRIX mResult; - mResult.r[0] = _mm256_castps256_ps128(t0); - mResult.r[1] = _mm256_extractf128_ps(t0, 1); - mResult.r[2] = _mm256_castps256_ps128(t1); - mResult.r[3] = _mm256_extractf128_ps(t1, 1); - return mResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the component X,Y,Z then W -#if defined(_XM_AVX_INTRINSICS_) - XMVECTOR vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 0); - XMVECTOR vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 1); - XMVECTOR vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 2); - XMVECTOR vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 3); -#else - // Use vW to hold the original row - XMVECTOR vW = M1.r[0]; - XMVECTOR vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - // Perform the operation on the first row - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - // Perform a binary add to reduce cumulative errors - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - XMVECTOR r0 = vX; - // Repeat for the other 3 rows -#if defined(_XM_AVX_INTRINSICS_) - vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 0); - vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 1); - vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 2); - vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 3); -#else - vW = M1.r[1]; - vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - XMVECTOR r1 = vX; -#if defined(_XM_AVX_INTRINSICS_) - vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 0); - vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 1); - vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 2); - vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 3); -#else - vW = M1.r[2]; - vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - XMVECTOR r2 = vX; -#if defined(_XM_AVX_INTRINSICS_) - vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 0); - vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 1); - vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 2); - vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 3); -#else - vW = M1.r[3]; - vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); - vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); - vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); - vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); -#endif - vX = _mm_mul_ps(vX, M2.r[0]); - vY = _mm_mul_ps(vY, M2.r[1]); - vZ = _mm_mul_ps(vZ, M2.r[2]); - vW = _mm_mul_ps(vW, M2.r[3]); - vX = _mm_add_ps(vX, vZ); - vY = _mm_add_ps(vY, vW); - vX = _mm_add_ps(vX, vY); - XMVECTOR r3 = vX; - - // Transpose result - // x.x,x.y,y.x,y.y - XMVECTOR vTemp1 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(1, 0, 1, 0)); - // x.z,x.w,y.z,y.w - XMVECTOR vTemp3 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(3, 2, 3, 2)); - // z.x,z.y,w.x,w.y - XMVECTOR vTemp2 = _mm_shuffle_ps(r2, r3, _MM_SHUFFLE(1, 0, 1, 0)); - // z.z,z.w,w.z,w.w - XMVECTOR vTemp4 = _mm_shuffle_ps(r2, r3, _MM_SHUFFLE(3, 2, 3, 2)); - - XMMATRIX mResult; - // x.x,y.x,z.x,w.x - mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - // x.y,y.y,z.y,w.y - mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - // x.z,y.z,z.z,w.z - mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - // x.w,y.w,z.w,w.w - mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); - return mResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixTranspose(FXMMATRIX M) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - // Original matrix: - // - // m00m01m02m03 - // m10m11m12m13 - // m20m21m22m23 - // m30m31m32m33 - - XMMATRIX P; - P.r[0] = XMVectorMergeXY(M.r[0], M.r[2]); // m00m20m01m21 - P.r[1] = XMVectorMergeXY(M.r[1], M.r[3]); // m10m30m11m31 - P.r[2] = XMVectorMergeZW(M.r[0], M.r[2]); // m02m22m03m23 - P.r[3] = XMVectorMergeZW(M.r[1], M.r[3]); // m12m32m13m33 - - XMMATRIX MT; - MT.r[0] = XMVectorMergeXY(P.r[0], P.r[1]); // m00m10m20m30 - MT.r[1] = XMVectorMergeZW(P.r[0], P.r[1]); // m01m11m21m31 - MT.r[2] = XMVectorMergeXY(P.r[2], P.r[3]); // m02m12m22m32 - MT.r[3] = XMVectorMergeZW(P.r[2], P.r[3]); // m03m13m23m33 - return MT; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); - float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); - - float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); - float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); - - XMMATRIX mResult; - mResult.r[0] = T0.val[0]; - mResult.r[1] = T0.val[1]; - mResult.r[2] = T1.val[0]; - mResult.r[3] = T1.val[1]; - return mResult; -#elif defined(_XM_AVX2_INTRINSICS_) - __m256 t0 = _mm256_castps128_ps256(M.r[0]); - t0 = _mm256_insertf128_ps(t0, M.r[1], 1); - __m256 t1 = _mm256_castps128_ps256(M.r[2]); - t1 = _mm256_insertf128_ps(t1, M.r[3], 1); - - __m256 vTemp = _mm256_unpacklo_ps(t0, t1); - __m256 vTemp2 = _mm256_unpackhi_ps(t0, t1); - __m256 vTemp3 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); - __m256 vTemp4 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); - vTemp = _mm256_unpacklo_ps(vTemp3, vTemp4); - vTemp2 = _mm256_unpackhi_ps(vTemp3, vTemp4); - t0 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); - t1 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); - - XMMATRIX mResult; - mResult.r[0] = _mm256_castps256_ps128(t0); - mResult.r[1] = _mm256_extractf128_ps(t0, 1); - mResult.r[2] = _mm256_castps256_ps128(t1); - mResult.r[3] = _mm256_extractf128_ps(t1, 1); - return mResult; -#elif defined(_XM_SSE_INTRINSICS_) - // x.x,x.y,y.x,y.y - XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); - // x.z,x.w,y.z,y.w - XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - // z.x,z.y,w.x,w.y - XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); - // z.z,z.w,w.z,w.w - XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - - XMMATRIX mResult; - // x.x,y.x,z.x,w.x - mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - // x.y,y.y,z.y,w.y - mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - // x.z,y.z,z.z,w.z - mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - // x.w,y.w,z.w,w.w - mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); - return mResult; -#endif -} - -//------------------------------------------------------------------------------ -// Return the inverse and the determinant of a 4x4 matrix -_Use_decl_annotations_ -inline XMMATRIX XM_CALLCONV XMMatrixInverse -( - XMVECTOR* pDeterminant, - FXMMATRIX M -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - XMMATRIX MT = XMMatrixTranspose(M); - - XMVECTOR V0[4], V1[4]; - V0[0] = XMVectorSwizzle(MT.r[2]); - V1[0] = XMVectorSwizzle(MT.r[3]); - V0[1] = XMVectorSwizzle(MT.r[0]); - V1[1] = XMVectorSwizzle(MT.r[1]); - V0[2] = XMVectorPermute(MT.r[2], MT.r[0]); - V1[2] = XMVectorPermute(MT.r[3], MT.r[1]); - - XMVECTOR D0 = XMVectorMultiply(V0[0], V1[0]); - XMVECTOR D1 = XMVectorMultiply(V0[1], V1[1]); - XMVECTOR D2 = XMVectorMultiply(V0[2], V1[2]); - - V0[0] = XMVectorSwizzle(MT.r[2]); - V1[0] = XMVectorSwizzle(MT.r[3]); - V0[1] = XMVectorSwizzle(MT.r[0]); - V1[1] = XMVectorSwizzle(MT.r[1]); - V0[2] = XMVectorPermute(MT.r[2], MT.r[0]); - V1[2] = XMVectorPermute(MT.r[3], MT.r[1]); - - D0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], D0); - D1 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], D1); - D2 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], D2); - - V0[0] = XMVectorSwizzle(MT.r[1]); - V1[0] = XMVectorPermute(D0, D2); - V0[1] = XMVectorSwizzle(MT.r[0]); - V1[1] = XMVectorPermute(D0, D2); - V0[2] = XMVectorSwizzle(MT.r[3]); - V1[2] = XMVectorPermute(D1, D2); - V0[3] = XMVectorSwizzle(MT.r[2]); - V1[3] = XMVectorPermute(D1, D2); - - XMVECTOR C0 = XMVectorMultiply(V0[0], V1[0]); - XMVECTOR C2 = XMVectorMultiply(V0[1], V1[1]); - XMVECTOR C4 = XMVectorMultiply(V0[2], V1[2]); - XMVECTOR C6 = XMVectorMultiply(V0[3], V1[3]); - - V0[0] = XMVectorSwizzle(MT.r[1]); - V1[0] = XMVectorPermute(D0, D2); - V0[1] = XMVectorSwizzle(MT.r[0]); - V1[1] = XMVectorPermute(D0, D2); - V0[2] = XMVectorSwizzle(MT.r[3]); - V1[2] = XMVectorPermute(D1, D2); - V0[3] = XMVectorSwizzle(MT.r[2]); - V1[3] = XMVectorPermute(D1, D2); - - C0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); - C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); - C4 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); - C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); - - V0[0] = XMVectorSwizzle(MT.r[1]); - V1[0] = XMVectorPermute(D0, D2); - V0[1] = XMVectorSwizzle(MT.r[0]); - V1[1] = XMVectorPermute(D0, D2); - V0[2] = XMVectorSwizzle(MT.r[3]); - V1[2] = XMVectorPermute(D1, D2); - V0[3] = XMVectorSwizzle(MT.r[2]); - V1[3] = XMVectorPermute(D1, D2); - - XMVECTOR C1 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); - C0 = XMVectorMultiplyAdd(V0[0], V1[0], C0); - XMVECTOR C3 = XMVectorMultiplyAdd(V0[1], V1[1], C2); - C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); - XMVECTOR C5 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); - C4 = XMVectorMultiplyAdd(V0[2], V1[2], C4); - XMVECTOR C7 = XMVectorMultiplyAdd(V0[3], V1[3], C6); - C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); - - XMMATRIX R; - R.r[0] = XMVectorSelect(C0, C1, g_XMSelect0101.v); - R.r[1] = XMVectorSelect(C2, C3, g_XMSelect0101.v); - R.r[2] = XMVectorSelect(C4, C5, g_XMSelect0101.v); - R.r[3] = XMVectorSelect(C6, C7, g_XMSelect0101.v); - - XMVECTOR Determinant = XMVector4Dot(R.r[0], MT.r[0]); - - if (pDeterminant != nullptr) - *pDeterminant = Determinant; - - XMVECTOR Reciprocal = XMVectorReciprocal(Determinant); - - XMMATRIX Result; - Result.r[0] = XMVectorMultiply(R.r[0], Reciprocal); - Result.r[1] = XMVectorMultiply(R.r[1], Reciprocal); - Result.r[2] = XMVectorMultiply(R.r[2], Reciprocal); - Result.r[3] = XMVectorMultiply(R.r[3], Reciprocal); - return Result; - -#elif defined(_XM_SSE_INTRINSICS_) - // Transpose matrix - XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); - XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); - XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - - XMMATRIX MT; - MT.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); - MT.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); - MT.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); - MT.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); - - XMVECTOR V00 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(1, 1, 0, 0)); - XMVECTOR V10 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(3, 2, 3, 2)); - XMVECTOR V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(1, 1, 0, 0)); - XMVECTOR V11 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(3, 2, 3, 2)); - XMVECTOR V02 = _mm_shuffle_ps(MT.r[2], MT.r[0], _MM_SHUFFLE(2, 0, 2, 0)); - XMVECTOR V12 = _mm_shuffle_ps(MT.r[3], MT.r[1], _MM_SHUFFLE(3, 1, 3, 1)); - - XMVECTOR D0 = _mm_mul_ps(V00, V10); - XMVECTOR D1 = _mm_mul_ps(V01, V11); - XMVECTOR D2 = _mm_mul_ps(V02, V12); - - V00 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(3, 2, 3, 2)); - V10 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(1, 1, 0, 0)); - V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(3, 2, 3, 2)); - V11 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(1, 1, 0, 0)); - V02 = _mm_shuffle_ps(MT.r[2], MT.r[0], _MM_SHUFFLE(3, 1, 3, 1)); - V12 = _mm_shuffle_ps(MT.r[3], MT.r[1], _MM_SHUFFLE(2, 0, 2, 0)); - - D0 = XM_FNMADD_PS(V00, V10, D0); - D1 = XM_FNMADD_PS(V01, V11, D1); - D2 = XM_FNMADD_PS(V02, V12, D2); - // V11 = D0Y,D0W,D2Y,D2Y - V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 1, 3, 1)); - V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(1, 0, 2, 1)); - V10 = _mm_shuffle_ps(V11, D0, _MM_SHUFFLE(0, 3, 0, 2)); - V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(0, 1, 0, 2)); - V11 = _mm_shuffle_ps(V11, D0, _MM_SHUFFLE(2, 1, 2, 1)); - // V13 = D1Y,D1W,D2W,D2W - XMVECTOR V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 3, 3, 1)); - V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(1, 0, 2, 1)); - V12 = _mm_shuffle_ps(V13, D1, _MM_SHUFFLE(0, 3, 0, 2)); - XMVECTOR V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(0, 1, 0, 2)); - V13 = _mm_shuffle_ps(V13, D1, _MM_SHUFFLE(2, 1, 2, 1)); - - XMVECTOR C0 = _mm_mul_ps(V00, V10); - XMVECTOR C2 = _mm_mul_ps(V01, V11); - XMVECTOR C4 = _mm_mul_ps(V02, V12); - XMVECTOR C6 = _mm_mul_ps(V03, V13); - - // V11 = D0X,D0Y,D2X,D2X - V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(0, 0, 1, 0)); - V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(2, 1, 3, 2)); - V10 = _mm_shuffle_ps(D0, V11, _MM_SHUFFLE(2, 1, 0, 3)); - V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(1, 3, 2, 3)); - V11 = _mm_shuffle_ps(D0, V11, _MM_SHUFFLE(0, 2, 1, 2)); - // V13 = D1X,D1Y,D2Z,D2Z - V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(2, 2, 1, 0)); - V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(2, 1, 3, 2)); - V12 = _mm_shuffle_ps(D1, V13, _MM_SHUFFLE(2, 1, 0, 3)); - V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(1, 3, 2, 3)); - V13 = _mm_shuffle_ps(D1, V13, _MM_SHUFFLE(0, 2, 1, 2)); - - C0 = XM_FNMADD_PS(V00, V10, C0); - C2 = XM_FNMADD_PS(V01, V11, C2); - C4 = XM_FNMADD_PS(V02, V12, C4); - C6 = XM_FNMADD_PS(V03, V13, C6); - - V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(0, 3, 0, 3)); - // V10 = D0Z,D0Z,D2X,D2Y - V10 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 0, 2, 2)); - V10 = XM_PERMUTE_PS(V10, _MM_SHUFFLE(0, 2, 3, 0)); - V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(2, 0, 3, 1)); - // V11 = D0X,D0W,D2X,D2Y - V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 0, 3, 0)); - V11 = XM_PERMUTE_PS(V11, _MM_SHUFFLE(2, 1, 0, 3)); - V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(0, 3, 0, 3)); - // V12 = D1Z,D1Z,D2Z,D2W - V12 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 2, 2, 2)); - V12 = XM_PERMUTE_PS(V12, _MM_SHUFFLE(0, 2, 3, 0)); - V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(2, 0, 3, 1)); - // V13 = D1X,D1W,D2Z,D2W - V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 2, 3, 0)); - V13 = XM_PERMUTE_PS(V13, _MM_SHUFFLE(2, 1, 0, 3)); - - V00 = _mm_mul_ps(V00, V10); - V01 = _mm_mul_ps(V01, V11); - V02 = _mm_mul_ps(V02, V12); - V03 = _mm_mul_ps(V03, V13); - XMVECTOR C1 = _mm_sub_ps(C0, V00); - C0 = _mm_add_ps(C0, V00); - XMVECTOR C3 = _mm_add_ps(C2, V01); - C2 = _mm_sub_ps(C2, V01); - XMVECTOR C5 = _mm_sub_ps(C4, V02); - C4 = _mm_add_ps(C4, V02); - XMVECTOR C7 = _mm_add_ps(C6, V03); - C6 = _mm_sub_ps(C6, V03); - - C0 = _mm_shuffle_ps(C0, C1, _MM_SHUFFLE(3, 1, 2, 0)); - C2 = _mm_shuffle_ps(C2, C3, _MM_SHUFFLE(3, 1, 2, 0)); - C4 = _mm_shuffle_ps(C4, C5, _MM_SHUFFLE(3, 1, 2, 0)); - C6 = _mm_shuffle_ps(C6, C7, _MM_SHUFFLE(3, 1, 2, 0)); - C0 = XM_PERMUTE_PS(C0, _MM_SHUFFLE(3, 1, 2, 0)); - C2 = XM_PERMUTE_PS(C2, _MM_SHUFFLE(3, 1, 2, 0)); - C4 = XM_PERMUTE_PS(C4, _MM_SHUFFLE(3, 1, 2, 0)); - C6 = XM_PERMUTE_PS(C6, _MM_SHUFFLE(3, 1, 2, 0)); - // Get the determinant - XMVECTOR vTemp = XMVector4Dot(C0, MT.r[0]); - if (pDeterminant != nullptr) - *pDeterminant = vTemp; - vTemp = _mm_div_ps(g_XMOne, vTemp); - XMMATRIX mResult; - mResult.r[0] = _mm_mul_ps(C0, vTemp); - mResult.r[1] = _mm_mul_ps(C2, vTemp); - mResult.r[2] = _mm_mul_ps(C4, vTemp); - mResult.r[3] = _mm_mul_ps(C6, vTemp); - return mResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixVectorTensorProduct -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - XMMATRIX mResult; - mResult.r[0] = XMVectorMultiply(XMVectorSwizzle<0, 0, 0, 0>(V1), V2); - mResult.r[1] = XMVectorMultiply(XMVectorSwizzle<1, 1, 1, 1>(V1), V2); - mResult.r[2] = XMVectorMultiply(XMVectorSwizzle<2, 2, 2, 2>(V1), V2); - mResult.r[3] = XMVectorMultiply(XMVectorSwizzle<3, 3, 3, 3>(V1), V2); - return mResult; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMMatrixDeterminant(FXMMATRIX M) noexcept -{ - static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; - - XMVECTOR V0 = XMVectorSwizzle(M.r[2]); - XMVECTOR V1 = XMVectorSwizzle(M.r[3]); - XMVECTOR V2 = XMVectorSwizzle(M.r[2]); - XMVECTOR V3 = XMVectorSwizzle(M.r[3]); - XMVECTOR V4 = XMVectorSwizzle(M.r[2]); - XMVECTOR V5 = XMVectorSwizzle(M.r[3]); - - XMVECTOR P0 = XMVectorMultiply(V0, V1); - XMVECTOR P1 = XMVectorMultiply(V2, V3); - XMVECTOR P2 = XMVectorMultiply(V4, V5); - - V0 = XMVectorSwizzle(M.r[2]); - V1 = XMVectorSwizzle(M.r[3]); - V2 = XMVectorSwizzle(M.r[2]); - V3 = XMVectorSwizzle(M.r[3]); - V4 = XMVectorSwizzle(M.r[2]); - V5 = XMVectorSwizzle(M.r[3]); - - P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); - P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); - P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); - - V0 = XMVectorSwizzle(M.r[1]); - V1 = XMVectorSwizzle(M.r[1]); - V2 = XMVectorSwizzle(M.r[1]); - - XMVECTOR S = XMVectorMultiply(M.r[0], Sign.v); - XMVECTOR R = XMVectorMultiply(V0, P0); - R = XMVectorNegativeMultiplySubtract(V1, P1, R); - R = XMVectorMultiplyAdd(V2, P2, R); - - return XMVector4Dot(S, R); -} - -#define XM3RANKDECOMPOSE(a, b, c, x, y, z) \ - if((x) < (y)) \ - { \ - if((y) < (z)) \ - { \ - (a) = 2; \ - (b) = 1; \ - (c) = 0; \ - } \ - else \ - { \ - (a) = 1; \ - \ - if((x) < (z)) \ - { \ - (b) = 2; \ - (c) = 0; \ - } \ - else \ - { \ - (b) = 0; \ - (c) = 2; \ - } \ - } \ - } \ - else \ - { \ - if((x) < (z)) \ - { \ - (a) = 2; \ - (b) = 0; \ - (c) = 1; \ - } \ - else \ - { \ - (a) = 0; \ - \ - if((y) < (z)) \ - { \ - (b) = 2; \ - (c) = 1; \ - } \ - else \ - { \ - (b) = 1; \ - (c) = 2; \ - } \ - } \ - } - -#define XM3_DECOMP_EPSILON 0.0001f - -_Use_decl_annotations_ -inline bool XM_CALLCONV XMMatrixDecompose -( - XMVECTOR* outScale, - XMVECTOR* outRotQuat, - XMVECTOR* outTrans, - FXMMATRIX M -) noexcept -{ - static const XMVECTOR* pvCanonicalBasis[3] = { - &g_XMIdentityR0.v, - &g_XMIdentityR1.v, - &g_XMIdentityR2.v - }; - - assert(outScale != nullptr); - assert(outRotQuat != nullptr); - assert(outTrans != nullptr); - - // Get the translation - outTrans[0] = M.r[3]; - - XMVECTOR* ppvBasis[3]; - XMMATRIX matTemp; - ppvBasis[0] = &matTemp.r[0]; - ppvBasis[1] = &matTemp.r[1]; - ppvBasis[2] = &matTemp.r[2]; - - matTemp.r[0] = M.r[0]; - matTemp.r[1] = M.r[1]; - matTemp.r[2] = M.r[2]; - matTemp.r[3] = g_XMIdentityR3.v; - - auto pfScales = reinterpret_cast(outScale); - - size_t a, b, c; - XMVectorGetXPtr(&pfScales[0], XMVector3Length(ppvBasis[0][0])); - XMVectorGetXPtr(&pfScales[1], XMVector3Length(ppvBasis[1][0])); - XMVectorGetXPtr(&pfScales[2], XMVector3Length(ppvBasis[2][0])); - pfScales[3] = 0.f; - - XM3RANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2]) - - if (pfScales[a] < XM3_DECOMP_EPSILON) - { - ppvBasis[a][0] = pvCanonicalBasis[a][0]; - } - ppvBasis[a][0] = XMVector3Normalize(ppvBasis[a][0]); - - if (pfScales[b] < XM3_DECOMP_EPSILON) - { - size_t aa, bb, cc; - float fAbsX, fAbsY, fAbsZ; - - fAbsX = fabsf(XMVectorGetX(ppvBasis[a][0])); - fAbsY = fabsf(XMVectorGetY(ppvBasis[a][0])); - fAbsZ = fabsf(XMVectorGetZ(ppvBasis[a][0])); - - XM3RANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ) - - ppvBasis[b][0] = XMVector3Cross(ppvBasis[a][0], pvCanonicalBasis[cc][0]); - } - - ppvBasis[b][0] = XMVector3Normalize(ppvBasis[b][0]); - - if (pfScales[c] < XM3_DECOMP_EPSILON) - { - ppvBasis[c][0] = XMVector3Cross(ppvBasis[a][0], ppvBasis[b][0]); - } - - ppvBasis[c][0] = XMVector3Normalize(ppvBasis[c][0]); - - float fDet = XMVectorGetX(XMMatrixDeterminant(matTemp)); - - // use Kramer's rule to check for handedness of coordinate system - if (fDet < 0.0f) - { - // switch coordinate system by negating the scale and inverting the basis vector on the x-axis - pfScales[a] = -pfScales[a]; - ppvBasis[a][0] = XMVectorNegate(ppvBasis[a][0]); - - fDet = -fDet; - } - - fDet -= 1.0f; - fDet *= fDet; - - if (XM3_DECOMP_EPSILON < fDet) - { - // Non-SRT matrix encountered - return false; - } - - // generate the quaternion from the matrix - outRotQuat[0] = XMQuaternionRotationMatrix(matTemp); - return true; -} - -#undef XM3_DECOMP_EPSILON -#undef XM3RANKDECOMPOSE - -//------------------------------------------------------------------------------ -// Transformation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixIdentity() noexcept -{ - XMMATRIX M; - M.r[0] = g_XMIdentityR0.v; - M.r[1] = g_XMIdentityR1.v; - M.r[2] = g_XMIdentityR2.v; - M.r[3] = g_XMIdentityR3.v; - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixSet -( - float m00, float m01, float m02, float m03, - float m10, float m11, float m12, float m13, - float m20, float m21, float m22, float m23, - float m30, float m31, float m32, float m33 -) noexcept -{ - XMMATRIX M; -#if defined(_XM_NO_INTRINSICS_) - M.m[0][0] = m00; M.m[0][1] = m01; M.m[0][2] = m02; M.m[0][3] = m03; - M.m[1][0] = m10; M.m[1][1] = m11; M.m[1][2] = m12; M.m[1][3] = m13; - M.m[2][0] = m20; M.m[2][1] = m21; M.m[2][2] = m22; M.m[2][3] = m23; - M.m[3][0] = m30; M.m[3][1] = m31; M.m[3][2] = m32; M.m[3][3] = m33; -#else - M.r[0] = XMVectorSet(m00, m01, m02, m03); - M.r[1] = XMVectorSet(m10, m11, m12, m13); - M.r[2] = XMVectorSet(m20, m21, m22, m23); - M.r[3] = XMVectorSet(m30, m31, m32, m33); -#endif - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixTranslation -( - float OffsetX, - float OffsetY, - float OffsetZ -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.m[0][0] = 1.0f; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = 1.0f; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = 1.0f; - M.m[2][3] = 0.0f; - - M.m[3][0] = OffsetX; - M.m[3][1] = OffsetY; - M.m[3][2] = OffsetZ; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX M; - M.r[0] = g_XMIdentityR0.v; - M.r[1] = g_XMIdentityR1.v; - M.r[2] = g_XMIdentityR2.v; - M.r[3] = XMVectorSet(OffsetX, OffsetY, OffsetZ, 1.f); - return M; -#endif -} - - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(FXMVECTOR Offset) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.m[0][0] = 1.0f; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = 1.0f; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = 1.0f; - M.m[2][3] = 0.0f; - - M.m[3][0] = Offset.vector4_f32[0]; - M.m[3][1] = Offset.vector4_f32[1]; - M.m[3][2] = Offset.vector4_f32[2]; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX M; - M.r[0] = g_XMIdentityR0.v; - M.r[1] = g_XMIdentityR1.v; - M.r[2] = g_XMIdentityR2.v; - M.r[3] = XMVectorSelect(g_XMIdentityR3.v, Offset, g_XMSelect1110.v); - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixScaling -( - float ScaleX, - float ScaleY, - float ScaleZ -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.m[0][0] = ScaleX; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = ScaleY; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = ScaleZ; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - const XMVECTOR Zero = vdupq_n_f32(0); - XMMATRIX M; - M.r[0] = vsetq_lane_f32(ScaleX, Zero, 0); - M.r[1] = vsetq_lane_f32(ScaleY, Zero, 1); - M.r[2] = vsetq_lane_f32(ScaleZ, Zero, 2); - M.r[3] = g_XMIdentityR3.v; - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - M.r[0] = _mm_set_ps(0, 0, 0, ScaleX); - M.r[1] = _mm_set_ps(0, 0, ScaleY, 0); - M.r[2] = _mm_set_ps(0, ScaleZ, 0, 0); - M.r[3] = g_XMIdentityR3.v; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMMATRIX M; - M.m[0][0] = Scale.vector4_f32[0]; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = Scale.vector4_f32[1]; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = Scale.vector4_f32[2]; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX M; - M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskX)); - M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskY)); - M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskZ)); - M.r[3] = g_XMIdentityR3.v; - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - M.r[0] = _mm_and_ps(Scale, g_XMMaskX); - M.r[1] = _mm_and_ps(Scale, g_XMMaskY); - M.r[2] = _mm_and_ps(Scale, g_XMMaskZ); - M.r[3] = g_XMIdentityR3.v; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - XMMATRIX M; - M.m[0][0] = 1.0f; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = fCosAngle; - M.m[1][2] = fSinAngle; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = -fSinAngle; - M.m[2][2] = fCosAngle; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - const float32x4_t Zero = vdupq_n_f32(0); - - float32x4_t T1 = vsetq_lane_f32(fCosAngle, Zero, 1); - T1 = vsetq_lane_f32(fSinAngle, T1, 2); - - float32x4_t T2 = vsetq_lane_f32(-fSinAngle, Zero, 1); - T2 = vsetq_lane_f32(fCosAngle, T2, 2); - - XMMATRIX M; - M.r[0] = g_XMIdentityR0.v; - M.r[1] = T1; - M.r[2] = T2; - M.r[3] = g_XMIdentityR3.v; - return M; -#elif defined(_XM_SSE_INTRINSICS_) - float SinAngle; - float CosAngle; - XMScalarSinCos(&SinAngle, &CosAngle, Angle); - - XMVECTOR vSin = _mm_set_ss(SinAngle); - XMVECTOR vCos = _mm_set_ss(CosAngle); - // x = 0,y = cos,z = sin, w = 0 - vCos = _mm_shuffle_ps(vCos, vSin, _MM_SHUFFLE(3, 0, 0, 3)); - XMMATRIX M; - M.r[0] = g_XMIdentityR0; - M.r[1] = vCos; - // x = 0,y = sin,z = cos, w = 0 - vCos = XM_PERMUTE_PS(vCos, _MM_SHUFFLE(3, 1, 2, 0)); - // x = 0,y = -sin,z = cos, w = 0 - vCos = _mm_mul_ps(vCos, g_XMNegateY); - M.r[2] = vCos; - M.r[3] = g_XMIdentityR3; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - XMMATRIX M; - M.m[0][0] = fCosAngle; - M.m[0][1] = 0.0f; - M.m[0][2] = -fSinAngle; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = 1.0f; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = fSinAngle; - M.m[2][1] = 0.0f; - M.m[2][2] = fCosAngle; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - const float32x4_t Zero = vdupq_n_f32(0); - - float32x4_t T0 = vsetq_lane_f32(fCosAngle, Zero, 0); - T0 = vsetq_lane_f32(-fSinAngle, T0, 2); - - float32x4_t T2 = vsetq_lane_f32(fSinAngle, Zero, 0); - T2 = vsetq_lane_f32(fCosAngle, T2, 2); - - XMMATRIX M; - M.r[0] = T0; - M.r[1] = g_XMIdentityR1.v; - M.r[2] = T2; - M.r[3] = g_XMIdentityR3.v; - return M; -#elif defined(_XM_SSE_INTRINSICS_) - float SinAngle; - float CosAngle; - XMScalarSinCos(&SinAngle, &CosAngle, Angle); - - XMVECTOR vSin = _mm_set_ss(SinAngle); - XMVECTOR vCos = _mm_set_ss(CosAngle); - // x = sin,y = 0,z = cos, w = 0 - vSin = _mm_shuffle_ps(vSin, vCos, _MM_SHUFFLE(3, 0, 3, 0)); - XMMATRIX M; - M.r[2] = vSin; - M.r[1] = g_XMIdentityR1; - // x = cos,y = 0,z = sin, w = 0 - vSin = XM_PERMUTE_PS(vSin, _MM_SHUFFLE(3, 0, 1, 2)); - // x = cos,y = 0,z = -sin, w = 0 - vSin = _mm_mul_ps(vSin, g_XMNegateZ); - M.r[0] = vSin; - M.r[3] = g_XMIdentityR3; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - XMMATRIX M; - M.m[0][0] = fCosAngle; - M.m[0][1] = fSinAngle; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = -fSinAngle; - M.m[1][1] = fCosAngle; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = 1.0f; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - const float32x4_t Zero = vdupq_n_f32(0); - - float32x4_t T0 = vsetq_lane_f32(fCosAngle, Zero, 0); - T0 = vsetq_lane_f32(fSinAngle, T0, 1); - - float32x4_t T1 = vsetq_lane_f32(-fSinAngle, Zero, 0); - T1 = vsetq_lane_f32(fCosAngle, T1, 1); - - XMMATRIX M; - M.r[0] = T0; - M.r[1] = T1; - M.r[2] = g_XMIdentityR2.v; - M.r[3] = g_XMIdentityR3.v; - return M; -#elif defined(_XM_SSE_INTRINSICS_) - float SinAngle; - float CosAngle; - XMScalarSinCos(&SinAngle, &CosAngle, Angle); - - XMVECTOR vSin = _mm_set_ss(SinAngle); - XMVECTOR vCos = _mm_set_ss(CosAngle); - // x = cos,y = sin,z = 0, w = 0 - vCos = _mm_unpacklo_ps(vCos, vSin); - XMMATRIX M; - M.r[0] = vCos; - // x = sin,y = cos,z = 0, w = 0 - vCos = XM_PERMUTE_PS(vCos, _MM_SHUFFLE(3, 2, 0, 1)); - // x = cos,y = -sin,z = 0, w = 0 - vCos = _mm_mul_ps(vCos, g_XMNegateX); - M.r[1] = vCos; - M.r[2] = g_XMIdentityR2; - M.r[3] = g_XMIdentityR3; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw -( - float Pitch, - float Yaw, - float Roll -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float cp = cosf(Pitch); - float sp = sinf(Pitch); - - float cy = cosf(Yaw); - float sy = sinf(Yaw); - - float cr = cosf(Roll); - float sr = sinf(Roll); - - XMMATRIX M; - M.m[0][0] = cr * cy + sr * sp * sy; - M.m[0][1] = sr * cp; - M.m[0][2] = sr * sp * cy - cr * sy; - M.m[0][3] = 0.0f; - - M.m[1][0] = cr * sp * sy - sr * cy; - M.m[1][1] = cr * cp; - M.m[1][2] = sr * sy + cr * sp * cy; - M.m[1][3] = 0.0f; - - M.m[2][0] = cp * sy; - M.m[2][1] = -sp; - M.m[2][2] = cp * cy; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; -#else - XMVECTOR Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); - return XMMatrixRotationRollPitchYawFromVector(Angles); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYawFromVector -( - FXMVECTOR Angles // -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float cp = cosf(Angles.vector4_f32[0]); - float sp = sinf(Angles.vector4_f32[0]); - - float cy = cosf(Angles.vector4_f32[1]); - float sy = sinf(Angles.vector4_f32[1]); - - float cr = cosf(Angles.vector4_f32[2]); - float sr = sinf(Angles.vector4_f32[2]); - - XMMATRIX M; - M.m[0][0] = cr * cy + sr * sp * sy; - M.m[0][1] = sr * cp; - M.m[0][2] = sr * sp * cy - cr * sy; - M.m[0][3] = 0.0f; - - M.m[1][0] = cr * sp * sy - sr * cy; - M.m[1][1] = cr * cp; - M.m[1][2] = sr * sy + cr * sp * cy; - M.m[1][3] = 0.0f; - - M.m[2][0] = cp * sy; - M.m[2][1] = -sp; - M.m[2][2] = cp * cy; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = 0.0f; - M.m[3][3] = 1.0f; - return M; -#else - static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, -1.0f, 1.0f } } }; - - XMVECTOR SinAngles, CosAngles; - XMVectorSinCos(&SinAngles, &CosAngles, Angles); - - XMVECTOR P0 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR Y0 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR P1 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR Y1 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR P2 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR P3 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR Y2 = XMVectorSplatX(SinAngles); - XMVECTOR NS = XMVectorNegate(SinAngles); - - XMVECTOR Q0 = XMVectorMultiply(P0, Y0); - XMVECTOR Q1 = XMVectorMultiply(P1, Sign.v); - Q1 = XMVectorMultiply(Q1, Y1); - XMVECTOR Q2 = XMVectorMultiply(P2, Y2); - Q2 = XMVectorMultiplyAdd(Q2, P3, Q1); - - XMVECTOR V0 = XMVectorPermute(Q0, Q2); - XMVECTOR V1 = XMVectorPermute(Q0, Q2); - XMVECTOR V2 = XMVectorPermute(Q0, NS); - - XMMATRIX M; - M.r[0] = XMVectorSelect(g_XMZero, V0, g_XMSelect1110.v); - M.r[1] = XMVectorSelect(g_XMZero, V1, g_XMSelect1110.v); - M.r[2] = XMVectorSelect(g_XMZero, V2, g_XMSelect1110.v); - M.r[3] = g_XMIdentityR3; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationNormal -( - FXMVECTOR NormalAxis, - float Angle -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - XMVECTOR A = XMVectorSet(fSinAngle, fCosAngle, 1.0f - fCosAngle, 0.0f); - - XMVECTOR C2 = XMVectorSplatZ(A); - XMVECTOR C1 = XMVectorSplatY(A); - XMVECTOR C0 = XMVectorSplatX(A); - - XMVECTOR N0 = XMVectorSwizzle(NormalAxis); - XMVECTOR N1 = XMVectorSwizzle(NormalAxis); - - XMVECTOR V0 = XMVectorMultiply(C2, N0); - V0 = XMVectorMultiply(V0, N1); - - XMVECTOR R0 = XMVectorMultiply(C2, NormalAxis); - R0 = XMVectorMultiplyAdd(R0, NormalAxis, C1); - - XMVECTOR R1 = XMVectorMultiplyAdd(C0, NormalAxis, V0); - XMVECTOR R2 = XMVectorNegativeMultiplySubtract(C0, NormalAxis, V0); - - V0 = XMVectorSelect(A, R0, g_XMSelect1110.v); - XMVECTOR V1 = XMVectorPermute(R1, R2); - XMVECTOR V2 = XMVectorPermute(R1, R2); - - XMMATRIX M; - M.r[0] = XMVectorPermute(V0, V1); - M.r[1] = XMVectorPermute(V0, V1); - M.r[2] = XMVectorPermute(V0, V2); - M.r[3] = g_XMIdentityR3.v; - return M; - -#elif defined(_XM_SSE_INTRINSICS_) - float fSinAngle; - float fCosAngle; - XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); - - XMVECTOR C2 = _mm_set_ps1(1.0f - fCosAngle); - XMVECTOR C1 = _mm_set_ps1(fCosAngle); - XMVECTOR C0 = _mm_set_ps1(fSinAngle); - - XMVECTOR N0 = XM_PERMUTE_PS(NormalAxis, _MM_SHUFFLE(3, 0, 2, 1)); - XMVECTOR N1 = XM_PERMUTE_PS(NormalAxis, _MM_SHUFFLE(3, 1, 0, 2)); - - XMVECTOR V0 = _mm_mul_ps(C2, N0); - V0 = _mm_mul_ps(V0, N1); - - XMVECTOR R0 = _mm_mul_ps(C2, NormalAxis); - R0 = _mm_mul_ps(R0, NormalAxis); - R0 = _mm_add_ps(R0, C1); - - XMVECTOR R1 = _mm_mul_ps(C0, NormalAxis); - R1 = _mm_add_ps(R1, V0); - XMVECTOR R2 = _mm_mul_ps(C0, NormalAxis); - R2 = _mm_sub_ps(V0, R2); - - V0 = _mm_and_ps(R0, g_XMMask3); - XMVECTOR V1 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(2, 1, 2, 0)); - V1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 3, 2, 1)); - XMVECTOR V2 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(0, 0, 1, 1)); - V2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 0, 2, 0)); - - R2 = _mm_shuffle_ps(V0, V1, _MM_SHUFFLE(1, 0, 3, 0)); - R2 = XM_PERMUTE_PS(R2, _MM_SHUFFLE(1, 3, 2, 0)); - - XMMATRIX M; - M.r[0] = R2; - - R2 = _mm_shuffle_ps(V0, V1, _MM_SHUFFLE(3, 2, 3, 1)); - R2 = XM_PERMUTE_PS(R2, _MM_SHUFFLE(1, 3, 0, 2)); - M.r[1] = R2; - - V2 = _mm_shuffle_ps(V2, V0, _MM_SHUFFLE(3, 2, 1, 0)); - M.r[2] = V2; - M.r[3] = g_XMIdentityR3.v; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationAxis -( - FXMVECTOR Axis, - float Angle -) noexcept -{ - assert(!XMVector3Equal(Axis, XMVectorZero())); - assert(!XMVector3IsInfinite(Axis)); - - XMVECTOR Normal = XMVector3Normalize(Axis); - return XMMatrixRotationNormal(Normal, Angle); -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixRotationQuaternion(FXMVECTOR Quaternion) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - float qx = Quaternion.vector4_f32[0]; - float qxx = qx * qx; - - float qy = Quaternion.vector4_f32[1]; - float qyy = qy * qy; - - float qz = Quaternion.vector4_f32[2]; - float qzz = qz * qz; - - float qw = Quaternion.vector4_f32[3]; - - XMMATRIX M; - M.m[0][0] = 1.f - 2.f * qyy - 2.f * qzz; - M.m[0][1] = 2.f * qx * qy + 2.f * qz * qw; - M.m[0][2] = 2.f * qx * qz - 2.f * qy * qw; - M.m[0][3] = 0.f; - - M.m[1][0] = 2.f * qx * qy - 2.f * qz * qw; - M.m[1][1] = 1.f - 2.f * qxx - 2.f * qzz; - M.m[1][2] = 2.f * qy * qz + 2.f * qx * qw; - M.m[1][3] = 0.f; - - M.m[2][0] = 2.f * qx * qz + 2.f * qy * qw; - M.m[2][1] = 2.f * qy * qz - 2.f * qx * qw; - M.m[2][2] = 1.f - 2.f * qxx - 2.f * qyy; - M.m[2][3] = 0.f; - - M.m[3][0] = 0.f; - M.m[3][1] = 0.f; - M.m[3][2] = 0.f; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Constant1110 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; - - XMVECTOR Q0 = XMVectorAdd(Quaternion, Quaternion); - XMVECTOR Q1 = XMVectorMultiply(Quaternion, Q0); - - XMVECTOR V0 = XMVectorPermute(Q1, Constant1110.v); - XMVECTOR V1 = XMVectorPermute(Q1, Constant1110.v); - XMVECTOR R0 = XMVectorSubtract(Constant1110, V0); - R0 = XMVectorSubtract(R0, V1); - - V0 = XMVectorSwizzle(Quaternion); - V1 = XMVectorSwizzle(Q0); - V0 = XMVectorMultiply(V0, V1); - - V1 = XMVectorSplatW(Quaternion); - XMVECTOR V2 = XMVectorSwizzle(Q0); - V1 = XMVectorMultiply(V1, V2); - - XMVECTOR R1 = XMVectorAdd(V0, V1); - XMVECTOR R2 = XMVectorSubtract(V0, V1); - - V0 = XMVectorPermute(R1, R2); - V1 = XMVectorPermute(R1, R2); - - XMMATRIX M; - M.r[0] = XMVectorPermute(R0, V0); - M.r[1] = XMVectorPermute(R0, V0); - M.r[2] = XMVectorPermute(R0, V1); - M.r[3] = g_XMIdentityR3.v; - return M; - -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Constant1110 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; - - XMVECTOR Q0 = _mm_add_ps(Quaternion, Quaternion); - XMVECTOR Q1 = _mm_mul_ps(Quaternion, Q0); - - XMVECTOR V0 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(3, 0, 0, 1)); - V0 = _mm_and_ps(V0, g_XMMask3); - XMVECTOR V1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(3, 1, 2, 2)); - V1 = _mm_and_ps(V1, g_XMMask3); - XMVECTOR R0 = _mm_sub_ps(Constant1110, V0); - R0 = _mm_sub_ps(R0, V1); - - V0 = XM_PERMUTE_PS(Quaternion, _MM_SHUFFLE(3, 1, 0, 0)); - V1 = XM_PERMUTE_PS(Q0, _MM_SHUFFLE(3, 2, 1, 2)); - V0 = _mm_mul_ps(V0, V1); - - V1 = XM_PERMUTE_PS(Quaternion, _MM_SHUFFLE(3, 3, 3, 3)); - XMVECTOR V2 = XM_PERMUTE_PS(Q0, _MM_SHUFFLE(3, 0, 2, 1)); - V1 = _mm_mul_ps(V1, V2); - - XMVECTOR R1 = _mm_add_ps(V0, V1); - XMVECTOR R2 = _mm_sub_ps(V0, V1); - - V0 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(1, 0, 2, 1)); - V0 = XM_PERMUTE_PS(V0, _MM_SHUFFLE(1, 3, 2, 0)); - V1 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(2, 2, 0, 0)); - V1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 0, 2, 0)); - - Q1 = _mm_shuffle_ps(R0, V0, _MM_SHUFFLE(1, 0, 3, 0)); - Q1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(1, 3, 2, 0)); - - XMMATRIX M; - M.r[0] = Q1; - - Q1 = _mm_shuffle_ps(R0, V0, _MM_SHUFFLE(3, 2, 3, 1)); - Q1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(1, 3, 0, 2)); - M.r[1] = Q1; - - Q1 = _mm_shuffle_ps(V1, R0, _MM_SHUFFLE(3, 2, 1, 0)); - M.r[2] = Q1; - M.r[3] = g_XMIdentityR3; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixTransformation2D -( - FXMVECTOR ScalingOrigin, - float ScalingOrientation, - FXMVECTOR Scaling, - FXMVECTOR RotationOrigin, - float Rotation, - GXMVECTOR Translation -) noexcept -{ - // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * - // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; - - XMVECTOR VScalingOrigin = XMVectorSelect(g_XMSelect1100.v, ScalingOrigin, g_XMSelect1100.v); - XMVECTOR NegScalingOrigin = XMVectorNegate(VScalingOrigin); - - XMMATRIX MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); - XMMATRIX MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); - XMMATRIX MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); - XMVECTOR VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); - XMMATRIX MScaling = XMMatrixScalingFromVector(VScaling); - XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); - XMMATRIX MRotation = XMMatrixRotationZ(Rotation); - XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation, g_XMSelect1100.v); - - XMMATRIX M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); - M = XMMatrixMultiply(M, MScaling); - M = XMMatrixMultiply(M, MScalingOrientation); - M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); - M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); - M = XMMatrixMultiply(M, MRotation); - M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); - M.r[3] = XMVectorAdd(M.r[3], VTranslation); - - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixTransformation -( - FXMVECTOR ScalingOrigin, - FXMVECTOR ScalingOrientationQuaternion, - FXMVECTOR Scaling, - GXMVECTOR RotationOrigin, - HXMVECTOR RotationQuaternion, - HXMVECTOR Translation -) noexcept -{ - // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * - // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; - - XMVECTOR VScalingOrigin = XMVectorSelect(g_XMSelect1110.v, ScalingOrigin, g_XMSelect1110.v); - XMVECTOR NegScalingOrigin = XMVectorNegate(ScalingOrigin); - - XMMATRIX MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); - XMMATRIX MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); - XMMATRIX MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); - XMMATRIX MScaling = XMMatrixScalingFromVector(Scaling); - XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); - XMMATRIX MRotation = XMMatrixRotationQuaternion(RotationQuaternion); - XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); - - XMMATRIX M; - M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); - M = XMMatrixMultiply(M, MScaling); - M = XMMatrixMultiply(M, MScalingOrientation); - M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); - M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); - M = XMMatrixMultiply(M, MRotation); - M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); - M.r[3] = XMVectorAdd(M.r[3], VTranslation); - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixAffineTransformation2D -( - FXMVECTOR Scaling, - FXMVECTOR RotationOrigin, - float Rotation, - FXMVECTOR Translation -) noexcept -{ - // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; - - XMVECTOR VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); - XMMATRIX MScaling = XMMatrixScalingFromVector(VScaling); - XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); - XMMATRIX MRotation = XMMatrixRotationZ(Rotation); - XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation, g_XMSelect1100.v); - - XMMATRIX M; - M = MScaling; - M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); - M = XMMatrixMultiply(M, MRotation); - M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); - M.r[3] = XMVectorAdd(M.r[3], VTranslation); - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixAffineTransformation -( - FXMVECTOR Scaling, - FXMVECTOR RotationOrigin, - FXMVECTOR RotationQuaternion, - GXMVECTOR Translation -) noexcept -{ - // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; - - XMMATRIX MScaling = XMMatrixScalingFromVector(Scaling); - XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); - XMMATRIX MRotation = XMMatrixRotationQuaternion(RotationQuaternion); - XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); - - XMMATRIX M; - M = MScaling; - M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); - M = XMMatrixMultiply(M, MRotation); - M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); - M.r[3] = XMVectorAdd(M.r[3], VTranslation); - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixReflect(FXMVECTOR ReflectionPlane) noexcept -{ - assert(!XMVector3Equal(ReflectionPlane, XMVectorZero())); - assert(!XMPlaneIsInfinite(ReflectionPlane)); - - static const XMVECTORF32 NegativeTwo = { { { -2.0f, -2.0f, -2.0f, 0.0f } } }; - - XMVECTOR P = XMPlaneNormalize(ReflectionPlane); - XMVECTOR S = XMVectorMultiply(P, NegativeTwo); - - XMVECTOR A = XMVectorSplatX(P); - XMVECTOR B = XMVectorSplatY(P); - XMVECTOR C = XMVectorSplatZ(P); - XMVECTOR D = XMVectorSplatW(P); - - XMMATRIX M; - M.r[0] = XMVectorMultiplyAdd(A, S, g_XMIdentityR0.v); - M.r[1] = XMVectorMultiplyAdd(B, S, g_XMIdentityR1.v); - M.r[2] = XMVectorMultiplyAdd(C, S, g_XMIdentityR2.v); - M.r[3] = XMVectorMultiplyAdd(D, S, g_XMIdentityR3.v); - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixShadow -( - FXMVECTOR ShadowPlane, - FXMVECTOR LightPosition -) noexcept -{ - static const XMVECTORU32 Select0001 = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_0, XM_SELECT_1 } } }; - - assert(!XMVector3Equal(ShadowPlane, XMVectorZero())); - assert(!XMPlaneIsInfinite(ShadowPlane)); - - XMVECTOR P = XMPlaneNormalize(ShadowPlane); - XMVECTOR Dot = XMPlaneDot(P, LightPosition); - P = XMVectorNegate(P); - XMVECTOR D = XMVectorSplatW(P); - XMVECTOR C = XMVectorSplatZ(P); - XMVECTOR B = XMVectorSplatY(P); - XMVECTOR A = XMVectorSplatX(P); - Dot = XMVectorSelect(Select0001.v, Dot, Select0001.v); - - XMMATRIX M; - M.r[3] = XMVectorMultiplyAdd(D, LightPosition, Dot); - Dot = XMVectorRotateLeft(Dot, 1); - M.r[2] = XMVectorMultiplyAdd(C, LightPosition, Dot); - Dot = XMVectorRotateLeft(Dot, 1); - M.r[1] = XMVectorMultiplyAdd(B, LightPosition, Dot); - Dot = XMVectorRotateLeft(Dot, 1); - M.r[0] = XMVectorMultiplyAdd(A, LightPosition, Dot); - return M; -} - -//------------------------------------------------------------------------------ -// View and projection initialization operations -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixLookAtLH -( - FXMVECTOR EyePosition, - FXMVECTOR FocusPosition, - FXMVECTOR UpDirection -) noexcept -{ - XMVECTOR EyeDirection = XMVectorSubtract(FocusPosition, EyePosition); - return XMMatrixLookToLH(EyePosition, EyeDirection, UpDirection); -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixLookAtRH -( - FXMVECTOR EyePosition, - FXMVECTOR FocusPosition, - FXMVECTOR UpDirection -) noexcept -{ - XMVECTOR NegEyeDirection = XMVectorSubtract(EyePosition, FocusPosition); - return XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixLookToLH -( - FXMVECTOR EyePosition, - FXMVECTOR EyeDirection, - FXMVECTOR UpDirection -) noexcept -{ - assert(!XMVector3Equal(EyeDirection, XMVectorZero())); - assert(!XMVector3IsInfinite(EyeDirection)); - assert(!XMVector3Equal(UpDirection, XMVectorZero())); - assert(!XMVector3IsInfinite(UpDirection)); - - XMVECTOR R2 = XMVector3Normalize(EyeDirection); - - XMVECTOR R0 = XMVector3Cross(UpDirection, R2); - R0 = XMVector3Normalize(R0); - - XMVECTOR R1 = XMVector3Cross(R2, R0); - - XMVECTOR NegEyePosition = XMVectorNegate(EyePosition); - - XMVECTOR D0 = XMVector3Dot(R0, NegEyePosition); - XMVECTOR D1 = XMVector3Dot(R1, NegEyePosition); - XMVECTOR D2 = XMVector3Dot(R2, NegEyePosition); - - XMMATRIX M; - M.r[0] = XMVectorSelect(D0, R0, g_XMSelect1110.v); - M.r[1] = XMVectorSelect(D1, R1, g_XMSelect1110.v); - M.r[2] = XMVectorSelect(D2, R2, g_XMSelect1110.v); - M.r[3] = g_XMIdentityR3.v; - - M = XMMatrixTranspose(M); - - return M; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixLookToRH -( - FXMVECTOR EyePosition, - FXMVECTOR EyeDirection, - FXMVECTOR UpDirection -) noexcept -{ - XMVECTOR NegEyeDirection = XMVectorNegate(EyeDirection); - return XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); -} - -//------------------------------------------------------------------------------ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable:28931, "PREfast noise: Esp:1266") -#endif - -inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveLH -( - float ViewWidth, - float ViewHeight, - float NearZ, - float FarZ -) noexcept -{ - assert(NearZ > 0.f && FarZ > 0.f); - assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float TwoNearZ = NearZ + NearZ; - float fRange = FarZ / (FarZ - NearZ); - - XMMATRIX M; - M.m[0][0] = TwoNearZ / ViewWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = TwoNearZ / ViewHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = 1.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = -fRange * NearZ; - M.m[3][3] = 0.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float TwoNearZ = NearZ + NearZ; - float fRange = FarZ / (FarZ - NearZ); - const float32x4_t Zero = vdupq_n_f32(0); - XMMATRIX M; - M.r[0] = vsetq_lane_f32(TwoNearZ / ViewWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(TwoNearZ / ViewHeight, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, g_XMIdentityR3.v, 2); - M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float TwoNearZ = NearZ + NearZ; - float fRange = FarZ / (FarZ - NearZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - TwoNearZ / ViewWidth, - TwoNearZ / ViewHeight, - fRange, - -fRange * NearZ - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // TwoNearZ / ViewWidth,0,0,0 - M.r[0] = vTemp; - // 0,TwoNearZ / ViewHeight,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // x=fRange,y=-fRange * NearZ,0,1.0f - vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); - // 0,0,fRange,1.0f - vTemp = _mm_setzero_ps(); - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); - M.r[2] = vTemp; - // 0,0,-fRange * NearZ,0 - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); - M.r[3] = vTemp; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveRH -( - float ViewWidth, - float ViewHeight, - float NearZ, - float FarZ -) noexcept -{ - assert(NearZ > 0.f && FarZ > 0.f); - assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float TwoNearZ = NearZ + NearZ; - float fRange = FarZ / (NearZ - FarZ); - - XMMATRIX M; - M.m[0][0] = TwoNearZ / ViewWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = TwoNearZ / ViewHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = -1.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = fRange * NearZ; - M.m[3][3] = 0.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float TwoNearZ = NearZ + NearZ; - float fRange = FarZ / (NearZ - FarZ); - const float32x4_t Zero = vdupq_n_f32(0); - - XMMATRIX M; - M.r[0] = vsetq_lane_f32(TwoNearZ / ViewWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(TwoNearZ / ViewHeight, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, g_XMNegIdentityR3.v, 2); - M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float TwoNearZ = NearZ + NearZ; - float fRange = FarZ / (NearZ - FarZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - TwoNearZ / ViewWidth, - TwoNearZ / ViewHeight, - fRange, - fRange * NearZ - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // TwoNearZ / ViewWidth,0,0,0 - M.r[0] = vTemp; - // 0,TwoNearZ / ViewHeight,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // x=fRange,y=-fRange * NearZ,0,-1.0f - vValues = _mm_shuffle_ps(vValues, g_XMNegIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); - // 0,0,fRange,-1.0f - vTemp = _mm_setzero_ps(); - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); - M.r[2] = vTemp; - // 0,0,-fRange * NearZ,0 - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); - M.r[3] = vTemp; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovLH -( - float FovAngleY, - float AspectRatio, - float NearZ, - float FarZ -) noexcept -{ - assert(NearZ > 0.f && FarZ > 0.f); - assert(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); - assert(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float SinFov; - float CosFov; - XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - - float Height = CosFov / SinFov; - float Width = Height / AspectRatio; - float fRange = FarZ / (FarZ - NearZ); - - XMMATRIX M; - M.m[0][0] = Width; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = Height; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = 1.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = -fRange * NearZ; - M.m[3][3] = 0.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float SinFov; - float CosFov; - XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - - float fRange = FarZ / (FarZ - NearZ); - float Height = CosFov / SinFov; - float Width = Height / AspectRatio; - const float32x4_t Zero = vdupq_n_f32(0); - - XMMATRIX M; - M.r[0] = vsetq_lane_f32(Width, Zero, 0); - M.r[1] = vsetq_lane_f32(Height, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, g_XMIdentityR3.v, 2); - M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - float SinFov; - float CosFov; - XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - - float fRange = FarZ / (FarZ - NearZ); - // Note: This is recorded on the stack - float Height = CosFov / SinFov; - XMVECTOR rMem = { - Height / AspectRatio, - Height, - fRange, - -fRange * NearZ - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // Height / AspectRatio,0,0,0 - XMMATRIX M; - M.r[0] = vTemp; - // 0,Height,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // x=fRange,y=-fRange * NearZ,0,1.0f - vTemp = _mm_setzero_ps(); - vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); - // 0,0,fRange,1.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); - M.r[2] = vTemp; - // 0,0,-fRange * NearZ,0.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); - M.r[3] = vTemp; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovRH -( - float FovAngleY, - float AspectRatio, - float NearZ, - float FarZ -) noexcept -{ - assert(NearZ > 0.f && FarZ > 0.f); - assert(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); - assert(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float SinFov; - float CosFov; - XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - - float Height = CosFov / SinFov; - float Width = Height / AspectRatio; - float fRange = FarZ / (NearZ - FarZ); - - XMMATRIX M; - M.m[0][0] = Width; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = Height; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = -1.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = fRange * NearZ; - M.m[3][3] = 0.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float SinFov; - float CosFov; - XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - float fRange = FarZ / (NearZ - FarZ); - float Height = CosFov / SinFov; - float Width = Height / AspectRatio; - const float32x4_t Zero = vdupq_n_f32(0); - - XMMATRIX M; - M.r[0] = vsetq_lane_f32(Width, Zero, 0); - M.r[1] = vsetq_lane_f32(Height, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, g_XMNegIdentityR3.v, 2); - M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - float SinFov; - float CosFov; - XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - float fRange = FarZ / (NearZ - FarZ); - // Note: This is recorded on the stack - float Height = CosFov / SinFov; - XMVECTOR rMem = { - Height / AspectRatio, - Height, - fRange, - fRange * NearZ - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // Height / AspectRatio,0,0,0 - XMMATRIX M; - M.r[0] = vTemp; - // 0,Height,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // x=fRange,y=-fRange * NearZ,0,-1.0f - vTemp = _mm_setzero_ps(); - vValues = _mm_shuffle_ps(vValues, g_XMNegIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); - // 0,0,fRange,-1.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); - M.r[2] = vTemp; - // 0,0,fRange * NearZ,0.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); - M.r[3] = vTemp; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterLH -( - float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, - float NearZ, - float FarZ -) noexcept -{ - assert(NearZ > 0.f && FarZ > 0.f); - assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); - assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float TwoNearZ = NearZ + NearZ; - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = FarZ / (FarZ - NearZ); - - XMMATRIX M; - M.m[0][0] = TwoNearZ * ReciprocalWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = TwoNearZ * ReciprocalHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; - M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; - M.m[2][2] = fRange; - M.m[2][3] = 1.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = -fRange * NearZ; - M.m[3][3] = 0.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float TwoNearZ = NearZ + NearZ; - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = FarZ / (FarZ - NearZ); - const float32x4_t Zero = vdupq_n_f32(0); - - XMMATRIX M; - M.r[0] = vsetq_lane_f32(TwoNearZ * ReciprocalWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(TwoNearZ * ReciprocalHeight, Zero, 1); - M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, - -(ViewTop + ViewBottom) * ReciprocalHeight, - fRange, - 1.0f); - M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float TwoNearZ = NearZ + NearZ; - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = FarZ / (FarZ - NearZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - TwoNearZ * ReciprocalWidth, - TwoNearZ * ReciprocalHeight, - -fRange * NearZ, - 0 - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // TwoNearZ*ReciprocalWidth,0,0,0 - M.r[0] = vTemp; - // 0,TwoNearZ*ReciprocalHeight,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // 0,0,fRange,1.0f - M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, - -(ViewTop + ViewBottom) * ReciprocalHeight, - fRange, - 1.0f); - // 0,0,-fRange * NearZ,0.0f - vValues = _mm_and_ps(vValues, g_XMMaskZ); - M.r[3] = vValues; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterRH -( - float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, - float NearZ, - float FarZ -) noexcept -{ - assert(NearZ > 0.f && FarZ > 0.f); - assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); - assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float TwoNearZ = NearZ + NearZ; - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = FarZ / (NearZ - FarZ); - - XMMATRIX M; - M.m[0][0] = TwoNearZ * ReciprocalWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = TwoNearZ * ReciprocalHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth; - M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight; - M.m[2][2] = fRange; - M.m[2][3] = -1.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = fRange * NearZ; - M.m[3][3] = 0.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float TwoNearZ = NearZ + NearZ; - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = FarZ / (NearZ - FarZ); - const float32x4_t Zero = vdupq_n_f32(0); - - XMMATRIX M; - M.r[0] = vsetq_lane_f32(TwoNearZ * ReciprocalWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(TwoNearZ * ReciprocalHeight, Zero, 1); - M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, - (ViewTop + ViewBottom) * ReciprocalHeight, - fRange, - -1.0f); - M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float TwoNearZ = NearZ + NearZ; - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = FarZ / (NearZ - FarZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - TwoNearZ * ReciprocalWidth, - TwoNearZ * ReciprocalHeight, - fRange * NearZ, - 0 - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // TwoNearZ*ReciprocalWidth,0,0,0 - M.r[0] = vTemp; - // 0,TwoNearZ*ReciprocalHeight,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // 0,0,fRange,1.0f - M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, - (ViewTop + ViewBottom) * ReciprocalHeight, - fRange, - -1.0f); - // 0,0,-fRange * NearZ,0.0f - vValues = _mm_and_ps(vValues, g_XMMaskZ); - M.r[3] = vValues; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixOrthographicLH -( - float ViewWidth, - float ViewHeight, - float NearZ, - float FarZ -) noexcept -{ - assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float fRange = 1.0f / (FarZ - NearZ); - - XMMATRIX M; - M.m[0][0] = 2.0f / ViewWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = 2.0f / ViewHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = -fRange * NearZ; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fRange = 1.0f / (FarZ - NearZ); - - const float32x4_t Zero = vdupq_n_f32(0); - XMMATRIX M; - M.r[0] = vsetq_lane_f32(2.0f / ViewWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(2.0f / ViewHeight, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, Zero, 2); - M.r[3] = vsetq_lane_f32(-fRange * NearZ, g_XMIdentityR3.v, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float fRange = 1.0f / (FarZ - NearZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - 2.0f / ViewWidth, - 2.0f / ViewHeight, - fRange, - -fRange * NearZ - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // 2.0f / ViewWidth,0,0,0 - M.r[0] = vTemp; - // 0,2.0f / ViewHeight,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // x=fRange,y=-fRange * NearZ,0,1.0f - vTemp = _mm_setzero_ps(); - vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); - // 0,0,fRange,0.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 0, 0, 0)); - M.r[2] = vTemp; - // 0,0,-fRange * NearZ,1.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 1, 0, 0)); - M.r[3] = vTemp; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixOrthographicRH -( - float ViewWidth, - float ViewHeight, - float NearZ, - float FarZ -) noexcept -{ - assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float fRange = 1.0f / (NearZ - FarZ); - - XMMATRIX M; - M.m[0][0] = 2.0f / ViewWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = 2.0f / ViewHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = 0.0f; - - M.m[3][0] = 0.0f; - M.m[3][1] = 0.0f; - M.m[3][2] = fRange * NearZ; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float fRange = 1.0f / (NearZ - FarZ); - - const float32x4_t Zero = vdupq_n_f32(0); - XMMATRIX M; - M.r[0] = vsetq_lane_f32(2.0f / ViewWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(2.0f / ViewHeight, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, Zero, 2); - M.r[3] = vsetq_lane_f32(fRange * NearZ, g_XMIdentityR3.v, 2); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float fRange = 1.0f / (NearZ - FarZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - 2.0f / ViewWidth, - 2.0f / ViewHeight, - fRange, - fRange * NearZ - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // 2.0f / ViewWidth,0,0,0 - M.r[0] = vTemp; - // 0,2.0f / ViewHeight,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - M.r[1] = vTemp; - // x=fRange,y=fRange * NearZ,0,1.0f - vTemp = _mm_setzero_ps(); - vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); - // 0,0,fRange,0.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 0, 0, 0)); - M.r[2] = vTemp; - // 0,0,fRange * NearZ,1.0f - vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 1, 0, 0)); - M.r[3] = vTemp; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterLH -( - float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, - float NearZ, - float FarZ -) noexcept -{ - assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); - assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = 1.0f / (FarZ - NearZ); - - XMMATRIX M; - M.m[0][0] = ReciprocalWidth + ReciprocalWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = ReciprocalHeight + ReciprocalHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = 0.0f; - - M.m[3][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; - M.m[3][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; - M.m[3][2] = -fRange * NearZ; - M.m[3][3] = 1.0f; - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = 1.0f / (FarZ - NearZ); - const float32x4_t Zero = vdupq_n_f32(0); - XMMATRIX M; - M.r[0] = vsetq_lane_f32(ReciprocalWidth + ReciprocalWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(ReciprocalHeight + ReciprocalHeight, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, Zero, 2); - M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, - -(ViewTop + ViewBottom) * ReciprocalHeight, - -fRange * NearZ, - 1.0f); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = 1.0f / (FarZ - NearZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - fReciprocalWidth, - fReciprocalHeight, - fRange, - 1.0f - }; - XMVECTOR rMem2 = { - -(ViewLeft + ViewRight), - -(ViewTop + ViewBottom), - -NearZ, - 1.0f - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // fReciprocalWidth*2,0,0,0 - vTemp = _mm_add_ss(vTemp, vTemp); - M.r[0] = vTemp; - // 0,fReciprocalHeight*2,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - vTemp = _mm_add_ps(vTemp, vTemp); - M.r[1] = vTemp; - // 0,0,fRange,0.0f - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskZ); - M.r[2] = vTemp; - // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f - vValues = _mm_mul_ps(vValues, rMem2); - M.r[3] = vValues; - return M; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterRH -( - float ViewLeft, - float ViewRight, - float ViewBottom, - float ViewTop, - float NearZ, - float FarZ -) noexcept -{ - assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); - assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); - assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); - -#if defined(_XM_NO_INTRINSICS_) - - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = 1.0f / (NearZ - FarZ); - - XMMATRIX M; - M.m[0][0] = ReciprocalWidth + ReciprocalWidth; - M.m[0][1] = 0.0f; - M.m[0][2] = 0.0f; - M.m[0][3] = 0.0f; - - M.m[1][0] = 0.0f; - M.m[1][1] = ReciprocalHeight + ReciprocalHeight; - M.m[1][2] = 0.0f; - M.m[1][3] = 0.0f; - - M.m[2][0] = 0.0f; - M.m[2][1] = 0.0f; - M.m[2][2] = fRange; - M.m[2][3] = 0.0f; - - M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, - -(ViewTop + ViewBottom) * ReciprocalHeight, - fRange * NearZ, - 1.0f); - return M; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = 1.0f / (NearZ - FarZ); - const float32x4_t Zero = vdupq_n_f32(0); - XMMATRIX M; - M.r[0] = vsetq_lane_f32(ReciprocalWidth + ReciprocalWidth, Zero, 0); - M.r[1] = vsetq_lane_f32(ReciprocalHeight + ReciprocalHeight, Zero, 1); - M.r[2] = vsetq_lane_f32(fRange, Zero, 2); - M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, - -(ViewTop + ViewBottom) * ReciprocalHeight, - fRange * NearZ, - 1.0f); - return M; -#elif defined(_XM_SSE_INTRINSICS_) - XMMATRIX M; - float fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); - float fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); - float fRange = 1.0f / (NearZ - FarZ); - // Note: This is recorded on the stack - XMVECTOR rMem = { - fReciprocalWidth, - fReciprocalHeight, - fRange, - 1.0f - }; - XMVECTOR rMem2 = { - -(ViewLeft + ViewRight), - -(ViewTop + ViewBottom), - NearZ, - 1.0f - }; - // Copy from memory to SSE register - XMVECTOR vValues = rMem; - XMVECTOR vTemp = _mm_setzero_ps(); - // Copy x only - vTemp = _mm_move_ss(vTemp, vValues); - // fReciprocalWidth*2,0,0,0 - vTemp = _mm_add_ss(vTemp, vTemp); - M.r[0] = vTemp; - // 0,fReciprocalHeight*2,0,0 - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskY); - vTemp = _mm_add_ps(vTemp, vTemp); - M.r[1] = vTemp; - // 0,0,fRange,0.0f - vTemp = vValues; - vTemp = _mm_and_ps(vTemp, g_XMMaskZ); - M.r[2] = vTemp; - // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f - vValues = _mm_mul_ps(vValues, rMem2); - M.r[3] = vValues; - return M; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -/**************************************************************************** - * - * XMMATRIX operators and methods - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMMATRIX::XMMATRIX -( - float m00, float m01, float m02, float m03, - float m10, float m11, float m12, float m13, - float m20, float m21, float m22, float m23, - float m30, float m31, float m32, float m33 -) noexcept -{ - r[0] = XMVectorSet(m00, m01, m02, m03); - r[1] = XMVectorSet(m10, m11, m12, m13); - r[2] = XMVectorSet(m20, m21, m22, m23); - r[3] = XMVectorSet(m30, m31, m32, m33); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMMATRIX::XMMATRIX(const float* pArray) noexcept -{ - assert(pArray != nullptr); - r[0] = XMLoadFloat4(reinterpret_cast(pArray)); - r[1] = XMLoadFloat4(reinterpret_cast(pArray + 4)); - r[2] = XMLoadFloat4(reinterpret_cast(pArray + 8)); - r[3] = XMLoadFloat4(reinterpret_cast(pArray + 12)); -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XMMATRIX::operator- () const noexcept -{ - XMMATRIX R; - R.r[0] = XMVectorNegate(r[0]); - R.r[1] = XMVectorNegate(r[1]); - R.r[2] = XMVectorNegate(r[2]); - R.r[3] = XMVectorNegate(r[3]); - return R; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX& XM_CALLCONV XMMATRIX::operator+= (FXMMATRIX M) noexcept -{ - r[0] = XMVectorAdd(r[0], M.r[0]); - r[1] = XMVectorAdd(r[1], M.r[1]); - r[2] = XMVectorAdd(r[2], M.r[2]); - r[3] = XMVectorAdd(r[3], M.r[3]); - return *this; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX& XM_CALLCONV XMMATRIX::operator-= (FXMMATRIX M) noexcept -{ - r[0] = XMVectorSubtract(r[0], M.r[0]); - r[1] = XMVectorSubtract(r[1], M.r[1]); - r[2] = XMVectorSubtract(r[2], M.r[2]); - r[3] = XMVectorSubtract(r[3], M.r[3]); - return *this; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX& XM_CALLCONV XMMATRIX::operator*=(FXMMATRIX M) noexcept -{ - *this = XMMatrixMultiply(*this, M); - return *this; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX& XMMATRIX::operator*= (float S) noexcept -{ - r[0] = XMVectorScale(r[0], S); - r[1] = XMVectorScale(r[1], S); - r[2] = XMVectorScale(r[2], S); - r[3] = XMVectorScale(r[3], S); - return *this; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX& XMMATRIX::operator/= (float S) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR vS = XMVectorReplicate(S); - r[0] = XMVectorDivide(r[0], vS); - r[1] = XMVectorDivide(r[1], vS); - r[2] = XMVectorDivide(r[2], vS); - r[3] = XMVectorDivide(r[3], vS); - return *this; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - float32x4_t vS = vdupq_n_f32(S); - r[0] = vdivq_f32(r[0], vS); - r[1] = vdivq_f32(r[1], vS); - r[2] = vdivq_f32(r[2], vS); - r[3] = vdivq_f32(r[3], vS); -#else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x2_t vS = vdup_n_f32(S); - float32x2_t R0 = vrecpe_f32(vS); - float32x2_t S0 = vrecps_f32(R0, vS); - R0 = vmul_f32(S0, R0); - S0 = vrecps_f32(R0, vS); - R0 = vmul_f32(S0, R0); - float32x4_t Reciprocal = vcombine_f32(R0, R0); - r[0] = vmulq_f32(r[0], Reciprocal); - r[1] = vmulq_f32(r[1], Reciprocal); - r[2] = vmulq_f32(r[2], Reciprocal); - r[3] = vmulq_f32(r[3], Reciprocal); -#endif - return *this; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 vS = _mm_set_ps1(S); - r[0] = _mm_div_ps(r[0], vS); - r[1] = _mm_div_ps(r[1], vS); - r[2] = _mm_div_ps(r[2], vS); - r[3] = _mm_div_ps(r[3], vS); - return *this; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMATRIX::operator+ (FXMMATRIX M) const noexcept -{ - XMMATRIX R; - R.r[0] = XMVectorAdd(r[0], M.r[0]); - R.r[1] = XMVectorAdd(r[1], M.r[1]); - R.r[2] = XMVectorAdd(r[2], M.r[2]); - R.r[3] = XMVectorAdd(r[3], M.r[3]); - return R; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMATRIX::operator- (FXMMATRIX M) const noexcept -{ - XMMATRIX R; - R.r[0] = XMVectorSubtract(r[0], M.r[0]); - R.r[1] = XMVectorSubtract(r[1], M.r[1]); - R.r[2] = XMVectorSubtract(r[2], M.r[2]); - R.r[3] = XMVectorSubtract(r[3], M.r[3]); - return R; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV XMMATRIX::operator*(FXMMATRIX M) const noexcept -{ - return XMMatrixMultiply(*this, M); -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XMMATRIX::operator* (float S) const noexcept -{ - XMMATRIX R; - R.r[0] = XMVectorScale(r[0], S); - R.r[1] = XMVectorScale(r[1], S); - R.r[2] = XMVectorScale(r[2], S); - R.r[3] = XMVectorScale(r[3], S); - return R; -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XMMATRIX::operator/ (float S) const noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR vS = XMVectorReplicate(S); - XMMATRIX R; - R.r[0] = XMVectorDivide(r[0], vS); - R.r[1] = XMVectorDivide(r[1], vS); - R.r[2] = XMVectorDivide(r[2], vS); - R.r[3] = XMVectorDivide(r[3], vS); - return R; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - float32x4_t vS = vdupq_n_f32(S); - XMMATRIX R; - R.r[0] = vdivq_f32(r[0], vS); - R.r[1] = vdivq_f32(r[1], vS); - R.r[2] = vdivq_f32(r[2], vS); - R.r[3] = vdivq_f32(r[3], vS); -#else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x2_t vS = vdup_n_f32(S); - float32x2_t R0 = vrecpe_f32(vS); - float32x2_t S0 = vrecps_f32(R0, vS); - R0 = vmul_f32(S0, R0); - S0 = vrecps_f32(R0, vS); - R0 = vmul_f32(S0, R0); - float32x4_t Reciprocal = vcombine_f32(R0, R0); - XMMATRIX R; - R.r[0] = vmulq_f32(r[0], Reciprocal); - R.r[1] = vmulq_f32(r[1], Reciprocal); - R.r[2] = vmulq_f32(r[2], Reciprocal); - R.r[3] = vmulq_f32(r[3], Reciprocal); -#endif - return R; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 vS = _mm_set_ps1(S); - XMMATRIX R; - R.r[0] = _mm_div_ps(r[0], vS); - R.r[1] = _mm_div_ps(r[1], vS); - R.r[2] = _mm_div_ps(r[2], vS); - R.r[3] = _mm_div_ps(r[3], vS); - return R; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMMATRIX XM_CALLCONV operator* -( - float S, - FXMMATRIX M - ) noexcept -{ - XMMATRIX R; - R.r[0] = XMVectorScale(M.r[0], S); - R.r[1] = XMVectorScale(M.r[1], S); - R.r[2] = XMVectorScale(M.r[2], S); - R.r[3] = XMVectorScale(M.r[3], S); - return R; -} - -/**************************************************************************** - * - * XMFLOAT3X3 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMFLOAT3X3::XMFLOAT3X3(const float* pArray) noexcept -{ - assert(pArray != nullptr); - for (size_t Row = 0; Row < 3; Row++) - { - for (size_t Column = 0; Column < 3; Column++) - { - m[Row][Column] = pArray[Row * 3 + Column]; - } - } -} - -/**************************************************************************** - * - * XMFLOAT4X3 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMFLOAT4X3::XMFLOAT4X3(const float* pArray) noexcept -{ - assert(pArray != nullptr); - - m[0][0] = pArray[0]; - m[0][1] = pArray[1]; - m[0][2] = pArray[2]; - - m[1][0] = pArray[3]; - m[1][1] = pArray[4]; - m[1][2] = pArray[5]; - - m[2][0] = pArray[6]; - m[2][1] = pArray[7]; - m[2][2] = pArray[8]; - - m[3][0] = pArray[9]; - m[3][1] = pArray[10]; - m[3][2] = pArray[11]; -} - -/**************************************************************************** -* -* XMFLOAT3X4 operators -* -****************************************************************************/ - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMFLOAT3X4::XMFLOAT3X4(const float* pArray) noexcept -{ - assert(pArray != nullptr); - - m[0][0] = pArray[0]; - m[0][1] = pArray[1]; - m[0][2] = pArray[2]; - m[0][3] = pArray[3]; - - m[1][0] = pArray[4]; - m[1][1] = pArray[5]; - m[1][2] = pArray[6]; - m[1][3] = pArray[7]; - - m[2][0] = pArray[8]; - m[2][1] = pArray[9]; - m[2][2] = pArray[10]; - m[2][3] = pArray[11]; -} - -/**************************************************************************** - * - * XMFLOAT4X4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMFLOAT4X4::XMFLOAT4X4(const float* pArray) noexcept -{ - assert(pArray != nullptr); - - m[0][0] = pArray[0]; - m[0][1] = pArray[1]; - m[0][2] = pArray[2]; - m[0][3] = pArray[3]; - - m[1][0] = pArray[4]; - m[1][1] = pArray[5]; - m[1][2] = pArray[6]; - m[1][3] = pArray[7]; - - m[2][0] = pArray[8]; - m[2][1] = pArray[9]; - m[2][2] = pArray[10]; - m[2][3] = pArray[11]; - - m[3][0] = pArray[12]; - m[3][1] = pArray[13]; - m[3][2] = pArray[14]; - m[3][3] = pArray[15]; -} - +//------------------------------------------------------------------------------------- +// DirectXMathMatrix.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Matrix + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +// Return true if any entry in the matrix is NaN +inline bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + size_t i = 16; + auto pWork = reinterpret_cast(&M.m[0][0]); + do + { + // Fetch value into integer unit + uint32_t uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // NaN is 0x7F800001 through 0x7FFFFFFF inclusive + uTest -= 0x7F800001U; + if (uTest < 0x007FFFFFU) + { + break; // NaN found + } + ++pWork; // Next entry + } + while (--i); + return (i != 0); // i == 0 if nothing matched +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Load in registers + float32x4_t vX = M.r[0]; + float32x4_t vY = M.r[1]; + float32x4_t vZ = M.r[2]; + float32x4_t vW = M.r[3]; + // Test themselves to check for NaN + uint32x4_t xmask = vmvnq_u32(vceqq_f32(vX, vX)); + uint32x4_t ymask = vmvnq_u32(vceqq_f32(vY, vY)); + uint32x4_t zmask = vmvnq_u32(vceqq_f32(vZ, vZ)); + uint32x4_t wmask = vmvnq_u32(vceqq_f32(vW, vW)); + // Or all the results + xmask = vorrq_u32(xmask, zmask); + ymask = vorrq_u32(ymask, wmask); + xmask = vorrq_u32(xmask, ymask); + // If any tested true, return true + uint8x8x2_t vTemp = vzip_u8( + vget_low_u8(vreinterpretq_u8_u32(xmask)), + vget_high_u8(vreinterpretq_u8_u32(xmask))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + return (r != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Load in registers + XMVECTOR vX = M.r[0]; + XMVECTOR vY = M.r[1]; + XMVECTOR vZ = M.r[2]; + XMVECTOR vW = M.r[3]; + // Test themselves to check for NaN + vX = _mm_cmpneq_ps(vX, vX); + vY = _mm_cmpneq_ps(vY, vY); + vZ = _mm_cmpneq_ps(vZ, vZ); + vW = _mm_cmpneq_ps(vW, vW); + // Or all the results + vX = _mm_or_ps(vX, vZ); + vY = _mm_or_ps(vY, vW); + vX = _mm_or_ps(vX, vY); + // If any tested true, return true + return (_mm_movemask_ps(vX) != 0); +#else +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +// Return true if any entry in the matrix is +/-INF +inline bool XM_CALLCONV XMMatrixIsInfinite(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + size_t i = 16; + auto pWork = reinterpret_cast(&M.m[0][0]); + do + { + // Fetch value into integer unit + uint32_t uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // INF is 0x7F800000 + if (uTest == 0x7F800000U) + { + break; // INF found + } + ++pWork; // Next entry + } + while (--i); + return (i != 0); // i == 0 if nothing matched +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Load in registers + float32x4_t vX = M.r[0]; + float32x4_t vY = M.r[1]; + float32x4_t vZ = M.r[2]; + float32x4_t vW = M.r[3]; + // Mask off the sign bits + vX = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vX), g_XMAbsMask)); + vY = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vY), g_XMAbsMask)); + vZ = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vZ), g_XMAbsMask)); + vW = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vW), g_XMAbsMask)); + // Compare to infinity + uint32x4_t xmask = vceqq_f32(vX, g_XMInfinity); + uint32x4_t ymask = vceqq_f32(vY, g_XMInfinity); + uint32x4_t zmask = vceqq_f32(vZ, g_XMInfinity); + uint32x4_t wmask = vceqq_f32(vW, g_XMInfinity); + // Or the answers together + xmask = vorrq_u32(xmask, zmask); + ymask = vorrq_u32(ymask, wmask); + xmask = vorrq_u32(xmask, ymask); + // If any tested true, return true + uint8x8x2_t vTemp = vzip_u8( + vget_low_u8(vreinterpretq_u8_u32(xmask)), + vget_high_u8(vreinterpretq_u8_u32(xmask))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + return (r != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bits + XMVECTOR vTemp1 = _mm_and_ps(M.r[0], g_XMAbsMask); + XMVECTOR vTemp2 = _mm_and_ps(M.r[1], g_XMAbsMask); + XMVECTOR vTemp3 = _mm_and_ps(M.r[2], g_XMAbsMask); + XMVECTOR vTemp4 = _mm_and_ps(M.r[3], g_XMAbsMask); + // Compare to infinity + vTemp1 = _mm_cmpeq_ps(vTemp1, g_XMInfinity); + vTemp2 = _mm_cmpeq_ps(vTemp2, g_XMInfinity); + vTemp3 = _mm_cmpeq_ps(vTemp3, g_XMInfinity); + vTemp4 = _mm_cmpeq_ps(vTemp4, g_XMInfinity); + // Or the answers together + vTemp1 = _mm_or_ps(vTemp1, vTemp2); + vTemp3 = _mm_or_ps(vTemp3, vTemp4); + vTemp1 = _mm_or_ps(vTemp1, vTemp3); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp1) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +// Return true if the XMMatrix is equal to identity +inline bool XM_CALLCONV XMMatrixIsIdentity(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + // Use the integer pipeline to reduce branching to a minimum + auto pWork = reinterpret_cast(&M.m[0][0]); + // Convert 1.0f to zero and or them together + uint32_t uOne = pWork[0] ^ 0x3F800000U; + // Or all the 0.0f entries together + uint32_t uZero = pWork[1]; + uZero |= pWork[2]; + uZero |= pWork[3]; + // 2nd row + uZero |= pWork[4]; + uOne |= pWork[5] ^ 0x3F800000U; + uZero |= pWork[6]; + uZero |= pWork[7]; + // 3rd row + uZero |= pWork[8]; + uZero |= pWork[9]; + uOne |= pWork[10] ^ 0x3F800000U; + uZero |= pWork[11]; + // 4th row + uZero |= pWork[12]; + uZero |= pWork[13]; + uZero |= pWork[14]; + uOne |= pWork[15] ^ 0x3F800000U; + // If all zero entries are zero, the uZero==0 + uZero &= 0x7FFFFFFF; // Allow -0.0f + // If all 1.0f entries are 1.0f, then uOne==0 + uOne |= uZero; + return (uOne == 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t xmask = vceqq_f32(M.r[0], g_XMIdentityR0); + uint32x4_t ymask = vceqq_f32(M.r[1], g_XMIdentityR1); + uint32x4_t zmask = vceqq_f32(M.r[2], g_XMIdentityR2); + uint32x4_t wmask = vceqq_f32(M.r[3], g_XMIdentityR3); + xmask = vandq_u32(xmask, zmask); + ymask = vandq_u32(ymask, wmask); + xmask = vandq_u32(xmask, ymask); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(xmask)), vget_high_u8(vreinterpretq_u8_u32(xmask))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + return (r == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_cmpeq_ps(M.r[0], g_XMIdentityR0); + XMVECTOR vTemp2 = _mm_cmpeq_ps(M.r[1], g_XMIdentityR1); + XMVECTOR vTemp3 = _mm_cmpeq_ps(M.r[2], g_XMIdentityR2); + XMVECTOR vTemp4 = _mm_cmpeq_ps(M.r[3], g_XMIdentityR3); + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + vTemp3 = _mm_and_ps(vTemp3, vTemp4); + vTemp1 = _mm_and_ps(vTemp1, vTemp3); + return (_mm_movemask_ps(vTemp1) == 0x0f); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Perform a 4x4 matrix multiply by a 4x4 matrix +inline XMMATRIX XM_CALLCONV XMMatrixMultiply +( + FXMMATRIX M1, + CXMMATRIX M2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M1.m[0][0]; + float y = M1.m[0][1]; + float z = M1.m[0][2]; + float w = M1.m[0][3]; + // Perform the operation on the first row + mResult.m[0][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[0][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[0][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[0][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + // Repeat for all the other rows + x = M1.m[1][0]; + y = M1.m[1][1]; + z = M1.m[1][2]; + w = M1.m[1][3]; + mResult.m[1][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[1][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[1][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[1][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + x = M1.m[2][0]; + y = M1.m[2][1]; + z = M1.m[2][2]; + w = M1.m[2][3]; + mResult.m[2][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[2][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[2][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[2][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + x = M1.m[3][0]; + y = M1.m[3][1]; + z = M1.m[3][2]; + w = M1.m[3][3]; + mResult.m[3][0] = (M2.m[0][0] * x) + (M2.m[1][0] * y) + (M2.m[2][0] * z) + (M2.m[3][0] * w); + mResult.m[3][1] = (M2.m[0][1] * x) + (M2.m[1][1] * y) + (M2.m[2][1] * z) + (M2.m[3][1] * w); + mResult.m[3][2] = (M2.m[0][2] * x) + (M2.m[1][2] * y) + (M2.m[2][2] * z) + (M2.m[3][2] * w); + mResult.m[3][3] = (M2.m[0][3] * x) + (M2.m[1][3] * y) + (M2.m[2][3] * z) + (M2.m[3][3] * w); + return mResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX mResult; + float32x2_t VL = vget_low_f32(M1.r[0]); + float32x2_t VH = vget_high_f32(M1.r[0]); + // Perform the operation on the first row + float32x4_t vX = vmulq_lane_f32(M2.r[0], VL, 0); + float32x4_t vY = vmulq_lane_f32(M2.r[1], VL, 1); + float32x4_t vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + float32x4_t vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[0] = vaddq_f32(vZ, vW); + // Repeat for the other 3 rows + VL = vget_low_f32(M1.r[1]); + VH = vget_high_f32(M1.r[1]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[1] = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[2]); + VH = vget_high_f32(M1.r[2]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[2] = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[3]); + VH = vget_high_f32(M1.r[3]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + mResult.r[3] = vaddq_f32(vZ, vW); + return mResult; +#elif defined(_XM_AVX2_INTRINSICS_) + __m256 t0 = _mm256_castps128_ps256(M1.r[0]); + t0 = _mm256_insertf128_ps(t0, M1.r[1], 1); + __m256 t1 = _mm256_castps128_ps256(M1.r[2]); + t1 = _mm256_insertf128_ps(t1, M1.r[3], 1); + + __m256 u0 = _mm256_castps128_ps256(M2.r[0]); + u0 = _mm256_insertf128_ps(u0, M2.r[1], 1); + __m256 u1 = _mm256_castps128_ps256(M2.r[2]); + u1 = _mm256_insertf128_ps(u1, M2.r[3], 1); + + __m256 a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 b0 = _mm256_permute2f128_ps(u0, u0, 0x00); + __m256 c0 = _mm256_mul_ps(a0, b0); + __m256 c1 = _mm256_mul_ps(a1, b0); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(1, 1, 1, 1)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(1, 1, 1, 1)); + b0 = _mm256_permute2f128_ps(u0, u0, 0x11); + __m256 c2 = _mm256_fmadd_ps(a0, b0, c0); + __m256 c3 = _mm256_fmadd_ps(a1, b0, c1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(2, 2, 2, 2)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 b1 = _mm256_permute2f128_ps(u1, u1, 0x00); + __m256 c4 = _mm256_mul_ps(a0, b1); + __m256 c5 = _mm256_mul_ps(a1, b1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(3, 3, 3, 3)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(3, 3, 3, 3)); + b1 = _mm256_permute2f128_ps(u1, u1, 0x11); + __m256 c6 = _mm256_fmadd_ps(a0, b1, c4); + __m256 c7 = _mm256_fmadd_ps(a1, b1, c5); + + t0 = _mm256_add_ps(c2, c6); + t1 = _mm256_add_ps(c3, c7); + + XMMATRIX mResult; + mResult.r[0] = _mm256_castps256_ps128(t0); + mResult.r[1] = _mm256_extractf128_ps(t0, 1); + mResult.r[2] = _mm256_castps256_ps128(t1); + mResult.r[3] = _mm256_extractf128_ps(t1, 1); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX mResult; + // Splat the component X,Y,Z then W +#if defined(_XM_AVX_INTRINSICS_) + XMVECTOR vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 0); + XMVECTOR vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 1); + XMVECTOR vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 2); + XMVECTOR vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 3); +#else + // Use vW to hold the original row + XMVECTOR vW = M1.r[0]; + XMVECTOR vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + // Perform the operation on the first row + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + // Perform a binary add to reduce cumulative errors + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[0] = vX; + // Repeat for the other 3 rows +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 3); +#else + vW = M1.r[1]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[1] = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 3); +#else + vW = M1.r[2]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[2] = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 3); +#else + vW = M1.r[3]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + mResult.r[3] = vX; + return mResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose +( + FXMMATRIX M1, + CXMMATRIX M2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M2.m[0][0]; + float y = M2.m[1][0]; + float z = M2.m[2][0]; + float w = M2.m[3][0]; + // Perform the operation on the first row + mResult.m[0][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[0][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[0][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[0][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + // Repeat for all the other rows + x = M2.m[0][1]; + y = M2.m[1][1]; + z = M2.m[2][1]; + w = M2.m[3][1]; + mResult.m[1][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[1][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[1][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[1][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + x = M2.m[0][2]; + y = M2.m[1][2]; + z = M2.m[2][2]; + w = M2.m[3][2]; + mResult.m[2][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[2][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[2][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[2][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + x = M2.m[0][3]; + y = M2.m[1][3]; + z = M2.m[2][3]; + w = M2.m[3][3]; + mResult.m[3][0] = (M1.m[0][0] * x) + (M1.m[0][1] * y) + (M1.m[0][2] * z) + (M1.m[0][3] * w); + mResult.m[3][1] = (M1.m[1][0] * x) + (M1.m[1][1] * y) + (M1.m[1][2] * z) + (M1.m[1][3] * w); + mResult.m[3][2] = (M1.m[2][0] * x) + (M1.m[2][1] * y) + (M1.m[2][2] * z) + (M1.m[2][3] * w); + mResult.m[3][3] = (M1.m[3][0] * x) + (M1.m[3][1] * y) + (M1.m[3][2] * z) + (M1.m[3][3] * w); + return mResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(M1.r[0]); + float32x2_t VH = vget_high_f32(M1.r[0]); + // Perform the operation on the first row + float32x4_t vX = vmulq_lane_f32(M2.r[0], VL, 0); + float32x4_t vY = vmulq_lane_f32(M2.r[1], VL, 1); + float32x4_t vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + float32x4_t vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r0 = vaddq_f32(vZ, vW); + // Repeat for the other 3 rows + VL = vget_low_f32(M1.r[1]); + VH = vget_high_f32(M1.r[1]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r1 = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[2]); + VH = vget_high_f32(M1.r[2]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r2 = vaddq_f32(vZ, vW); + VL = vget_low_f32(M1.r[3]); + VH = vget_high_f32(M1.r[3]); + vX = vmulq_lane_f32(M2.r[0], VL, 0); + vY = vmulq_lane_f32(M2.r[1], VL, 1); + vZ = vmlaq_lane_f32(vX, M2.r[2], VH, 0); + vW = vmlaq_lane_f32(vY, M2.r[3], VH, 1); + float32x4_t r3 = vaddq_f32(vZ, vW); + + // Transpose result + float32x4x2_t P0 = vzipq_f32(r0, r2); + float32x4x2_t P1 = vzipq_f32(r1, r3); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + + XMMATRIX mResult; + mResult.r[0] = T0.val[0]; + mResult.r[1] = T0.val[1]; + mResult.r[2] = T1.val[0]; + mResult.r[3] = T1.val[1]; + return mResult; +#elif defined(_XM_AVX2_INTRINSICS_) + __m256 t0 = _mm256_castps128_ps256(M1.r[0]); + t0 = _mm256_insertf128_ps(t0, M1.r[1], 1); + __m256 t1 = _mm256_castps128_ps256(M1.r[2]); + t1 = _mm256_insertf128_ps(t1, M1.r[3], 1); + + __m256 u0 = _mm256_castps128_ps256(M2.r[0]); + u0 = _mm256_insertf128_ps(u0, M2.r[1], 1); + __m256 u1 = _mm256_castps128_ps256(M2.r[2]); + u1 = _mm256_insertf128_ps(u1, M2.r[3], 1); + + __m256 a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 b0 = _mm256_permute2f128_ps(u0, u0, 0x00); + __m256 c0 = _mm256_mul_ps(a0, b0); + __m256 c1 = _mm256_mul_ps(a1, b0); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(1, 1, 1, 1)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(1, 1, 1, 1)); + b0 = _mm256_permute2f128_ps(u0, u0, 0x11); + __m256 c2 = _mm256_fmadd_ps(a0, b0, c0); + __m256 c3 = _mm256_fmadd_ps(a1, b0, c1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(2, 2, 2, 2)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 b1 = _mm256_permute2f128_ps(u1, u1, 0x00); + __m256 c4 = _mm256_mul_ps(a0, b1); + __m256 c5 = _mm256_mul_ps(a1, b1); + + a0 = _mm256_shuffle_ps(t0, t0, _MM_SHUFFLE(3, 3, 3, 3)); + a1 = _mm256_shuffle_ps(t1, t1, _MM_SHUFFLE(3, 3, 3, 3)); + b1 = _mm256_permute2f128_ps(u1, u1, 0x11); + __m256 c6 = _mm256_fmadd_ps(a0, b1, c4); + __m256 c7 = _mm256_fmadd_ps(a1, b1, c5); + + t0 = _mm256_add_ps(c2, c6); + t1 = _mm256_add_ps(c3, c7); + + // Transpose result + __m256 vTemp = _mm256_unpacklo_ps(t0, t1); + __m256 vTemp2 = _mm256_unpackhi_ps(t0, t1); + __m256 vTemp3 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + __m256 vTemp4 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + vTemp = _mm256_unpacklo_ps(vTemp3, vTemp4); + vTemp2 = _mm256_unpackhi_ps(vTemp3, vTemp4); + t0 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + t1 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + + XMMATRIX mResult; + mResult.r[0] = _mm256_castps256_ps128(t0); + mResult.r[1] = _mm256_extractf128_ps(t0, 1); + mResult.r[2] = _mm256_castps256_ps128(t1); + mResult.r[3] = _mm256_extractf128_ps(t1, 1); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the component X,Y,Z then W +#if defined(_XM_AVX_INTRINSICS_) + XMVECTOR vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 0); + XMVECTOR vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 1); + XMVECTOR vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 2); + XMVECTOR vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[0]) + 3); +#else + // Use vW to hold the original row + XMVECTOR vW = M1.r[0]; + XMVECTOR vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + // Perform the operation on the first row + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + // Perform a binary add to reduce cumulative errors + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r0 = vX; + // Repeat for the other 3 rows +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[1]) + 3); +#else + vW = M1.r[1]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r1 = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[2]) + 3); +#else + vW = M1.r[2]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r2 = vX; +#if defined(_XM_AVX_INTRINSICS_) + vX = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 0); + vY = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 1); + vZ = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 2); + vW = _mm_broadcast_ss(reinterpret_cast(&M1.r[3]) + 3); +#else + vW = M1.r[3]; + vX = XM_PERMUTE_PS(vW, _MM_SHUFFLE(0, 0, 0, 0)); + vY = XM_PERMUTE_PS(vW, _MM_SHUFFLE(1, 1, 1, 1)); + vZ = XM_PERMUTE_PS(vW, _MM_SHUFFLE(2, 2, 2, 2)); + vW = XM_PERMUTE_PS(vW, _MM_SHUFFLE(3, 3, 3, 3)); +#endif + vX = _mm_mul_ps(vX, M2.r[0]); + vY = _mm_mul_ps(vY, M2.r[1]); + vZ = _mm_mul_ps(vZ, M2.r[2]); + vW = _mm_mul_ps(vW, M2.r[3]); + vX = _mm_add_ps(vX, vZ); + vY = _mm_add_ps(vY, vW); + vX = _mm_add_ps(vX, vY); + XMVECTOR r3 = vX; + + // Transpose result + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(r2, r3, _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(r2, r3, _MM_SHUFFLE(3, 2, 3, 2)); + + XMMATRIX mResult; + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTranspose(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + // Original matrix: + // + // m00m01m02m03 + // m10m11m12m13 + // m20m21m22m23 + // m30m31m32m33 + + XMMATRIX P; + P.r[0] = XMVectorMergeXY(M.r[0], M.r[2]); // m00m20m01m21 + P.r[1] = XMVectorMergeXY(M.r[1], M.r[3]); // m10m30m11m31 + P.r[2] = XMVectorMergeZW(M.r[0], M.r[2]); // m02m22m03m23 + P.r[3] = XMVectorMergeZW(M.r[1], M.r[3]); // m12m32m13m33 + + XMMATRIX MT; + MT.r[0] = XMVectorMergeXY(P.r[0], P.r[1]); // m00m10m20m30 + MT.r[1] = XMVectorMergeZW(P.r[0], P.r[1]); // m01m11m21m31 + MT.r[2] = XMVectorMergeXY(P.r[2], P.r[3]); // m02m12m22m32 + MT.r[3] = XMVectorMergeZW(P.r[2], P.r[3]); // m03m13m23m33 + return MT; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4x2_t P0 = vzipq_f32(M.r[0], M.r[2]); + float32x4x2_t P1 = vzipq_f32(M.r[1], M.r[3]); + + float32x4x2_t T0 = vzipq_f32(P0.val[0], P1.val[0]); + float32x4x2_t T1 = vzipq_f32(P0.val[1], P1.val[1]); + + XMMATRIX mResult; + mResult.r[0] = T0.val[0]; + mResult.r[1] = T0.val[1]; + mResult.r[2] = T1.val[0]; + mResult.r[3] = T1.val[1]; + return mResult; +#elif defined(_XM_AVX2_INTRINSICS_) + __m256 t0 = _mm256_castps128_ps256(M.r[0]); + t0 = _mm256_insertf128_ps(t0, M.r[1], 1); + __m256 t1 = _mm256_castps128_ps256(M.r[2]); + t1 = _mm256_insertf128_ps(t1, M.r[3], 1); + + __m256 vTemp = _mm256_unpacklo_ps(t0, t1); + __m256 vTemp2 = _mm256_unpackhi_ps(t0, t1); + __m256 vTemp3 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + __m256 vTemp4 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + vTemp = _mm256_unpacklo_ps(vTemp3, vTemp4); + vTemp2 = _mm256_unpackhi_ps(vTemp3, vTemp4); + t0 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x20); + t1 = _mm256_permute2f128_ps(vTemp, vTemp2, 0x31); + + XMMATRIX mResult; + mResult.r[0] = _mm256_castps256_ps128(t0); + mResult.r[1] = _mm256_extractf128_ps(t0, 1); + mResult.r[2] = _mm256_castps256_ps128(t1); + mResult.r[3] = _mm256_extractf128_ps(t1, 1); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + XMMATRIX mResult; + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ +// Return the inverse and the determinant of a 4x4 matrix +_Use_decl_annotations_ +inline XMMATRIX XM_CALLCONV XMMatrixInverse +( + XMVECTOR* pDeterminant, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMMATRIX MT = XMMatrixTranspose(M); + + XMVECTOR V0[4], V1[4]; + V0[0] = XMVectorSwizzle(MT.r[2]); + V1[0] = XMVectorSwizzle(MT.r[3]); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorSwizzle(MT.r[1]); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0]); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1]); + + XMVECTOR D0 = XMVectorMultiply(V0[0], V1[0]); + XMVECTOR D1 = XMVectorMultiply(V0[1], V1[1]); + XMVECTOR D2 = XMVectorMultiply(V0[2], V1[2]); + + V0[0] = XMVectorSwizzle(MT.r[2]); + V1[0] = XMVectorSwizzle(MT.r[3]); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorSwizzle(MT.r[1]); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0]); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1]); + + D0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], D0); + D1 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], D1); + D2 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], D2); + + V0[0] = XMVectorSwizzle(MT.r[1]); + V1[0] = XMVectorPermute(D0, D2); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorPermute(D0, D2); + V0[2] = XMVectorSwizzle(MT.r[3]); + V1[2] = XMVectorPermute(D1, D2); + V0[3] = XMVectorSwizzle(MT.r[2]); + V1[3] = XMVectorPermute(D1, D2); + + XMVECTOR C0 = XMVectorMultiply(V0[0], V1[0]); + XMVECTOR C2 = XMVectorMultiply(V0[1], V1[1]); + XMVECTOR C4 = XMVectorMultiply(V0[2], V1[2]); + XMVECTOR C6 = XMVectorMultiply(V0[3], V1[3]); + + V0[0] = XMVectorSwizzle(MT.r[1]); + V1[0] = XMVectorPermute(D0, D2); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorPermute(D0, D2); + V0[2] = XMVectorSwizzle(MT.r[3]); + V1[2] = XMVectorPermute(D1, D2); + V0[3] = XMVectorSwizzle(MT.r[2]); + V1[3] = XMVectorPermute(D1, D2); + + C0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + C4 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + V0[0] = XMVectorSwizzle(MT.r[1]); + V1[0] = XMVectorPermute(D0, D2); + V0[1] = XMVectorSwizzle(MT.r[0]); + V1[1] = XMVectorPermute(D0, D2); + V0[2] = XMVectorSwizzle(MT.r[3]); + V1[2] = XMVectorPermute(D1, D2); + V0[3] = XMVectorSwizzle(MT.r[2]); + V1[3] = XMVectorPermute(D1, D2); + + XMVECTOR C1 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C0 = XMVectorMultiplyAdd(V0[0], V1[0], C0); + XMVECTOR C3 = XMVectorMultiplyAdd(V0[1], V1[1], C2); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + XMVECTOR C5 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C4 = XMVectorMultiplyAdd(V0[2], V1[2], C4); + XMVECTOR C7 = XMVectorMultiplyAdd(V0[3], V1[3], C6); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + XMMATRIX R; + R.r[0] = XMVectorSelect(C0, C1, g_XMSelect0101.v); + R.r[1] = XMVectorSelect(C2, C3, g_XMSelect0101.v); + R.r[2] = XMVectorSelect(C4, C5, g_XMSelect0101.v); + R.r[3] = XMVectorSelect(C6, C7, g_XMSelect0101.v); + + XMVECTOR Determinant = XMVector4Dot(R.r[0], MT.r[0]); + + if (pDeterminant != nullptr) + *pDeterminant = Determinant; + + XMVECTOR Reciprocal = XMVectorReciprocal(Determinant); + + XMMATRIX Result; + Result.r[0] = XMVectorMultiply(R.r[0], Reciprocal); + Result.r[1] = XMVectorMultiply(R.r[1], Reciprocal); + Result.r[2] = XMVectorMultiply(R.r[2], Reciprocal); + Result.r[3] = XMVectorMultiply(R.r[3], Reciprocal); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Transpose matrix + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(1, 0, 1, 0)); + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0], M.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(1, 0, 1, 0)); + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2], M.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + + XMMATRIX MT; + MT.r[0] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(2, 0, 2, 0)); + MT.r[1] = _mm_shuffle_ps(vTemp1, vTemp2, _MM_SHUFFLE(3, 1, 3, 1)); + MT.r[2] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(2, 0, 2, 0)); + MT.r[3] = _mm_shuffle_ps(vTemp3, vTemp4, _MM_SHUFFLE(3, 1, 3, 1)); + + XMVECTOR V00 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(1, 1, 0, 0)); + XMVECTOR V10 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(3, 2, 3, 2)); + XMVECTOR V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(1, 1, 0, 0)); + XMVECTOR V11 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(3, 2, 3, 2)); + XMVECTOR V02 = _mm_shuffle_ps(MT.r[2], MT.r[0], _MM_SHUFFLE(2, 0, 2, 0)); + XMVECTOR V12 = _mm_shuffle_ps(MT.r[3], MT.r[1], _MM_SHUFFLE(3, 1, 3, 1)); + + XMVECTOR D0 = _mm_mul_ps(V00, V10); + XMVECTOR D1 = _mm_mul_ps(V01, V11); + XMVECTOR D2 = _mm_mul_ps(V02, V12); + + V00 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(3, 2, 3, 2)); + V10 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(1, 1, 0, 0)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(3, 2, 3, 2)); + V11 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(1, 1, 0, 0)); + V02 = _mm_shuffle_ps(MT.r[2], MT.r[0], _MM_SHUFFLE(3, 1, 3, 1)); + V12 = _mm_shuffle_ps(MT.r[3], MT.r[1], _MM_SHUFFLE(2, 0, 2, 0)); + + D0 = XM_FNMADD_PS(V00, V10, D0); + D1 = XM_FNMADD_PS(V01, V11, D1); + D2 = XM_FNMADD_PS(V02, V12, D2); + // V11 = D0Y,D0W,D2Y,D2Y + V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 1, 3, 1)); + V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(1, 0, 2, 1)); + V10 = _mm_shuffle_ps(V11, D0, _MM_SHUFFLE(0, 3, 0, 2)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(0, 1, 0, 2)); + V11 = _mm_shuffle_ps(V11, D0, _MM_SHUFFLE(2, 1, 2, 1)); + // V13 = D1Y,D1W,D2W,D2W + XMVECTOR V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 3, 3, 1)); + V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(1, 0, 2, 1)); + V12 = _mm_shuffle_ps(V13, D1, _MM_SHUFFLE(0, 3, 0, 2)); + XMVECTOR V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(0, 1, 0, 2)); + V13 = _mm_shuffle_ps(V13, D1, _MM_SHUFFLE(2, 1, 2, 1)); + + XMVECTOR C0 = _mm_mul_ps(V00, V10); + XMVECTOR C2 = _mm_mul_ps(V01, V11); + XMVECTOR C4 = _mm_mul_ps(V02, V12); + XMVECTOR C6 = _mm_mul_ps(V03, V13); + + // V11 = D0X,D0Y,D2X,D2X + V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(0, 0, 1, 0)); + V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(2, 1, 3, 2)); + V10 = _mm_shuffle_ps(D0, V11, _MM_SHUFFLE(2, 1, 0, 3)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(1, 3, 2, 3)); + V11 = _mm_shuffle_ps(D0, V11, _MM_SHUFFLE(0, 2, 1, 2)); + // V13 = D1X,D1Y,D2Z,D2Z + V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(2, 2, 1, 0)); + V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(2, 1, 3, 2)); + V12 = _mm_shuffle_ps(D1, V13, _MM_SHUFFLE(2, 1, 0, 3)); + V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(1, 3, 2, 3)); + V13 = _mm_shuffle_ps(D1, V13, _MM_SHUFFLE(0, 2, 1, 2)); + + C0 = XM_FNMADD_PS(V00, V10, C0); + C2 = XM_FNMADD_PS(V01, V11, C2); + C4 = XM_FNMADD_PS(V02, V12, C4); + C6 = XM_FNMADD_PS(V03, V13, C6); + + V00 = XM_PERMUTE_PS(MT.r[1], _MM_SHUFFLE(0, 3, 0, 3)); + // V10 = D0Z,D0Z,D2X,D2Y + V10 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 0, 2, 2)); + V10 = XM_PERMUTE_PS(V10, _MM_SHUFFLE(0, 2, 3, 0)); + V01 = XM_PERMUTE_PS(MT.r[0], _MM_SHUFFLE(2, 0, 3, 1)); + // V11 = D0X,D0W,D2X,D2Y + V11 = _mm_shuffle_ps(D0, D2, _MM_SHUFFLE(1, 0, 3, 0)); + V11 = XM_PERMUTE_PS(V11, _MM_SHUFFLE(2, 1, 0, 3)); + V02 = XM_PERMUTE_PS(MT.r[3], _MM_SHUFFLE(0, 3, 0, 3)); + // V12 = D1Z,D1Z,D2Z,D2W + V12 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 2, 2, 2)); + V12 = XM_PERMUTE_PS(V12, _MM_SHUFFLE(0, 2, 3, 0)); + V03 = XM_PERMUTE_PS(MT.r[2], _MM_SHUFFLE(2, 0, 3, 1)); + // V13 = D1X,D1W,D2Z,D2W + V13 = _mm_shuffle_ps(D1, D2, _MM_SHUFFLE(3, 2, 3, 0)); + V13 = XM_PERMUTE_PS(V13, _MM_SHUFFLE(2, 1, 0, 3)); + + V00 = _mm_mul_ps(V00, V10); + V01 = _mm_mul_ps(V01, V11); + V02 = _mm_mul_ps(V02, V12); + V03 = _mm_mul_ps(V03, V13); + XMVECTOR C1 = _mm_sub_ps(C0, V00); + C0 = _mm_add_ps(C0, V00); + XMVECTOR C3 = _mm_add_ps(C2, V01); + C2 = _mm_sub_ps(C2, V01); + XMVECTOR C5 = _mm_sub_ps(C4, V02); + C4 = _mm_add_ps(C4, V02); + XMVECTOR C7 = _mm_add_ps(C6, V03); + C6 = _mm_sub_ps(C6, V03); + + C0 = _mm_shuffle_ps(C0, C1, _MM_SHUFFLE(3, 1, 2, 0)); + C2 = _mm_shuffle_ps(C2, C3, _MM_SHUFFLE(3, 1, 2, 0)); + C4 = _mm_shuffle_ps(C4, C5, _MM_SHUFFLE(3, 1, 2, 0)); + C6 = _mm_shuffle_ps(C6, C7, _MM_SHUFFLE(3, 1, 2, 0)); + C0 = XM_PERMUTE_PS(C0, _MM_SHUFFLE(3, 1, 2, 0)); + C2 = XM_PERMUTE_PS(C2, _MM_SHUFFLE(3, 1, 2, 0)); + C4 = XM_PERMUTE_PS(C4, _MM_SHUFFLE(3, 1, 2, 0)); + C6 = XM_PERMUTE_PS(C6, _MM_SHUFFLE(3, 1, 2, 0)); + // Get the determinant + XMVECTOR vTemp = XMVector4Dot(C0, MT.r[0]); + if (pDeterminant != nullptr) + *pDeterminant = vTemp; + vTemp = _mm_div_ps(g_XMOne, vTemp); + XMMATRIX mResult; + mResult.r[0] = _mm_mul_ps(C0, vTemp); + mResult.r[1] = _mm_mul_ps(C2, vTemp); + mResult.r[2] = _mm_mul_ps(C4, vTemp); + mResult.r[3] = _mm_mul_ps(C6, vTemp); + return mResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixVectorTensorProduct +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMMATRIX mResult; + mResult.r[0] = XMVectorMultiply(XMVectorSwizzle<0, 0, 0, 0>(V1), V2); + mResult.r[1] = XMVectorMultiply(XMVectorSwizzle<1, 1, 1, 1>(V1), V2); + mResult.r[2] = XMVectorMultiply(XMVectorSwizzle<2, 2, 2, 2>(V1), V2); + mResult.r[3] = XMVectorMultiply(XMVectorSwizzle<3, 3, 3, 3>(V1), V2); + return mResult; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMMatrixDeterminant(FXMMATRIX M) noexcept +{ + static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; + + XMVECTOR V0 = XMVectorSwizzle(M.r[2]); + XMVECTOR V1 = XMVectorSwizzle(M.r[3]); + XMVECTOR V2 = XMVectorSwizzle(M.r[2]); + XMVECTOR V3 = XMVectorSwizzle(M.r[3]); + XMVECTOR V4 = XMVectorSwizzle(M.r[2]); + XMVECTOR V5 = XMVectorSwizzle(M.r[3]); + + XMVECTOR P0 = XMVectorMultiply(V0, V1); + XMVECTOR P1 = XMVectorMultiply(V2, V3); + XMVECTOR P2 = XMVectorMultiply(V4, V5); + + V0 = XMVectorSwizzle(M.r[2]); + V1 = XMVectorSwizzle(M.r[3]); + V2 = XMVectorSwizzle(M.r[2]); + V3 = XMVectorSwizzle(M.r[3]); + V4 = XMVectorSwizzle(M.r[2]); + V5 = XMVectorSwizzle(M.r[3]); + + P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); + P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); + P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); + + V0 = XMVectorSwizzle(M.r[1]); + V1 = XMVectorSwizzle(M.r[1]); + V2 = XMVectorSwizzle(M.r[1]); + + XMVECTOR S = XMVectorMultiply(M.r[0], Sign.v); + XMVECTOR R = XMVectorMultiply(V0, P0); + R = XMVectorNegativeMultiplySubtract(V1, P1, R); + R = XMVectorMultiplyAdd(V2, P2, R); + + return XMVector4Dot(S, R); +} + +#define XM3RANKDECOMPOSE(a, b, c, x, y, z) \ + if((x) < (y)) \ + { \ + if((y) < (z)) \ + { \ + (a) = 2; \ + (b) = 1; \ + (c) = 0; \ + } \ + else \ + { \ + (a) = 1; \ + \ + if((x) < (z)) \ + { \ + (b) = 2; \ + (c) = 0; \ + } \ + else \ + { \ + (b) = 0; \ + (c) = 2; \ + } \ + } \ + } \ + else \ + { \ + if((x) < (z)) \ + { \ + (a) = 2; \ + (b) = 0; \ + (c) = 1; \ + } \ + else \ + { \ + (a) = 0; \ + \ + if((y) < (z)) \ + { \ + (b) = 2; \ + (c) = 1; \ + } \ + else \ + { \ + (b) = 1; \ + (c) = 2; \ + } \ + } \ + } + +#define XM3_DECOMP_EPSILON 0.0001f + +_Use_decl_annotations_ +inline bool XM_CALLCONV XMMatrixDecompose +( + XMVECTOR* outScale, + XMVECTOR* outRotQuat, + XMVECTOR* outTrans, + FXMMATRIX M +) noexcept +{ + static const XMVECTOR* pvCanonicalBasis[3] = { + &g_XMIdentityR0.v, + &g_XMIdentityR1.v, + &g_XMIdentityR2.v + }; + + assert(outScale != nullptr); + assert(outRotQuat != nullptr); + assert(outTrans != nullptr); + + // Get the translation + outTrans[0] = M.r[3]; + + XMVECTOR* ppvBasis[3]; + XMMATRIX matTemp; + ppvBasis[0] = &matTemp.r[0]; + ppvBasis[1] = &matTemp.r[1]; + ppvBasis[2] = &matTemp.r[2]; + + matTemp.r[0] = M.r[0]; + matTemp.r[1] = M.r[1]; + matTemp.r[2] = M.r[2]; + matTemp.r[3] = g_XMIdentityR3.v; + + auto pfScales = reinterpret_cast(outScale); + + size_t a, b, c; + XMVectorGetXPtr(&pfScales[0], XMVector3Length(ppvBasis[0][0])); + XMVectorGetXPtr(&pfScales[1], XMVector3Length(ppvBasis[1][0])); + XMVectorGetXPtr(&pfScales[2], XMVector3Length(ppvBasis[2][0])); + pfScales[3] = 0.f; + + XM3RANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2]) + + if (pfScales[a] < XM3_DECOMP_EPSILON) + { + ppvBasis[a][0] = pvCanonicalBasis[a][0]; + } + ppvBasis[a][0] = XMVector3Normalize(ppvBasis[a][0]); + + if (pfScales[b] < XM3_DECOMP_EPSILON) + { + size_t aa, bb, cc; + float fAbsX, fAbsY, fAbsZ; + + fAbsX = fabsf(XMVectorGetX(ppvBasis[a][0])); + fAbsY = fabsf(XMVectorGetY(ppvBasis[a][0])); + fAbsZ = fabsf(XMVectorGetZ(ppvBasis[a][0])); + + XM3RANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ) + + ppvBasis[b][0] = XMVector3Cross(ppvBasis[a][0], pvCanonicalBasis[cc][0]); + } + + ppvBasis[b][0] = XMVector3Normalize(ppvBasis[b][0]); + + if (pfScales[c] < XM3_DECOMP_EPSILON) + { + ppvBasis[c][0] = XMVector3Cross(ppvBasis[a][0], ppvBasis[b][0]); + } + + ppvBasis[c][0] = XMVector3Normalize(ppvBasis[c][0]); + + float fDet = XMVectorGetX(XMMatrixDeterminant(matTemp)); + + // use Kramer's rule to check for handedness of coordinate system + if (fDet < 0.0f) + { + // switch coordinate system by negating the scale and inverting the basis vector on the x-axis + pfScales[a] = -pfScales[a]; + ppvBasis[a][0] = XMVectorNegate(ppvBasis[a][0]); + + fDet = -fDet; + } + + fDet -= 1.0f; + fDet *= fDet; + + if (XM3_DECOMP_EPSILON < fDet) + { + // Non-SRT matrix encountered + return false; + } + + // generate the quaternion from the matrix + outRotQuat[0] = XMQuaternionRotationMatrix(matTemp); + return true; +} + +#undef XM3_DECOMP_EPSILON +#undef XM3RANKDECOMPOSE + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixIdentity() noexcept +{ + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = g_XMIdentityR3.v; + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixSet +( + float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33 +) noexcept +{ + XMMATRIX M; +#if defined(_XM_NO_INTRINSICS_) + M.m[0][0] = m00; M.m[0][1] = m01; M.m[0][2] = m02; M.m[0][3] = m03; + M.m[1][0] = m10; M.m[1][1] = m11; M.m[1][2] = m12; M.m[1][3] = m13; + M.m[2][0] = m20; M.m[2][1] = m21; M.m[2][2] = m22; M.m[2][3] = m23; + M.m[3][0] = m30; M.m[3][1] = m31; M.m[3][2] = m32; M.m[3][3] = m33; +#else + M.r[0] = XMVectorSet(m00, m01, m02, m03); + M.r[1] = XMVectorSet(m10, m11, m12, m13); + M.r[2] = XMVectorSet(m20, m21, m22, m23); + M.r[3] = XMVectorSet(m30, m31, m32, m33); +#endif + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTranslation +( + float OffsetX, + float OffsetY, + float OffsetZ +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = OffsetX; + M.m[3][1] = OffsetY; + M.m[3][2] = OffsetZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = XMVectorSet(OffsetX, OffsetY, OffsetZ, 1.f); + return M; +#endif +} + + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(FXMVECTOR Offset) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = Offset.vector4_f32[0]; + M.m[3][1] = Offset.vector4_f32[1]; + M.m[3][2] = Offset.vector4_f32[2]; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = XMVectorSelect(g_XMIdentityR3.v, Offset, g_XMSelect1110.v); + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixScaling +( + float ScaleX, + float ScaleY, + float ScaleZ +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = ScaleX; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = ScaleY; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = ScaleZ; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + const XMVECTOR Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(ScaleX, Zero, 0); + M.r[1] = vsetq_lane_f32(ScaleY, Zero, 1); + M.r[2] = vsetq_lane_f32(ScaleZ, Zero, 2); + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_set_ps(0, 0, 0, ScaleX); + M.r[1] = _mm_set_ps(0, 0, ScaleY, 0); + M.r[2] = _mm_set_ps(0, ScaleZ, 0, 0); + M.r[3] = g_XMIdentityR3.v; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = Scale.vector4_f32[0]; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Scale.vector4_f32[1]; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = Scale.vector4_f32[2]; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX M; + M.r[0] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskX)); + M.r[1] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskY)); + M.r[2] = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(Scale), g_XMMaskZ)); + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_and_ps(Scale, g_XMMaskX); + M.r[1] = _mm_and_ps(Scale, g_XMMaskY); + M.r[2] = _mm_and_ps(Scale, g_XMMaskZ); + M.r[3] = g_XMIdentityR3.v; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = fCosAngle; + M.m[1][2] = fSinAngle; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = -fSinAngle; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + const float32x4_t Zero = vdupq_n_f32(0); + + float32x4_t T1 = vsetq_lane_f32(fCosAngle, Zero, 1); + T1 = vsetq_lane_f32(fSinAngle, T1, 2); + + float32x4_t T2 = vsetq_lane_f32(-fSinAngle, Zero, 1); + T2 = vsetq_lane_f32(fCosAngle, T2, 2); + + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = T1; + M.r[2] = T2; + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinAngle; + float CosAngle; + XMScalarSinCos(&SinAngle, &CosAngle, Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = 0,y = cos,z = sin, w = 0 + vCos = _mm_shuffle_ps(vCos, vSin, _MM_SHUFFLE(3, 0, 0, 3)); + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = vCos; + // x = 0,y = sin,z = cos, w = 0 + vCos = XM_PERMUTE_PS(vCos, _MM_SHUFFLE(3, 1, 2, 0)); + // x = 0,y = -sin,z = cos, w = 0 + vCos = _mm_mul_ps(vCos, g_XMNegateY); + M.r[2] = vCos; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMMATRIX M; + M.m[0][0] = fCosAngle; + M.m[0][1] = 0.0f; + M.m[0][2] = -fSinAngle; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = fSinAngle; + M.m[2][1] = 0.0f; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + const float32x4_t Zero = vdupq_n_f32(0); + + float32x4_t T0 = vsetq_lane_f32(fCosAngle, Zero, 0); + T0 = vsetq_lane_f32(-fSinAngle, T0, 2); + + float32x4_t T2 = vsetq_lane_f32(fSinAngle, Zero, 0); + T2 = vsetq_lane_f32(fCosAngle, T2, 2); + + XMMATRIX M; + M.r[0] = T0; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = T2; + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinAngle; + float CosAngle; + XMScalarSinCos(&SinAngle, &CosAngle, Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = sin,y = 0,z = cos, w = 0 + vSin = _mm_shuffle_ps(vSin, vCos, _MM_SHUFFLE(3, 0, 3, 0)); + XMMATRIX M; + M.r[2] = vSin; + M.r[1] = g_XMIdentityR1; + // x = cos,y = 0,z = sin, w = 0 + vSin = XM_PERMUTE_PS(vSin, _MM_SHUFFLE(3, 0, 1, 2)); + // x = cos,y = 0,z = -sin, w = 0 + vSin = _mm_mul_ps(vSin, g_XMNegateZ); + M.r[0] = vSin; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMMATRIX M; + M.m[0][0] = fCosAngle; + M.m[0][1] = fSinAngle; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = -fSinAngle; + M.m[1][1] = fCosAngle; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + const float32x4_t Zero = vdupq_n_f32(0); + + float32x4_t T0 = vsetq_lane_f32(fCosAngle, Zero, 0); + T0 = vsetq_lane_f32(fSinAngle, T0, 1); + + float32x4_t T1 = vsetq_lane_f32(-fSinAngle, Zero, 0); + T1 = vsetq_lane_f32(fCosAngle, T1, 1); + + XMMATRIX M; + M.r[0] = T0; + M.r[1] = T1; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = g_XMIdentityR3.v; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinAngle; + float CosAngle; + XMScalarSinCos(&SinAngle, &CosAngle, Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = cos,y = sin,z = 0, w = 0 + vCos = _mm_unpacklo_ps(vCos, vSin); + XMMATRIX M; + M.r[0] = vCos; + // x = sin,y = cos,z = 0, w = 0 + vCos = XM_PERMUTE_PS(vCos, _MM_SHUFFLE(3, 2, 0, 1)); + // x = cos,y = -sin,z = 0, w = 0 + vCos = _mm_mul_ps(vCos, g_XMNegateX); + M.r[1] = vCos; + M.r[2] = g_XMIdentityR2; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw +( + float Pitch, + float Yaw, + float Roll +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float cp = cosf(Pitch); + float sp = sinf(Pitch); + + float cy = cosf(Yaw); + float sy = sinf(Yaw); + + float cr = cosf(Roll); + float sr = sinf(Roll); + + XMMATRIX M; + M.m[0][0] = cr * cy + sr * sp * sy; + M.m[0][1] = sr * cp; + M.m[0][2] = sr * sp * cy - cr * sy; + M.m[0][3] = 0.0f; + + M.m[1][0] = cr * sp * sy - sr * cy; + M.m[1][1] = cr * cp; + M.m[1][2] = sr * sy + cr * sp * cy; + M.m[1][3] = 0.0f; + + M.m[2][0] = cp * sy; + M.m[2][1] = -sp; + M.m[2][2] = cp * cy; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; +#else + XMVECTOR Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + return XMMatrixRotationRollPitchYawFromVector(Angles); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float cp = cosf(Angles.vector4_f32[0]); + float sp = sinf(Angles.vector4_f32[0]); + + float cy = cosf(Angles.vector4_f32[1]); + float sy = sinf(Angles.vector4_f32[1]); + + float cr = cosf(Angles.vector4_f32[2]); + float sr = sinf(Angles.vector4_f32[2]); + + XMMATRIX M; + M.m[0][0] = cr * cy + sr * sp * sy; + M.m[0][1] = sr * cp; + M.m[0][2] = sr * sp * cy - cr * sy; + M.m[0][3] = 0.0f; + + M.m[1][0] = cr * sp * sy - sr * cy; + M.m[1][1] = cr * cp; + M.m[1][2] = sr * sy + cr * sp * cy; + M.m[1][3] = 0.0f; + + M.m[2][0] = cp * sy; + M.m[2][1] = -sp; + M.m[2][2] = cp * cy; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; +#else + static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, -1.0f, 1.0f } } }; + + XMVECTOR SinAngles, CosAngles; + XMVectorSinCos(&SinAngles, &CosAngles, Angles); + + XMVECTOR P0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P1 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y1 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P2 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P3 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y2 = XMVectorSplatX(SinAngles); + XMVECTOR NS = XMVectorNegate(SinAngles); + + XMVECTOR Q0 = XMVectorMultiply(P0, Y0); + XMVECTOR Q1 = XMVectorMultiply(P1, Sign.v); + Q1 = XMVectorMultiply(Q1, Y1); + XMVECTOR Q2 = XMVectorMultiply(P2, Y2); + Q2 = XMVectorMultiplyAdd(Q2, P3, Q1); + + XMVECTOR V0 = XMVectorPermute(Q0, Q2); + XMVECTOR V1 = XMVectorPermute(Q0, Q2); + XMVECTOR V2 = XMVectorPermute(Q0, NS); + + XMMATRIX M; + M.r[0] = XMVectorSelect(g_XMZero, V0, g_XMSelect1110.v); + M.r[1] = XMVectorSelect(g_XMZero, V1, g_XMSelect1110.v); + M.r[2] = XMVectorSelect(g_XMZero, V2, g_XMSelect1110.v); + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationNormal +( + FXMVECTOR NormalAxis, + float Angle +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMVECTOR A = XMVectorSet(fSinAngle, fCosAngle, 1.0f - fCosAngle, 0.0f); + + XMVECTOR C2 = XMVectorSplatZ(A); + XMVECTOR C1 = XMVectorSplatY(A); + XMVECTOR C0 = XMVectorSplatX(A); + + XMVECTOR N0 = XMVectorSwizzle(NormalAxis); + XMVECTOR N1 = XMVectorSwizzle(NormalAxis); + + XMVECTOR V0 = XMVectorMultiply(C2, N0); + V0 = XMVectorMultiply(V0, N1); + + XMVECTOR R0 = XMVectorMultiply(C2, NormalAxis); + R0 = XMVectorMultiplyAdd(R0, NormalAxis, C1); + + XMVECTOR R1 = XMVectorMultiplyAdd(C0, NormalAxis, V0); + XMVECTOR R2 = XMVectorNegativeMultiplySubtract(C0, NormalAxis, V0); + + V0 = XMVectorSelect(A, R0, g_XMSelect1110.v); + XMVECTOR V1 = XMVectorPermute(R1, R2); + XMVECTOR V2 = XMVectorPermute(R1, R2); + + XMMATRIX M; + M.r[0] = XMVectorPermute(V0, V1); + M.r[1] = XMVectorPermute(V0, V1); + M.r[2] = XMVectorPermute(V0, V2); + M.r[3] = g_XMIdentityR3.v; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + float fSinAngle; + float fCosAngle; + XMScalarSinCos(&fSinAngle, &fCosAngle, Angle); + + XMVECTOR C2 = _mm_set_ps1(1.0f - fCosAngle); + XMVECTOR C1 = _mm_set_ps1(fCosAngle); + XMVECTOR C0 = _mm_set_ps1(fSinAngle); + + XMVECTOR N0 = XM_PERMUTE_PS(NormalAxis, _MM_SHUFFLE(3, 0, 2, 1)); + XMVECTOR N1 = XM_PERMUTE_PS(NormalAxis, _MM_SHUFFLE(3, 1, 0, 2)); + + XMVECTOR V0 = _mm_mul_ps(C2, N0); + V0 = _mm_mul_ps(V0, N1); + + XMVECTOR R0 = _mm_mul_ps(C2, NormalAxis); + R0 = _mm_mul_ps(R0, NormalAxis); + R0 = _mm_add_ps(R0, C1); + + XMVECTOR R1 = _mm_mul_ps(C0, NormalAxis); + R1 = _mm_add_ps(R1, V0); + XMVECTOR R2 = _mm_mul_ps(C0, NormalAxis); + R2 = _mm_sub_ps(V0, R2); + + V0 = _mm_and_ps(R0, g_XMMask3); + XMVECTOR V1 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(2, 1, 2, 0)); + V1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 3, 2, 1)); + XMVECTOR V2 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(0, 0, 1, 1)); + V2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 0, 2, 0)); + + R2 = _mm_shuffle_ps(V0, V1, _MM_SHUFFLE(1, 0, 3, 0)); + R2 = XM_PERMUTE_PS(R2, _MM_SHUFFLE(1, 3, 2, 0)); + + XMMATRIX M; + M.r[0] = R2; + + R2 = _mm_shuffle_ps(V0, V1, _MM_SHUFFLE(3, 2, 3, 1)); + R2 = XM_PERMUTE_PS(R2, _MM_SHUFFLE(1, 3, 0, 2)); + M.r[1] = R2; + + V2 = _mm_shuffle_ps(V2, V0, _MM_SHUFFLE(3, 2, 1, 0)); + M.r[2] = V2; + M.r[3] = g_XMIdentityR3.v; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationAxis +( + FXMVECTOR Axis, + float Angle +) noexcept +{ + assert(!XMVector3Equal(Axis, XMVectorZero())); + assert(!XMVector3IsInfinite(Axis)); + + XMVECTOR Normal = XMVector3Normalize(Axis); + return XMMatrixRotationNormal(Normal, Angle); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixRotationQuaternion(FXMVECTOR Quaternion) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float qx = Quaternion.vector4_f32[0]; + float qxx = qx * qx; + + float qy = Quaternion.vector4_f32[1]; + float qyy = qy * qy; + + float qz = Quaternion.vector4_f32[2]; + float qzz = qz * qz; + + float qw = Quaternion.vector4_f32[3]; + + XMMATRIX M; + M.m[0][0] = 1.f - 2.f * qyy - 2.f * qzz; + M.m[0][1] = 2.f * qx * qy + 2.f * qz * qw; + M.m[0][2] = 2.f * qx * qz - 2.f * qy * qw; + M.m[0][3] = 0.f; + + M.m[1][0] = 2.f * qx * qy - 2.f * qz * qw; + M.m[1][1] = 1.f - 2.f * qxx - 2.f * qzz; + M.m[1][2] = 2.f * qy * qz + 2.f * qx * qw; + M.m[1][3] = 0.f; + + M.m[2][0] = 2.f * qx * qz + 2.f * qy * qw; + M.m[2][1] = 2.f * qy * qz - 2.f * qx * qw; + M.m[2][2] = 1.f - 2.f * qxx - 2.f * qyy; + M.m[2][3] = 0.f; + + M.m[3][0] = 0.f; + M.m[3][1] = 0.f; + M.m[3][2] = 0.f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Constant1110 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; + + XMVECTOR Q0 = XMVectorAdd(Quaternion, Quaternion); + XMVECTOR Q1 = XMVectorMultiply(Quaternion, Q0); + + XMVECTOR V0 = XMVectorPermute(Q1, Constant1110.v); + XMVECTOR V1 = XMVectorPermute(Q1, Constant1110.v); + XMVECTOR R0 = XMVectorSubtract(Constant1110, V0); + R0 = XMVectorSubtract(R0, V1); + + V0 = XMVectorSwizzle(Quaternion); + V1 = XMVectorSwizzle(Q0); + V0 = XMVectorMultiply(V0, V1); + + V1 = XMVectorSplatW(Quaternion); + XMVECTOR V2 = XMVectorSwizzle(Q0); + V1 = XMVectorMultiply(V1, V2); + + XMVECTOR R1 = XMVectorAdd(V0, V1); + XMVECTOR R2 = XMVectorSubtract(V0, V1); + + V0 = XMVectorPermute(R1, R2); + V1 = XMVectorPermute(R1, R2); + + XMMATRIX M; + M.r[0] = XMVectorPermute(R0, V0); + M.r[1] = XMVectorPermute(R0, V0); + M.r[2] = XMVectorPermute(R0, V1); + M.r[3] = g_XMIdentityR3.v; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Constant1110 = { { { 1.0f, 1.0f, 1.0f, 0.0f } } }; + + XMVECTOR Q0 = _mm_add_ps(Quaternion, Quaternion); + XMVECTOR Q1 = _mm_mul_ps(Quaternion, Q0); + + XMVECTOR V0 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(3, 0, 0, 1)); + V0 = _mm_and_ps(V0, g_XMMask3); + XMVECTOR V1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(3, 1, 2, 2)); + V1 = _mm_and_ps(V1, g_XMMask3); + XMVECTOR R0 = _mm_sub_ps(Constant1110, V0); + R0 = _mm_sub_ps(R0, V1); + + V0 = XM_PERMUTE_PS(Quaternion, _MM_SHUFFLE(3, 1, 0, 0)); + V1 = XM_PERMUTE_PS(Q0, _MM_SHUFFLE(3, 2, 1, 2)); + V0 = _mm_mul_ps(V0, V1); + + V1 = XM_PERMUTE_PS(Quaternion, _MM_SHUFFLE(3, 3, 3, 3)); + XMVECTOR V2 = XM_PERMUTE_PS(Q0, _MM_SHUFFLE(3, 0, 2, 1)); + V1 = _mm_mul_ps(V1, V2); + + XMVECTOR R1 = _mm_add_ps(V0, V1); + XMVECTOR R2 = _mm_sub_ps(V0, V1); + + V0 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(1, 0, 2, 1)); + V0 = XM_PERMUTE_PS(V0, _MM_SHUFFLE(1, 3, 2, 0)); + V1 = _mm_shuffle_ps(R1, R2, _MM_SHUFFLE(2, 2, 0, 0)); + V1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 0, 2, 0)); + + Q1 = _mm_shuffle_ps(R0, V0, _MM_SHUFFLE(1, 0, 3, 0)); + Q1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(1, 3, 2, 0)); + + XMMATRIX M; + M.r[0] = Q1; + + Q1 = _mm_shuffle_ps(R0, V0, _MM_SHUFFLE(3, 2, 3, 1)); + Q1 = XM_PERMUTE_PS(Q1, _MM_SHUFFLE(1, 3, 0, 2)); + M.r[1] = Q1; + + Q1 = _mm_shuffle_ps(V1, R0, _MM_SHUFFLE(3, 2, 1, 0)); + M.r[2] = Q1; + M.r[3] = g_XMIdentityR3; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTransformation2D +( + FXMVECTOR ScalingOrigin, + float ScalingOrientation, + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + float Rotation, + GXMVECTOR Translation +) noexcept +{ + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMVECTOR VScalingOrigin = XMVectorSelect(g_XMSelect1100.v, ScalingOrigin, g_XMSelect1100.v); + XMVECTOR NegScalingOrigin = XMVectorNegate(VScalingOrigin); + + XMMATRIX MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + XMMATRIX MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); + XMMATRIX MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + XMVECTOR VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + XMMATRIX MScaling = XMMatrixScalingFromVector(VScaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + XMMATRIX MRotation = XMMatrixRotationZ(Rotation); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation, g_XMSelect1100.v); + + XMMATRIX M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixTransformation +( + FXMVECTOR ScalingOrigin, + FXMVECTOR ScalingOrientationQuaternion, + FXMVECTOR Scaling, + GXMVECTOR RotationOrigin, + HXMVECTOR RotationQuaternion, + HXMVECTOR Translation +) noexcept +{ + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMVECTOR VScalingOrigin = XMVectorSelect(g_XMSelect1110.v, ScalingOrigin, g_XMSelect1110.v); + XMVECTOR NegScalingOrigin = XMVectorNegate(ScalingOrigin); + + XMMATRIX MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + XMMATRIX MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); + XMMATRIX MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + XMMATRIX MScaling = XMMatrixScalingFromVector(Scaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); + XMMATRIX MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); + + XMMATRIX M; + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixAffineTransformation2D +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + float Rotation, + FXMVECTOR Translation +) noexcept +{ + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMVECTOR VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + XMMATRIX MScaling = XMMatrixScalingFromVector(VScaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + XMMATRIX MRotation = XMMatrixRotationZ(Rotation); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation, g_XMSelect1100.v); + + XMMATRIX M; + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixAffineTransformation +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FXMVECTOR RotationQuaternion, + GXMVECTOR Translation +) noexcept +{ + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + XMMATRIX MScaling = XMMatrixScalingFromVector(Scaling); + XMVECTOR VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); + XMMATRIX MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + XMVECTOR VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); + + XMMATRIX M; + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixReflect(FXMVECTOR ReflectionPlane) noexcept +{ + assert(!XMVector3Equal(ReflectionPlane, XMVectorZero())); + assert(!XMPlaneIsInfinite(ReflectionPlane)); + + static const XMVECTORF32 NegativeTwo = { { { -2.0f, -2.0f, -2.0f, 0.0f } } }; + + XMVECTOR P = XMPlaneNormalize(ReflectionPlane); + XMVECTOR S = XMVectorMultiply(P, NegativeTwo); + + XMVECTOR A = XMVectorSplatX(P); + XMVECTOR B = XMVectorSplatY(P); + XMVECTOR C = XMVectorSplatZ(P); + XMVECTOR D = XMVectorSplatW(P); + + XMMATRIX M; + M.r[0] = XMVectorMultiplyAdd(A, S, g_XMIdentityR0.v); + M.r[1] = XMVectorMultiplyAdd(B, S, g_XMIdentityR1.v); + M.r[2] = XMVectorMultiplyAdd(C, S, g_XMIdentityR2.v); + M.r[3] = XMVectorMultiplyAdd(D, S, g_XMIdentityR3.v); + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixShadow +( + FXMVECTOR ShadowPlane, + FXMVECTOR LightPosition +) noexcept +{ + static const XMVECTORU32 Select0001 = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_0, XM_SELECT_1 } } }; + + assert(!XMVector3Equal(ShadowPlane, XMVectorZero())); + assert(!XMPlaneIsInfinite(ShadowPlane)); + + XMVECTOR P = XMPlaneNormalize(ShadowPlane); + XMVECTOR Dot = XMPlaneDot(P, LightPosition); + P = XMVectorNegate(P); + XMVECTOR D = XMVectorSplatW(P); + XMVECTOR C = XMVectorSplatZ(P); + XMVECTOR B = XMVectorSplatY(P); + XMVECTOR A = XMVectorSplatX(P); + Dot = XMVectorSelect(Select0001.v, Dot, Select0001.v); + + XMMATRIX M; + M.r[3] = XMVectorMultiplyAdd(D, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[2] = XMVectorMultiplyAdd(C, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[1] = XMVectorMultiplyAdd(B, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[0] = XMVectorMultiplyAdd(A, LightPosition, Dot); + return M; +} + +//------------------------------------------------------------------------------ +// View and projection initialization operations +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookAtLH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) noexcept +{ + XMVECTOR EyeDirection = XMVectorSubtract(FocusPosition, EyePosition); + return XMMatrixLookToLH(EyePosition, EyeDirection, UpDirection); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookAtRH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) noexcept +{ + XMVECTOR NegEyeDirection = XMVectorSubtract(EyePosition, FocusPosition); + return XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookToLH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) noexcept +{ + assert(!XMVector3Equal(EyeDirection, XMVectorZero())); + assert(!XMVector3IsInfinite(EyeDirection)); + assert(!XMVector3Equal(UpDirection, XMVectorZero())); + assert(!XMVector3IsInfinite(UpDirection)); + + XMVECTOR R2 = XMVector3Normalize(EyeDirection); + + XMVECTOR R0 = XMVector3Cross(UpDirection, R2); + R0 = XMVector3Normalize(R0); + + XMVECTOR R1 = XMVector3Cross(R2, R0); + + XMVECTOR NegEyePosition = XMVectorNegate(EyePosition); + + XMVECTOR D0 = XMVector3Dot(R0, NegEyePosition); + XMVECTOR D1 = XMVector3Dot(R1, NegEyePosition); + XMVECTOR D2 = XMVector3Dot(R2, NegEyePosition); + + XMMATRIX M; + M.r[0] = XMVectorSelect(D0, R0, g_XMSelect1110.v); + M.r[1] = XMVectorSelect(D1, R1, g_XMSelect1110.v); + M.r[2] = XMVectorSelect(D2, R2, g_XMSelect1110.v); + M.r[3] = g_XMIdentityR3.v; + + M = XMMatrixTranspose(M); + + return M; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixLookToRH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) noexcept +{ + XMVECTOR NegEyeDirection = XMVectorNegate(EyeDirection); + return XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable:28931, "PREfast noise: Esp:1266") +#endif + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveLH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (FarZ - NearZ); + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveRH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (NearZ - FarZ); + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMNegIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float fRange = FarZ / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vValues = _mm_shuffle_ps(vValues, g_XMNegIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,-1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovLH +( + float FovAngleY, + float AspectRatio, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + assert(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + float fRange = FarZ / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = Width; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Height; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float fRange = FarZ / (FarZ - NearZ); + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(Width, Zero, 0); + M.r[1] = vsetq_lane_f32(Height, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + float Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // Height / AspectRatio,0,0,0 + XMMATRIX M; + M.r[0] = vTemp; + // 0,Height,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveFovRH +( + float FovAngleY, + float AspectRatio, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + assert(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + float fRange = FarZ / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = Width; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Height; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + float fRange = FarZ / (NearZ - FarZ); + float Height = CosFov / SinFov; + float Width = Height / AspectRatio; + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(Width, Zero, 0); + M.r[1] = vsetq_lane_f32(Height, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, g_XMNegIdentityR3.v, 2); + M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + float SinFov; + float CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + float fRange = FarZ / (NearZ - FarZ); + // Note: This is recorded on the stack + float Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // Height / AspectRatio,0,0,0 + XMMATRIX M; + M.r[0] = vTemp; + // 0,Height,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMNegIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,-1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterLH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ * ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ * ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (FarZ - NearZ); + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ * ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ * ReciprocalHeight, Zero, 1); + M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + 1.0f); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ * ReciprocalWidth, + TwoNearZ * ReciprocalHeight, + -fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + 1.0f); + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues, g_XMMaskZ); + M.r[3] = vValues; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixPerspectiveOffCenterRH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(NearZ > 0.f && FarZ > 0.f); + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = TwoNearZ * ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ * ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (NearZ - FarZ); + const float32x4_t Zero = vdupq_n_f32(0); + + XMMATRIX M; + M.r[0] = vsetq_lane_f32(TwoNearZ * ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(TwoNearZ * ReciprocalHeight, Zero, 1); + M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, + (ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + -1.0f); + M.r[3] = vsetq_lane_f32(fRange * NearZ, Zero, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float TwoNearZ = NearZ + NearZ; + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = FarZ / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ * ReciprocalWidth, + TwoNearZ * ReciprocalHeight, + fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, + (ViewTop + ViewBottom) * ReciprocalHeight, + fRange, + -1.0f); + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues, g_XMMaskZ); + M.r[3] = vValues; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicLH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float fRange = 1.0f / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = 2.0f / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 2.0f / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fRange = 1.0f / (FarZ - NearZ); + + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(2.0f / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(2.0f / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = vsetq_lane_f32(-fRange * NearZ, g_XMIdentityR3.v, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fRange = 1.0f / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicRH +( + float ViewWidth, + float ViewHeight, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float fRange = 1.0f / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = 2.0f / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 2.0f / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float fRange = 1.0f / (NearZ - FarZ); + + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(2.0f / ViewWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(2.0f / ViewHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = vsetq_lane_f32(fRange * NearZ, g_XMIdentityR3.v, 2); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fRange = 1.0f / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues, g_XMIdentityR3, _MM_SHUFFLE(3, 2, 3, 2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(2, 0, 0, 0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp, vValues, _MM_SHUFFLE(3, 1, 0, 0)); + M.r[3] = vTemp; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterLH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (FarZ - NearZ); + + XMMATRIX M; + M.m[0][0] = ReciprocalWidth + ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = ReciprocalHeight + ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.m[3][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; + M.m[3][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (FarZ - NearZ); + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(ReciprocalWidth + ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(ReciprocalHeight + ReciprocalHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + -fRange * NearZ, + 1.0f); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + -NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp, vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + vTemp = _mm_add_ps(vTemp, vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues, rMem2); + M.r[3] = vValues; + return M; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMatrixOrthographicOffCenterRH +( + float ViewLeft, + float ViewRight, + float ViewBottom, + float ViewTop, + float NearZ, + float FarZ +) noexcept +{ + assert(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + assert(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + assert(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + +#if defined(_XM_NO_INTRINSICS_) + + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (NearZ - FarZ); + + XMMATRIX M; + M.m[0][0] = ReciprocalWidth + ReciprocalWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = ReciprocalHeight + ReciprocalHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 0.0f; + + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange * NearZ, + 1.0f); + return M; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (NearZ - FarZ); + const float32x4_t Zero = vdupq_n_f32(0); + XMMATRIX M; + M.r[0] = vsetq_lane_f32(ReciprocalWidth + ReciprocalWidth, Zero, 0); + M.r[1] = vsetq_lane_f32(ReciprocalHeight + ReciprocalHeight, Zero, 1); + M.r[2] = vsetq_lane_f32(fRange, Zero, 2); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + fRange * NearZ, + 1.0f); + return M; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + float fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + float fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + float fRange = 1.0f / (NearZ - FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp, vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp, vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskY); + vTemp = _mm_add_ps(vTemp, vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp, g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues, rMem2); + M.r[3] = vValues; + return M; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * XMMATRIX operators and methods + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMMATRIX::XMMATRIX +( + float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33 +) noexcept +{ + r[0] = XMVectorSet(m00, m01, m02, m03); + r[1] = XMVectorSet(m10, m11, m12, m13); + r[2] = XMVectorSet(m20, m21, m22, m23); + r[3] = XMVectorSet(m30, m31, m32, m33); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMMATRIX::XMMATRIX(const float* pArray) noexcept +{ + assert(pArray != nullptr); + r[0] = XMLoadFloat4(reinterpret_cast(pArray)); + r[1] = XMLoadFloat4(reinterpret_cast(pArray + 4)); + r[2] = XMLoadFloat4(reinterpret_cast(pArray + 8)); + r[3] = XMLoadFloat4(reinterpret_cast(pArray + 12)); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XMMATRIX::operator- () const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorNegate(r[0]); + R.r[1] = XMVectorNegate(r[1]); + R.r[2] = XMVectorNegate(r[2]); + R.r[3] = XMVectorNegate(r[3]); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XM_CALLCONV XMMATRIX::operator+= (FXMMATRIX M) noexcept +{ + r[0] = XMVectorAdd(r[0], M.r[0]); + r[1] = XMVectorAdd(r[1], M.r[1]); + r[2] = XMVectorAdd(r[2], M.r[2]); + r[3] = XMVectorAdd(r[3], M.r[3]); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XM_CALLCONV XMMATRIX::operator-= (FXMMATRIX M) noexcept +{ + r[0] = XMVectorSubtract(r[0], M.r[0]); + r[1] = XMVectorSubtract(r[1], M.r[1]); + r[2] = XMVectorSubtract(r[2], M.r[2]); + r[3] = XMVectorSubtract(r[3], M.r[3]); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XM_CALLCONV XMMATRIX::operator*=(FXMMATRIX M) noexcept +{ + *this = XMMatrixMultiply(*this, M); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XMMATRIX::operator*= (float S) noexcept +{ + r[0] = XMVectorScale(r[0], S); + r[1] = XMVectorScale(r[1], S); + r[2] = XMVectorScale(r[2], S); + r[3] = XMVectorScale(r[3], S); + return *this; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX& XMMATRIX::operator/= (float S) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vS = XMVectorReplicate(S); + r[0] = XMVectorDivide(r[0], vS); + r[1] = XMVectorDivide(r[1], vS); + r[2] = XMVectorDivide(r[2], vS); + r[3] = XMVectorDivide(r[3], vS); + return *this; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t vS = vdupq_n_f32(S); + r[0] = vdivq_f32(r[0], vS); + r[1] = vdivq_f32(r[1], vS); + r[2] = vdivq_f32(r[2], vS); + r[3] = vdivq_f32(r[3], vS); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x2_t vS = vdup_n_f32(S); + float32x2_t R0 = vrecpe_f32(vS); + float32x2_t S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + float32x4_t Reciprocal = vcombine_f32(R0, R0); + r[0] = vmulq_f32(r[0], Reciprocal); + r[1] = vmulq_f32(r[1], Reciprocal); + r[2] = vmulq_f32(r[2], Reciprocal); + r[3] = vmulq_f32(r[3], Reciprocal); +#endif + return *this; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 vS = _mm_set_ps1(S); + r[0] = _mm_div_ps(r[0], vS); + r[1] = _mm_div_ps(r[1], vS); + r[2] = _mm_div_ps(r[2], vS); + r[3] = _mm_div_ps(r[3], vS); + return *this; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMATRIX::operator+ (FXMMATRIX M) const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorAdd(r[0], M.r[0]); + R.r[1] = XMVectorAdd(r[1], M.r[1]); + R.r[2] = XMVectorAdd(r[2], M.r[2]); + R.r[3] = XMVectorAdd(r[3], M.r[3]); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMATRIX::operator- (FXMMATRIX M) const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorSubtract(r[0], M.r[0]); + R.r[1] = XMVectorSubtract(r[1], M.r[1]); + R.r[2] = XMVectorSubtract(r[2], M.r[2]); + R.r[3] = XMVectorSubtract(r[3], M.r[3]); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV XMMATRIX::operator*(FXMMATRIX M) const noexcept +{ + return XMMatrixMultiply(*this, M); +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XMMATRIX::operator* (float S) const noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorScale(r[0], S); + R.r[1] = XMVectorScale(r[1], S); + R.r[2] = XMVectorScale(r[2], S); + R.r[3] = XMVectorScale(r[3], S); + return R; +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XMMATRIX::operator/ (float S) const noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vS = XMVectorReplicate(S); + XMMATRIX R; + R.r[0] = XMVectorDivide(r[0], vS); + R.r[1] = XMVectorDivide(r[1], vS); + R.r[2] = XMVectorDivide(r[2], vS); + R.r[3] = XMVectorDivide(r[3], vS); + return R; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t vS = vdupq_n_f32(S); + XMMATRIX R; + R.r[0] = vdivq_f32(r[0], vS); + R.r[1] = vdivq_f32(r[1], vS); + R.r[2] = vdivq_f32(r[2], vS); + R.r[3] = vdivq_f32(r[3], vS); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x2_t vS = vdup_n_f32(S); + float32x2_t R0 = vrecpe_f32(vS); + float32x2_t S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + S0 = vrecps_f32(R0, vS); + R0 = vmul_f32(S0, R0); + float32x4_t Reciprocal = vcombine_f32(R0, R0); + XMMATRIX R; + R.r[0] = vmulq_f32(r[0], Reciprocal); + R.r[1] = vmulq_f32(r[1], Reciprocal); + R.r[2] = vmulq_f32(r[2], Reciprocal); + R.r[3] = vmulq_f32(r[3], Reciprocal); +#endif + return R; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 vS = _mm_set_ps1(S); + XMMATRIX R; + R.r[0] = _mm_div_ps(r[0], vS); + R.r[1] = _mm_div_ps(r[1], vS); + R.r[2] = _mm_div_ps(r[2], vS); + R.r[3] = _mm_div_ps(r[3], vS); + return R; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMMATRIX XM_CALLCONV operator* +( + float S, + FXMMATRIX M + ) noexcept +{ + XMMATRIX R; + R.r[0] = XMVectorScale(M.r[0], S); + R.r[1] = XMVectorScale(M.r[1], S); + R.r[2] = XMVectorScale(M.r[2], S); + R.r[3] = XMVectorScale(M.r[3], S); + return R; +} + +/**************************************************************************** + * + * XMFLOAT3X3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT3X3::XMFLOAT3X3(const float* pArray) noexcept +{ + assert(pArray != nullptr); + for (size_t Row = 0; Row < 3; Row++) + { + for (size_t Column = 0; Column < 3; Column++) + { + m[Row][Column] = pArray[Row * 3 + Column]; + } + } +} + +/**************************************************************************** + * + * XMFLOAT4X3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4X3::XMFLOAT4X3(const float* pArray) noexcept +{ + assert(pArray != nullptr); + + m[0][0] = pArray[0]; + m[0][1] = pArray[1]; + m[0][2] = pArray[2]; + + m[1][0] = pArray[3]; + m[1][1] = pArray[4]; + m[1][2] = pArray[5]; + + m[2][0] = pArray[6]; + m[2][1] = pArray[7]; + m[2][2] = pArray[8]; + + m[3][0] = pArray[9]; + m[3][1] = pArray[10]; + m[3][2] = pArray[11]; +} + +/**************************************************************************** +* +* XMFLOAT3X4 operators +* +****************************************************************************/ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT3X4::XMFLOAT3X4(const float* pArray) noexcept +{ + assert(pArray != nullptr); + + m[0][0] = pArray[0]; + m[0][1] = pArray[1]; + m[0][2] = pArray[2]; + m[0][3] = pArray[3]; + + m[1][0] = pArray[4]; + m[1][1] = pArray[5]; + m[1][2] = pArray[6]; + m[1][3] = pArray[7]; + + m[2][0] = pArray[8]; + m[2][1] = pArray[9]; + m[2][2] = pArray[10]; + m[2][3] = pArray[11]; +} + +/**************************************************************************** + * + * XMFLOAT4X4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4X4::XMFLOAT4X4(const float* pArray) noexcept +{ + assert(pArray != nullptr); + + m[0][0] = pArray[0]; + m[0][1] = pArray[1]; + m[0][2] = pArray[2]; + m[0][3] = pArray[3]; + + m[1][0] = pArray[4]; + m[1][1] = pArray[5]; + m[1][2] = pArray[6]; + m[1][3] = pArray[7]; + + m[2][0] = pArray[8]; + m[2][1] = pArray[9]; + m[2][2] = pArray[10]; + m[2][3] = pArray[11]; + + m[3][0] = pArray[12]; + m[3][1] = pArray[13]; + m[3][2] = pArray[14]; + m[3][3] = pArray[15]; +} + diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathMisc.inl b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathMisc.inl similarity index 96% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathMisc.inl rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathMisc.inl index c019b3d14..7a21dc8b8 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathMisc.inl +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathMisc.inl @@ -1,2493 +1,2493 @@ -//------------------------------------------------------------------------------------- -// DirectXMathMisc.inl -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -/**************************************************************************** - * - * Quaternion - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMQuaternionEqual -( - FXMVECTOR Q1, - FXMVECTOR Q2 -) noexcept -{ - return XMVector4Equal(Q1, Q2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMQuaternionNotEqual -( - FXMVECTOR Q1, - FXMVECTOR Q2 -) noexcept -{ - return XMVector4NotEqual(Q1, Q2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMQuaternionIsNaN(FXMVECTOR Q) noexcept -{ - return XMVector4IsNaN(Q); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMQuaternionIsInfinite(FXMVECTOR Q) noexcept -{ - return XMVector4IsInfinite(Q); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMQuaternionIsIdentity(FXMVECTOR Q) noexcept -{ - return XMVector4Equal(Q, g_XMIdentityR3.v); -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionDot -( - FXMVECTOR Q1, - FXMVECTOR Q2 -) noexcept -{ - return XMVector4Dot(Q1, Q2); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionMultiply -( - FXMVECTOR Q1, - FXMVECTOR Q2 -) noexcept -{ - // Returns the product Q2*Q1 (which is the concatenation of a rotation Q1 followed by the rotation Q2) - - // [ (Q2.w * Q1.x) + (Q2.x * Q1.w) + (Q2.y * Q1.z) - (Q2.z * Q1.y), - // (Q2.w * Q1.y) - (Q2.x * Q1.z) + (Q2.y * Q1.w) + (Q2.z * Q1.x), - // (Q2.w * Q1.z) + (Q2.x * Q1.y) - (Q2.y * Q1.x) + (Q2.z * Q1.w), - // (Q2.w * Q1.w) - (Q2.x * Q1.x) - (Q2.y * Q1.y) - (Q2.z * Q1.z) ] - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - (Q2.vector4_f32[3] * Q1.vector4_f32[0]) + (Q2.vector4_f32[0] * Q1.vector4_f32[3]) + (Q2.vector4_f32[1] * Q1.vector4_f32[2]) - (Q2.vector4_f32[2] * Q1.vector4_f32[1]), - (Q2.vector4_f32[3] * Q1.vector4_f32[1]) - (Q2.vector4_f32[0] * Q1.vector4_f32[2]) + (Q2.vector4_f32[1] * Q1.vector4_f32[3]) + (Q2.vector4_f32[2] * Q1.vector4_f32[0]), - (Q2.vector4_f32[3] * Q1.vector4_f32[2]) + (Q2.vector4_f32[0] * Q1.vector4_f32[1]) - (Q2.vector4_f32[1] * Q1.vector4_f32[0]) + (Q2.vector4_f32[2] * Q1.vector4_f32[3]), - (Q2.vector4_f32[3] * Q1.vector4_f32[3]) - (Q2.vector4_f32[0] * Q1.vector4_f32[0]) - (Q2.vector4_f32[1] * Q1.vector4_f32[1]) - (Q2.vector4_f32[2] * Q1.vector4_f32[2]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 ControlWZYX = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; - static const XMVECTORF32 ControlZWXY = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; - static const XMVECTORF32 ControlYXWZ = { { { -1.0f, 1.0f, 1.0f, -1.0f } } }; - - float32x2_t Q2L = vget_low_f32(Q2); - float32x2_t Q2H = vget_high_f32(Q2); - - float32x4_t Q2X = vdupq_lane_f32(Q2L, 0); - float32x4_t Q2Y = vdupq_lane_f32(Q2L, 1); - float32x4_t Q2Z = vdupq_lane_f32(Q2H, 0); - XMVECTOR vResult = vmulq_lane_f32(Q1, Q2H, 1); - - // Mul by Q1WZYX - float32x4_t vTemp = vrev64q_f32(Q1); - vTemp = vcombine_f32(vget_high_f32(vTemp), vget_low_f32(vTemp)); - Q2X = vmulq_f32(Q2X, vTemp); - vResult = vmlaq_f32(vResult, Q2X, ControlWZYX); - - // Mul by Q1ZWXY - vTemp = vreinterpretq_f32_u32(vrev64q_u32(vreinterpretq_u32_f32(vTemp))); - Q2Y = vmulq_f32(Q2Y, vTemp); - vResult = vmlaq_f32(vResult, Q2Y, ControlZWXY); - - // Mul by Q1YXWZ - vTemp = vreinterpretq_f32_u32(vrev64q_u32(vreinterpretq_u32_f32(vTemp))); - vTemp = vcombine_f32(vget_high_f32(vTemp), vget_low_f32(vTemp)); - Q2Z = vmulq_f32(Q2Z, vTemp); - vResult = vmlaq_f32(vResult, Q2Z, ControlYXWZ); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ControlWZYX = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; - static const XMVECTORF32 ControlZWXY = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; - static const XMVECTORF32 ControlYXWZ = { { { -1.0f, 1.0f, 1.0f, -1.0f } } }; - // Copy to SSE registers and use as few as possible for x86 - XMVECTOR Q2X = Q2; - XMVECTOR Q2Y = Q2; - XMVECTOR Q2Z = Q2; - XMVECTOR vResult = Q2; - // Splat with one instruction - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 3, 3, 3)); - Q2X = XM_PERMUTE_PS(Q2X, _MM_SHUFFLE(0, 0, 0, 0)); - Q2Y = XM_PERMUTE_PS(Q2Y, _MM_SHUFFLE(1, 1, 1, 1)); - Q2Z = XM_PERMUTE_PS(Q2Z, _MM_SHUFFLE(2, 2, 2, 2)); - // Retire Q1 and perform Q1*Q2W - vResult = _mm_mul_ps(vResult, Q1); - XMVECTOR Q1Shuffle = Q1; - // Shuffle the copies of Q1 - Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(0, 1, 2, 3)); - // Mul by Q1WZYX - Q2X = _mm_mul_ps(Q2X, Q1Shuffle); - Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(2, 3, 0, 1)); - // Flip the signs on y and z - vResult = XM_FMADD_PS(Q2X, ControlWZYX, vResult); - // Mul by Q1ZWXY - Q2Y = _mm_mul_ps(Q2Y, Q1Shuffle); - Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(0, 1, 2, 3)); - // Flip the signs on z and w - Q2Y = _mm_mul_ps(Q2Y, ControlZWXY); - // Mul by Q1YXWZ - Q2Z = _mm_mul_ps(Q2Z, Q1Shuffle); - // Flip the signs on x and w - Q2Y = XM_FMADD_PS(Q2Z, ControlYXWZ, Q2Y); - vResult = _mm_add_ps(vResult, Q2Y); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionLengthSq(FXMVECTOR Q) noexcept -{ - return XMVector4LengthSq(Q); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionReciprocalLength(FXMVECTOR Q) noexcept -{ - return XMVector4ReciprocalLength(Q); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionLength(FXMVECTOR Q) noexcept -{ - return XMVector4Length(Q); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionNormalizeEst(FXMVECTOR Q) noexcept -{ - return XMVector4NormalizeEst(Q); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionNormalize(FXMVECTOR Q) noexcept -{ - return XMVector4Normalize(Q); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionConjugate(FXMVECTOR Q) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - -Q.vector4_f32[0], - -Q.vector4_f32[1], - -Q.vector4_f32[2], - Q.vector4_f32[3] - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 NegativeOne3 = { { { -1.0f, -1.0f, -1.0f, 1.0f } } }; - return vmulq_f32(Q, NegativeOne3.v); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 NegativeOne3 = { { { -1.0f, -1.0f, -1.0f, 1.0f } } }; - return _mm_mul_ps(Q, NegativeOne3); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionInverse(FXMVECTOR Q) noexcept -{ - XMVECTOR L = XMVector4LengthSq(Q); - XMVECTOR Conjugate = XMQuaternionConjugate(Q); - - XMVECTOR Control = XMVectorLessOrEqual(L, g_XMEpsilon.v); - - XMVECTOR Result = XMVectorDivide(Conjugate, L); - - Result = XMVectorSelect(Result, g_XMZero, Control); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionLn(FXMVECTOR Q) noexcept -{ - static const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; - - XMVECTOR QW = XMVectorSplatW(Q); - XMVECTOR Q0 = XMVectorSelect(g_XMSelect1110.v, Q, g_XMSelect1110.v); - - XMVECTOR ControlW = XMVectorInBounds(QW, OneMinusEpsilon.v); - - XMVECTOR Theta = XMVectorACos(QW); - XMVECTOR SinTheta = XMVectorSin(Theta); - - XMVECTOR S = XMVectorDivide(Theta, SinTheta); - - XMVECTOR Result = XMVectorMultiply(Q0, S); - Result = XMVectorSelect(Q0, Result, ControlW); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionExp(FXMVECTOR Q) noexcept -{ - XMVECTOR Theta = XMVector3Length(Q); - - XMVECTOR SinTheta, CosTheta; - XMVectorSinCos(&SinTheta, &CosTheta, Theta); - - XMVECTOR S = XMVectorDivide(SinTheta, Theta); - - XMVECTOR Result = XMVectorMultiply(Q, S); - - const XMVECTOR Zero = XMVectorZero(); - XMVECTOR Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon.v); - Result = XMVectorSelect(Result, Q, Control); - - Result = XMVectorSelect(CosTheta, Result, g_XMSelect1110.v); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionSlerp -( - FXMVECTOR Q0, - FXMVECTOR Q1, - float t -) noexcept -{ - XMVECTOR T = XMVectorReplicate(t); - return XMQuaternionSlerpV(Q0, Q1, T); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionSlerpV -( - FXMVECTOR Q0, - FXMVECTOR Q1, - FXMVECTOR T -) noexcept -{ - assert((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); - - // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) - -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; - - XMVECTOR CosOmega = XMQuaternionDot(Q0, Q1); - - const XMVECTOR Zero = XMVectorZero(); - XMVECTOR Control = XMVectorLess(CosOmega, Zero); - XMVECTOR Sign = XMVectorSelect(g_XMOne.v, g_XMNegativeOne.v, Control); - - CosOmega = XMVectorMultiply(CosOmega, Sign); - - Control = XMVectorLess(CosOmega, OneMinusEpsilon); - - XMVECTOR SinOmega = XMVectorNegativeMultiplySubtract(CosOmega, CosOmega, g_XMOne.v); - SinOmega = XMVectorSqrt(SinOmega); - - XMVECTOR Omega = XMVectorATan2(SinOmega, CosOmega); - - XMVECTOR SignMask = XMVectorSplatSignMask(); - XMVECTOR V01 = XMVectorShiftLeft(T, Zero, 2); - SignMask = XMVectorShiftLeft(SignMask, Zero, 3); - V01 = XMVectorXorInt(V01, SignMask); - V01 = XMVectorAdd(g_XMIdentityR0.v, V01); - - XMVECTOR InvSinOmega = XMVectorReciprocal(SinOmega); - - XMVECTOR S0 = XMVectorMultiply(V01, Omega); - S0 = XMVectorSin(S0); - S0 = XMVectorMultiply(S0, InvSinOmega); - - S0 = XMVectorSelect(V01, S0, Control); - - XMVECTOR S1 = XMVectorSplatY(S0); - S0 = XMVectorSplatX(S0); - - S1 = XMVectorMultiply(S1, Sign); - - XMVECTOR Result = XMVectorMultiply(Q0, S0); - Result = XMVectorMultiplyAdd(Q1, S1, Result); - - return Result; - -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; - static const XMVECTORU32 SignMask2 = { { { 0x80000000, 0x00000000, 0x00000000, 0x00000000 } } }; - - XMVECTOR CosOmega = XMQuaternionDot(Q0, Q1); - - const XMVECTOR Zero = XMVectorZero(); - XMVECTOR Control = XMVectorLess(CosOmega, Zero); - XMVECTOR Sign = XMVectorSelect(g_XMOne, g_XMNegativeOne, Control); - - CosOmega = _mm_mul_ps(CosOmega, Sign); - - Control = XMVectorLess(CosOmega, OneMinusEpsilon); - - XMVECTOR SinOmega = _mm_mul_ps(CosOmega, CosOmega); - SinOmega = _mm_sub_ps(g_XMOne, SinOmega); - SinOmega = _mm_sqrt_ps(SinOmega); - - XMVECTOR Omega = XMVectorATan2(SinOmega, CosOmega); - - XMVECTOR V01 = XM_PERMUTE_PS(T, _MM_SHUFFLE(2, 3, 0, 1)); - V01 = _mm_and_ps(V01, g_XMMaskXY); - V01 = _mm_xor_ps(V01, SignMask2); - V01 = _mm_add_ps(g_XMIdentityR0, V01); - - XMVECTOR S0 = _mm_mul_ps(V01, Omega); - S0 = XMVectorSin(S0); - S0 = _mm_div_ps(S0, SinOmega); - - S0 = XMVectorSelect(V01, S0, Control); - - XMVECTOR S1 = XMVectorSplatY(S0); - S0 = XMVectorSplatX(S0); - - S1 = _mm_mul_ps(S1, Sign); - XMVECTOR Result = _mm_mul_ps(Q0, S0); - S1 = _mm_mul_ps(S1, Q1); - Result = _mm_add_ps(Result, S1); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionSquad -( - FXMVECTOR Q0, - FXMVECTOR Q1, - FXMVECTOR Q2, - GXMVECTOR Q3, - float t -) noexcept -{ - XMVECTOR T = XMVectorReplicate(t); - return XMQuaternionSquadV(Q0, Q1, Q2, Q3, T); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionSquadV -( - FXMVECTOR Q0, - FXMVECTOR Q1, - FXMVECTOR Q2, - GXMVECTOR Q3, - HXMVECTOR T -) noexcept -{ - assert((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); - - XMVECTOR TP = T; - const XMVECTOR Two = XMVectorSplatConstant(2, 0); - - XMVECTOR Q03 = XMQuaternionSlerpV(Q0, Q3, T); - XMVECTOR Q12 = XMQuaternionSlerpV(Q1, Q2, T); - - TP = XMVectorNegativeMultiplySubtract(TP, TP, TP); - TP = XMVectorMultiply(TP, Two); - - XMVECTOR Result = XMQuaternionSlerpV(Q03, Q12, TP); - - return Result; -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMQuaternionSquadSetup -( - XMVECTOR* pA, - XMVECTOR* pB, - XMVECTOR* pC, - FXMVECTOR Q0, - FXMVECTOR Q1, - FXMVECTOR Q2, - GXMVECTOR Q3 -) noexcept -{ - assert(pA); - assert(pB); - assert(pC); - - XMVECTOR LS12 = XMQuaternionLengthSq(XMVectorAdd(Q1, Q2)); - XMVECTOR LD12 = XMQuaternionLengthSq(XMVectorSubtract(Q1, Q2)); - XMVECTOR SQ2 = XMVectorNegate(Q2); - - XMVECTOR Control1 = XMVectorLess(LS12, LD12); - SQ2 = XMVectorSelect(Q2, SQ2, Control1); - - XMVECTOR LS01 = XMQuaternionLengthSq(XMVectorAdd(Q0, Q1)); - XMVECTOR LD01 = XMQuaternionLengthSq(XMVectorSubtract(Q0, Q1)); - XMVECTOR SQ0 = XMVectorNegate(Q0); - - XMVECTOR LS23 = XMQuaternionLengthSq(XMVectorAdd(SQ2, Q3)); - XMVECTOR LD23 = XMQuaternionLengthSq(XMVectorSubtract(SQ2, Q3)); - XMVECTOR SQ3 = XMVectorNegate(Q3); - - XMVECTOR Control0 = XMVectorLess(LS01, LD01); - XMVECTOR Control2 = XMVectorLess(LS23, LD23); - - SQ0 = XMVectorSelect(Q0, SQ0, Control0); - SQ3 = XMVectorSelect(Q3, SQ3, Control2); - - XMVECTOR InvQ1 = XMQuaternionInverse(Q1); - XMVECTOR InvQ2 = XMQuaternionInverse(SQ2); - - XMVECTOR LnQ0 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ0)); - XMVECTOR LnQ2 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ2)); - XMVECTOR LnQ1 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, Q1)); - XMVECTOR LnQ3 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, SQ3)); - - const XMVECTOR NegativeOneQuarter = XMVectorSplatConstant(-1, 2); - - XMVECTOR ExpQ02 = XMVectorMultiply(XMVectorAdd(LnQ0, LnQ2), NegativeOneQuarter); - XMVECTOR ExpQ13 = XMVectorMultiply(XMVectorAdd(LnQ1, LnQ3), NegativeOneQuarter); - ExpQ02 = XMQuaternionExp(ExpQ02); - ExpQ13 = XMQuaternionExp(ExpQ13); - - *pA = XMQuaternionMultiply(Q1, ExpQ02); - *pB = XMQuaternionMultiply(SQ2, ExpQ13); - *pC = SQ2; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionBaryCentric -( - FXMVECTOR Q0, - FXMVECTOR Q1, - FXMVECTOR Q2, - float f, - float g -) noexcept -{ - float s = f + g; - - XMVECTOR Result; - if ((s < 0.00001f) && (s > -0.00001f)) - { - Result = Q0; - } - else - { - XMVECTOR Q01 = XMQuaternionSlerp(Q0, Q1, s); - XMVECTOR Q02 = XMQuaternionSlerp(Q0, Q2, s); - - Result = XMQuaternionSlerp(Q01, Q02, g / s); - } - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionBaryCentricV -( - FXMVECTOR Q0, - FXMVECTOR Q1, - FXMVECTOR Q2, - GXMVECTOR F, - HXMVECTOR G -) noexcept -{ - assert((XMVectorGetY(F) == XMVectorGetX(F)) && (XMVectorGetZ(F) == XMVectorGetX(F)) && (XMVectorGetW(F) == XMVectorGetX(F))); - assert((XMVectorGetY(G) == XMVectorGetX(G)) && (XMVectorGetZ(G) == XMVectorGetX(G)) && (XMVectorGetW(G) == XMVectorGetX(G))); - - const XMVECTOR Epsilon = XMVectorSplatConstant(1, 16); - - XMVECTOR S = XMVectorAdd(F, G); - - XMVECTOR Result; - if (XMVector4InBounds(S, Epsilon)) - { - Result = Q0; - } - else - { - XMVECTOR Q01 = XMQuaternionSlerpV(Q0, Q1, S); - XMVECTOR Q02 = XMQuaternionSlerpV(Q0, Q2, S); - XMVECTOR GS = XMVectorReciprocal(S); - GS = XMVectorMultiply(G, GS); - - Result = XMQuaternionSlerpV(Q01, Q02, GS); - } - - return Result; -} - -//------------------------------------------------------------------------------ -// Transformation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionIdentity() noexcept -{ - return g_XMIdentityR3.v; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYaw -( - float Pitch, - float Yaw, - float Roll -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - const float halfpitch = Pitch * 0.5f; - float cp = cosf(halfpitch); - float sp = sinf(halfpitch); - - const float halfyaw = Yaw * 0.5f; - float cy = cosf(halfyaw); - float sy = sinf(halfyaw); - - const float halfroll = Roll * 0.5f; - float cr = cosf(halfroll); - float sr = sinf(halfroll); - - XMVECTORF32 vResult = { { { - cr * sp * cy + sr * cp * sy, - cr * cp * sy - sr * sp * cy, - sr * cp * cy - cr * sp * sy, - cr * cp * cy + sr * sp * sy - } } }; - return vResult; -#else - XMVECTOR Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); - return XMQuaternionRotationRollPitchYawFromVector(Angles); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYawFromVector -( - FXMVECTOR Angles // -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - const float halfpitch = Angles.vector4_f32[0] * 0.5f; - float cp = cosf(halfpitch); - float sp = sinf(halfpitch); - - const float halfyaw = Angles.vector4_f32[1] * 0.5f; - float cy = cosf(halfyaw); - float sy = sinf(halfyaw); - - const float halfroll = Angles.vector4_f32[2] * 0.5f; - float cr = cosf(halfroll); - float sr = sinf(halfroll); - - XMVECTORF32 vResult = { { { - cr * sp * cy + sr * cp * sy, - cr * cp * sy - sr * sp * cy, - sr * cp * cy - cr * sp * sy, - cr * cp * cy + sr * sp * sy - } } }; - return vResult; -#else - static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, -1.0f, 1.0f } } }; - - XMVECTOR HalfAngles = XMVectorMultiply(Angles, g_XMOneHalf.v); - - XMVECTOR SinAngles, CosAngles; - XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); - - XMVECTOR P0 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR Y0 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR R0 = XMVectorPermute(SinAngles, CosAngles); - XMVECTOR P1 = XMVectorPermute(CosAngles, SinAngles); - XMVECTOR Y1 = XMVectorPermute(CosAngles, SinAngles); - XMVECTOR R1 = XMVectorPermute(CosAngles, SinAngles); - - XMVECTOR Q1 = XMVectorMultiply(P1, Sign.v); - XMVECTOR Q0 = XMVectorMultiply(P0, Y0); - Q1 = XMVectorMultiply(Q1, Y1); - Q0 = XMVectorMultiply(Q0, R0); - XMVECTOR Q = XMVectorMultiplyAdd(Q1, R1, Q0); - - return Q; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionRotationNormal -( - FXMVECTOR NormalAxis, - float Angle -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - XMVECTOR N = XMVectorSelect(g_XMOne.v, NormalAxis, g_XMSelect1110.v); - - float SinV, CosV; - XMScalarSinCos(&SinV, &CosV, 0.5f * Angle); - - XMVECTOR Scale = XMVectorSet(SinV, SinV, SinV, CosV); - return XMVectorMultiply(N, Scale); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR N = _mm_and_ps(NormalAxis, g_XMMask3); - N = _mm_or_ps(N, g_XMIdentityR3); - XMVECTOR Scale = _mm_set_ps1(0.5f * Angle); - XMVECTOR vSine; - XMVECTOR vCosine; - XMVectorSinCos(&vSine, &vCosine, Scale); - Scale = _mm_and_ps(vSine, g_XMMask3); - vCosine = _mm_and_ps(vCosine, g_XMMaskW); - Scale = _mm_or_ps(Scale, vCosine); - N = _mm_mul_ps(N, Scale); - return N; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionRotationAxis -( - FXMVECTOR Axis, - float Angle -) noexcept -{ - assert(!XMVector3Equal(Axis, XMVectorZero())); - assert(!XMVector3IsInfinite(Axis)); - - XMVECTOR Normal = XMVector3Normalize(Axis); - XMVECTOR Q = XMQuaternionRotationNormal(Normal, Angle); - return Q; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMQuaternionRotationMatrix(FXMMATRIX M) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 q; - float r22 = M.m[2][2]; - if (r22 <= 0.f) // x^2 + y^2 >= z^2 + w^2 - { - float dif10 = M.m[1][1] - M.m[0][0]; - float omr22 = 1.f - r22; - if (dif10 <= 0.f) // x^2 >= y^2 - { - float fourXSqr = omr22 - dif10; - float inv4x = 0.5f / sqrtf(fourXSqr); - q.f[0] = fourXSqr * inv4x; - q.f[1] = (M.m[0][1] + M.m[1][0]) * inv4x; - q.f[2] = (M.m[0][2] + M.m[2][0]) * inv4x; - q.f[3] = (M.m[1][2] - M.m[2][1]) * inv4x; - } - else // y^2 >= x^2 - { - float fourYSqr = omr22 + dif10; - float inv4y = 0.5f / sqrtf(fourYSqr); - q.f[0] = (M.m[0][1] + M.m[1][0]) * inv4y; - q.f[1] = fourYSqr * inv4y; - q.f[2] = (M.m[1][2] + M.m[2][1]) * inv4y; - q.f[3] = (M.m[2][0] - M.m[0][2]) * inv4y; - } - } - else // z^2 + w^2 >= x^2 + y^2 - { - float sum10 = M.m[1][1] + M.m[0][0]; - float opr22 = 1.f + r22; - if (sum10 <= 0.f) // z^2 >= w^2 - { - float fourZSqr = opr22 - sum10; - float inv4z = 0.5f / sqrtf(fourZSqr); - q.f[0] = (M.m[0][2] + M.m[2][0]) * inv4z; - q.f[1] = (M.m[1][2] + M.m[2][1]) * inv4z; - q.f[2] = fourZSqr * inv4z; - q.f[3] = (M.m[0][1] - M.m[1][0]) * inv4z; - } - else // w^2 >= z^2 - { - float fourWSqr = opr22 + sum10; - float inv4w = 0.5f / sqrtf(fourWSqr); - q.f[0] = (M.m[1][2] - M.m[2][1]) * inv4w; - q.f[1] = (M.m[2][0] - M.m[0][2]) * inv4w; - q.f[2] = (M.m[0][1] - M.m[1][0]) * inv4w; - q.f[3] = fourWSqr * inv4w; - } - } - return q.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 XMPMMP = { { { +1.0f, -1.0f, -1.0f, +1.0f } } }; - static const XMVECTORF32 XMMPMP = { { { -1.0f, +1.0f, -1.0f, +1.0f } } }; - static const XMVECTORF32 XMMMPP = { { { -1.0f, -1.0f, +1.0f, +1.0f } } }; - static const XMVECTORU32 Select0110 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0 } } }; - static const XMVECTORU32 Select0010 = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; - - float32x4_t r0 = M.r[0]; - float32x4_t r1 = M.r[1]; - float32x4_t r2 = M.r[2]; - - float32x4_t r00 = vdupq_lane_f32(vget_low_f32(r0), 0); - float32x4_t r11 = vdupq_lane_f32(vget_low_f32(r1), 1); - float32x4_t r22 = vdupq_lane_f32(vget_high_f32(r2), 0); - - // x^2 >= y^2 equivalent to r11 - r00 <= 0 - float32x4_t r11mr00 = vsubq_f32(r11, r00); - uint32x4_t x2gey2 = vcleq_f32(r11mr00, g_XMZero); - - // z^2 >= w^2 equivalent to r11 + r00 <= 0 - float32x4_t r11pr00 = vaddq_f32(r11, r00); - uint32x4_t z2gew2 = vcleq_f32(r11pr00, g_XMZero); - - // x^2 + y^2 >= z^2 + w^2 equivalent to r22 <= 0 - uint32x4_t x2py2gez2pw2 = vcleq_f32(r22, g_XMZero); - - // (4*x^2, 4*y^2, 4*z^2, 4*w^2) - float32x4_t t0 = vmulq_f32(XMPMMP, r00); - float32x4_t x2y2z2w2 = vmlaq_f32(t0, XMMPMP, r11); - x2y2z2w2 = vmlaq_f32(x2y2z2w2, XMMMPP, r22); - x2y2z2w2 = vaddq_f32(x2y2z2w2, g_XMOne); - - // (r01, r02, r12, r11) - t0 = vextq_f32(r0, r0, 1); - float32x4_t t1 = vextq_f32(r1, r1, 1); - t0 = vcombine_f32(vget_low_f32(t0), vrev64_f32(vget_low_f32(t1))); - - // (r10, r20, r21, r10) - t1 = vextq_f32(r2, r2, 3); - float32x4_t r10 = vdupq_lane_f32(vget_low_f32(r1), 0); - t1 = vbslq_f32(Select0110, t1, r10); - - // (4*x*y, 4*x*z, 4*y*z, unused) - float32x4_t xyxzyz = vaddq_f32(t0, t1); - - // (r21, r20, r10, r10) - t0 = vcombine_f32(vrev64_f32(vget_low_f32(r2)), vget_low_f32(r10)); - - // (r12, r02, r01, r12) - float32x4_t t2 = vcombine_f32(vrev64_f32(vget_high_f32(r0)), vrev64_f32(vget_low_f32(r0))); - float32x4_t t3 = vdupq_lane_f32(vget_high_f32(r1), 0); - t1 = vbslq_f32(Select0110, t2, t3); - - // (4*x*w, 4*y*w, 4*z*w, unused) - float32x4_t xwywzw = vsubq_f32(t0, t1); - xwywzw = vmulq_f32(XMMPMP, xwywzw); - - // (4*x*x, 4*x*y, 4*x*z, 4*x*w) - t0 = vextq_f32(xyxzyz, xyxzyz, 3); - t1 = vbslq_f32(Select0110, t0, x2y2z2w2); - t2 = vdupq_lane_f32(vget_low_f32(xwywzw), 0); - float32x4_t tensor0 = vbslq_f32(g_XMSelect1110, t1, t2); - - // (4*y*x, 4*y*y, 4*y*z, 4*y*w) - t0 = vbslq_f32(g_XMSelect1011, xyxzyz, x2y2z2w2); - t1 = vdupq_lane_f32(vget_low_f32(xwywzw), 1); - float32x4_t tensor1 = vbslq_f32(g_XMSelect1110, t0, t1); - - // (4*z*x, 4*z*y, 4*z*z, 4*z*w) - t0 = vextq_f32(xyxzyz, xyxzyz, 1); - t1 = vcombine_f32(vget_low_f32(t0), vrev64_f32(vget_high_f32(xwywzw))); - float32x4_t tensor2 = vbslq_f32(Select0010, x2y2z2w2, t1); - - // (4*w*x, 4*w*y, 4*w*z, 4*w*w) - float32x4_t tensor3 = vbslq_f32(g_XMSelect1110, xwywzw, x2y2z2w2); - - // Select the row of the tensor-product matrix that has the largest - // magnitude. - t0 = vbslq_f32(x2gey2, tensor0, tensor1); - t1 = vbslq_f32(z2gew2, tensor2, tensor3); - t2 = vbslq_f32(x2py2gez2pw2, t0, t1); - - // Normalize the row. No division by zero is possible because the - // quaternion is unit-length (and the row is a nonzero multiple of - // the quaternion). - t0 = XMVector4Length(t2); - return XMVectorDivide(t2, t0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 XMPMMP = { { { +1.0f, -1.0f, -1.0f, +1.0f } } }; - static const XMVECTORF32 XMMPMP = { { { -1.0f, +1.0f, -1.0f, +1.0f } } }; - static const XMVECTORF32 XMMMPP = { { { -1.0f, -1.0f, +1.0f, +1.0f } } }; - - XMVECTOR r0 = M.r[0]; // (r00, r01, r02, 0) - XMVECTOR r1 = M.r[1]; // (r10, r11, r12, 0) - XMVECTOR r2 = M.r[2]; // (r20, r21, r22, 0) - - // (r00, r00, r00, r00) - XMVECTOR r00 = XM_PERMUTE_PS(r0, _MM_SHUFFLE(0, 0, 0, 0)); - // (r11, r11, r11, r11) - XMVECTOR r11 = XM_PERMUTE_PS(r1, _MM_SHUFFLE(1, 1, 1, 1)); - // (r22, r22, r22, r22) - XMVECTOR r22 = XM_PERMUTE_PS(r2, _MM_SHUFFLE(2, 2, 2, 2)); - - // x^2 >= y^2 equivalent to r11 - r00 <= 0 - // (r11 - r00, r11 - r00, r11 - r00, r11 - r00) - XMVECTOR r11mr00 = _mm_sub_ps(r11, r00); - XMVECTOR x2gey2 = _mm_cmple_ps(r11mr00, g_XMZero); - - // z^2 >= w^2 equivalent to r11 + r00 <= 0 - // (r11 + r00, r11 + r00, r11 + r00, r11 + r00) - XMVECTOR r11pr00 = _mm_add_ps(r11, r00); - XMVECTOR z2gew2 = _mm_cmple_ps(r11pr00, g_XMZero); - - // x^2 + y^2 >= z^2 + w^2 equivalent to r22 <= 0 - XMVECTOR x2py2gez2pw2 = _mm_cmple_ps(r22, g_XMZero); - - // (4*x^2, 4*y^2, 4*z^2, 4*w^2) - XMVECTOR t0 = XM_FMADD_PS(XMPMMP, r00, g_XMOne); - XMVECTOR t1 = _mm_mul_ps(XMMPMP, r11); - XMVECTOR t2 = XM_FMADD_PS(XMMMPP, r22, t0); - XMVECTOR x2y2z2w2 = _mm_add_ps(t1, t2); - - // (r01, r02, r12, r11) - t0 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(1, 2, 2, 1)); - // (r10, r10, r20, r21) - t1 = _mm_shuffle_ps(r1, r2, _MM_SHUFFLE(1, 0, 0, 0)); - // (r10, r20, r21, r10) - t1 = XM_PERMUTE_PS(t1, _MM_SHUFFLE(1, 3, 2, 0)); - // (4*x*y, 4*x*z, 4*y*z, unused) - XMVECTOR xyxzyz = _mm_add_ps(t0, t1); - - // (r21, r20, r10, r10) - t0 = _mm_shuffle_ps(r2, r1, _MM_SHUFFLE(0, 0, 0, 1)); - // (r12, r12, r02, r01) - t1 = _mm_shuffle_ps(r1, r0, _MM_SHUFFLE(1, 2, 2, 2)); - // (r12, r02, r01, r12) - t1 = XM_PERMUTE_PS(t1, _MM_SHUFFLE(1, 3, 2, 0)); - // (4*x*w, 4*y*w, 4*z*w, unused) - XMVECTOR xwywzw = _mm_sub_ps(t0, t1); - xwywzw = _mm_mul_ps(XMMPMP, xwywzw); - - // (4*x^2, 4*y^2, 4*x*y, unused) - t0 = _mm_shuffle_ps(x2y2z2w2, xyxzyz, _MM_SHUFFLE(0, 0, 1, 0)); - // (4*z^2, 4*w^2, 4*z*w, unused) - t1 = _mm_shuffle_ps(x2y2z2w2, xwywzw, _MM_SHUFFLE(0, 2, 3, 2)); - // (4*x*z, 4*y*z, 4*x*w, 4*y*w) - t2 = _mm_shuffle_ps(xyxzyz, xwywzw, _MM_SHUFFLE(1, 0, 2, 1)); - - // (4*x*x, 4*x*y, 4*x*z, 4*x*w) - XMVECTOR tensor0 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0)); - // (4*y*x, 4*y*y, 4*y*z, 4*y*w) - XMVECTOR tensor1 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 1, 2)); - // (4*z*x, 4*z*y, 4*z*z, 4*z*w) - XMVECTOR tensor2 = _mm_shuffle_ps(t2, t1, _MM_SHUFFLE(2, 0, 1, 0)); - // (4*w*x, 4*w*y, 4*w*z, 4*w*w) - XMVECTOR tensor3 = _mm_shuffle_ps(t2, t1, _MM_SHUFFLE(1, 2, 3, 2)); - - // Select the row of the tensor-product matrix that has the largest - // magnitude. - t0 = _mm_and_ps(x2gey2, tensor0); - t1 = _mm_andnot_ps(x2gey2, tensor1); - t0 = _mm_or_ps(t0, t1); - t1 = _mm_and_ps(z2gew2, tensor2); - t2 = _mm_andnot_ps(z2gew2, tensor3); - t1 = _mm_or_ps(t1, t2); - t0 = _mm_and_ps(x2py2gez2pw2, t0); - t1 = _mm_andnot_ps(x2py2gez2pw2, t1); - t2 = _mm_or_ps(t0, t1); - - // Normalize the row. No division by zero is possible because the - // quaternion is unit-length (and the row is a nonzero multiple of - // the quaternion). - t0 = XMVector4Length(t2); - return _mm_div_ps(t2, t0); -#endif -} - -//------------------------------------------------------------------------------ -// Conversion operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMQuaternionToAxisAngle -( - XMVECTOR* pAxis, - float* pAngle, - FXMVECTOR Q -) noexcept -{ - assert(pAxis); - assert(pAngle); - - *pAxis = Q; - - *pAngle = 2.0f * XMScalarACos(XMVectorGetW(Q)); -} - -/**************************************************************************** - * - * Plane - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMPlaneEqual -( - FXMVECTOR P1, - FXMVECTOR P2 -) noexcept -{ - return XMVector4Equal(P1, P2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMPlaneNearEqual -( - FXMVECTOR P1, - FXMVECTOR P2, - FXMVECTOR Epsilon -) noexcept -{ - XMVECTOR NP1 = XMPlaneNormalize(P1); - XMVECTOR NP2 = XMPlaneNormalize(P2); - return XMVector4NearEqual(NP1, NP2, Epsilon); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMPlaneNotEqual -( - FXMVECTOR P1, - FXMVECTOR P2 -) noexcept -{ - return XMVector4NotEqual(P1, P2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMPlaneIsNaN(FXMVECTOR P) noexcept -{ - return XMVector4IsNaN(P); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMPlaneIsInfinite(FXMVECTOR P) noexcept -{ - return XMVector4IsInfinite(P); -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneDot -( - FXMVECTOR P, - FXMVECTOR V -) noexcept -{ - return XMVector4Dot(P, V); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneDotCoord -( - FXMVECTOR P, - FXMVECTOR V -) noexcept -{ - // Result = P[0] * V[0] + P[1] * V[1] + P[2] * V[2] + P[3] - - XMVECTOR V3 = XMVectorSelect(g_XMOne.v, V, g_XMSelect1110.v); - XMVECTOR Result = XMVector4Dot(P, V3); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneDotNormal -( - FXMVECTOR P, - FXMVECTOR V -) noexcept -{ - return XMVector3Dot(P, V); -} - -//------------------------------------------------------------------------------ -// XMPlaneNormalizeEst uses a reciprocal estimate and -// returns QNaN on zero and infinite vectors. - -inline XMVECTOR XM_CALLCONV XMPlaneNormalizeEst(FXMVECTOR P) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - XMVECTOR Result = XMVector3ReciprocalLengthEst(P); - return XMVectorMultiply(P, Result); - -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(P, P, 0x7f); - XMVECTOR vResult = _mm_rsqrt_ps(vTemp); - return _mm_mul_ps(vResult, P); -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product - XMVECTOR vDot = _mm_mul_ps(P, P); - // x=Dot.y, y=Dot.z - XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); - // Result.x = x+y - vDot = _mm_add_ss(vDot, vTemp); - // x=Dot.z - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // Result.x = (x+y)+z - vDot = _mm_add_ss(vDot, vTemp); - // Splat x - vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); - // Get the reciprocal - vDot = _mm_rsqrt_ps(vDot); - // Get the reciprocal - vDot = _mm_mul_ps(vDot, P); - return vDot; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float fLengthSq = sqrtf((P.vector4_f32[0] * P.vector4_f32[0]) + (P.vector4_f32[1] * P.vector4_f32[1]) + (P.vector4_f32[2] * P.vector4_f32[2])); - // Prevent divide by zero - if (fLengthSq > 0) - { - fLengthSq = 1.0f / fLengthSq; - } - XMVECTORF32 vResult = { { { - P.vector4_f32[0] * fLengthSq, - P.vector4_f32[1] * fLengthSq, - P.vector4_f32[2] * fLengthSq, - P.vector4_f32[3] * fLengthSq - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR vLength = XMVector3ReciprocalLength(P); - return XMVectorMultiply(P, vLength); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vLengthSq = _mm_dp_ps(P, P, 0x7f); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Reciprocal mul to perform the normalization - vResult = _mm_div_ps(P, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vLengthSq); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y and z only - XMVECTOR vLengthSq = _mm_mul_ps(P, P); - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 1, 2, 1)); - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Reciprocal mul to perform the normalization - vResult = _mm_div_ps(P, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vLengthSq); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneIntersectLine -( - FXMVECTOR P, - FXMVECTOR LinePoint1, - FXMVECTOR LinePoint2 -) noexcept -{ - XMVECTOR V1 = XMVector3Dot(P, LinePoint1); - XMVECTOR V2 = XMVector3Dot(P, LinePoint2); - XMVECTOR D = XMVectorSubtract(V1, V2); - - XMVECTOR VT = XMPlaneDotCoord(P, LinePoint1); - VT = XMVectorDivide(VT, D); - - XMVECTOR Point = XMVectorSubtract(LinePoint2, LinePoint1); - Point = XMVectorMultiplyAdd(Point, VT, LinePoint1); - - const XMVECTOR Zero = XMVectorZero(); - XMVECTOR Control = XMVectorNearEqual(D, Zero, g_XMEpsilon.v); - - return XMVectorSelect(Point, g_XMQNaN.v, Control); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMPlaneIntersectPlane -( - XMVECTOR* pLinePoint1, - XMVECTOR* pLinePoint2, - FXMVECTOR P1, - FXMVECTOR P2 -) noexcept -{ - assert(pLinePoint1); - assert(pLinePoint2); - - XMVECTOR V1 = XMVector3Cross(P2, P1); - - XMVECTOR LengthSq = XMVector3LengthSq(V1); - - XMVECTOR V2 = XMVector3Cross(P2, V1); - - XMVECTOR P1W = XMVectorSplatW(P1); - XMVECTOR Point = XMVectorMultiply(V2, P1W); - - XMVECTOR V3 = XMVector3Cross(V1, P1); - - XMVECTOR P2W = XMVectorSplatW(P2); - Point = XMVectorMultiplyAdd(V3, P2W, Point); - - XMVECTOR LinePoint1 = XMVectorDivide(Point, LengthSq); - - XMVECTOR LinePoint2 = XMVectorAdd(LinePoint1, V1); - - XMVECTOR Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon.v); - *pLinePoint1 = XMVectorSelect(LinePoint1, g_XMQNaN.v, Control); - *pLinePoint2 = XMVectorSelect(LinePoint2, g_XMQNaN.v, Control); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneTransform -( - FXMVECTOR P, - FXMMATRIX ITM -) noexcept -{ - XMVECTOR W = XMVectorSplatW(P); - XMVECTOR Z = XMVectorSplatZ(P); - XMVECTOR Y = XMVectorSplatY(P); - XMVECTOR X = XMVectorSplatX(P); - - XMVECTOR Result = XMVectorMultiply(W, ITM.r[3]); - Result = XMVectorMultiplyAdd(Z, ITM.r[2], Result); - Result = XMVectorMultiplyAdd(Y, ITM.r[1], Result); - Result = XMVectorMultiplyAdd(X, ITM.r[0], Result); - return Result; -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMFLOAT4* XM_CALLCONV XMPlaneTransformStream -( - XMFLOAT4* pOutputStream, - size_t OutputStride, - const XMFLOAT4* pInputStream, - size_t InputStride, - size_t PlaneCount, - FXMMATRIX ITM -) noexcept -{ - return XMVector4TransformStream(pOutputStream, - OutputStride, - pInputStream, - InputStride, - PlaneCount, - ITM); -} - -//------------------------------------------------------------------------------ -// Conversion operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneFromPointNormal -( - FXMVECTOR Point, - FXMVECTOR Normal -) noexcept -{ - XMVECTOR W = XMVector3Dot(Point, Normal); - W = XMVectorNegate(W); - return XMVectorSelect(W, Normal, g_XMSelect1110.v); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMPlaneFromPoints -( - FXMVECTOR Point1, - FXMVECTOR Point2, - FXMVECTOR Point3 -) noexcept -{ - XMVECTOR V21 = XMVectorSubtract(Point1, Point2); - XMVECTOR V31 = XMVectorSubtract(Point1, Point3); - - XMVECTOR N = XMVector3Cross(V21, V31); - N = XMVector3Normalize(N); - - XMVECTOR D = XMPlaneDotNormal(N, Point1); - D = XMVectorNegate(D); - - XMVECTOR Result = XMVectorSelect(D, N, g_XMSelect1110.v); - - return Result; -} - -/**************************************************************************** - * - * Color - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorEqual -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVector4Equal(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorNotEqual -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVector4NotEqual(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorGreater -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVector4Greater(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorGreaterOrEqual -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVector4GreaterOrEqual(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorLess -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVector4Less(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorLessOrEqual -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVector4LessOrEqual(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorIsNaN(FXMVECTOR C) noexcept -{ - return XMVector4IsNaN(C); -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMColorIsInfinite(FXMVECTOR C) noexcept -{ - return XMVector4IsInfinite(C); -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorNegative(FXMVECTOR vColor) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - 1.0f - vColor.vector4_f32[0], - 1.0f - vColor.vector4_f32[1], - 1.0f - vColor.vector4_f32[2], - vColor.vector4_f32[3] - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vTemp = veorq_u32(vreinterpretq_u32_f32(vColor), g_XMNegate3); - return vaddq_f32(vreinterpretq_f32_u32(vTemp), g_XMOne3); -#elif defined(_XM_SSE_INTRINSICS_) - // Negate only x,y and z. - XMVECTOR vTemp = _mm_xor_ps(vColor, g_XMNegate3); - // Add 1,1,1,0 to -x,-y,-z,w - return _mm_add_ps(vTemp, g_XMOne3); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorModulate -( - FXMVECTOR C1, - FXMVECTOR C2 -) noexcept -{ - return XMVectorMultiply(C1, C2); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorAdjustSaturation -( - FXMVECTOR vColor, - float fSaturation -) noexcept -{ - // Luminance = 0.2125f * C[0] + 0.7154f * C[1] + 0.0721f * C[2]; - // Result = (C - Luminance) * Saturation + Luminance; - - const XMVECTORF32 gvLuminance = { { { 0.2125f, 0.7154f, 0.0721f, 0.0f } } }; -#if defined(_XM_NO_INTRINSICS_) - float fLuminance = (vColor.vector4_f32[0] * gvLuminance.f[0]) + (vColor.vector4_f32[1] * gvLuminance.f[1]) + (vColor.vector4_f32[2] * gvLuminance.f[2]); - XMVECTOR vResult; - vResult.vector4_f32[0] = ((vColor.vector4_f32[0] - fLuminance) * fSaturation) + fLuminance; - vResult.vector4_f32[1] = ((vColor.vector4_f32[1] - fLuminance) * fSaturation) + fLuminance; - vResult.vector4_f32[2] = ((vColor.vector4_f32[2] - fLuminance) * fSaturation) + fLuminance; - vResult.vector4_f32[3] = vColor.vector4_f32[3]; - return vResult; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR vLuminance = XMVector3Dot(vColor, gvLuminance); - XMVECTOR vResult = vsubq_f32(vColor, vLuminance); - vResult = vmlaq_n_f32(vLuminance, vResult, fSaturation); - return vbslq_f32(g_XMSelect1110, vResult, vColor); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vLuminance = XMVector3Dot(vColor, gvLuminance); - // Splat fSaturation - XMVECTOR vSaturation = _mm_set_ps1(fSaturation); - // vResult = ((vColor-vLuminance)*vSaturation)+vLuminance; - XMVECTOR vResult = _mm_sub_ps(vColor, vLuminance); - vResult = XM_FMADD_PS(vResult, vSaturation, vLuminance); - // Retain w from the source color - vLuminance = _mm_shuffle_ps(vResult, vColor, _MM_SHUFFLE(3, 2, 2, 2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w - vResult = _mm_shuffle_ps(vResult, vLuminance, _MM_SHUFFLE(3, 0, 1, 0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorAdjustContrast -( - FXMVECTOR vColor, - float fContrast -) noexcept -{ - // Result = (vColor - 0.5f) * fContrast + 0.5f; - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - ((vColor.vector4_f32[0] - 0.5f) * fContrast) + 0.5f, - ((vColor.vector4_f32[1] - 0.5f) * fContrast) + 0.5f, - ((vColor.vector4_f32[2] - 0.5f) * fContrast) + 0.5f, - vColor.vector4_f32[3] // Leave W untouched - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR vResult = vsubq_f32(vColor, g_XMOneHalf.v); - vResult = vmlaq_n_f32(g_XMOneHalf.v, vResult, fContrast); - return vbslq_f32(g_XMSelect1110, vResult, vColor); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vScale = _mm_set_ps1(fContrast); // Splat the scale - XMVECTOR vResult = _mm_sub_ps(vColor, g_XMOneHalf); // Subtract 0.5f from the source (Saving source) - vResult = XM_FMADD_PS(vResult, vScale, g_XMOneHalf); -// Retain w from the source color - vScale = _mm_shuffle_ps(vResult, vColor, _MM_SHUFFLE(3, 2, 2, 2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w - vResult = _mm_shuffle_ps(vResult, vScale, _MM_SHUFFLE(3, 0, 1, 0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept -{ - XMVECTOR r = XMVectorSplatX(rgb); - XMVECTOR g = XMVectorSplatY(rgb); - XMVECTOR b = XMVectorSplatZ(rgb); - - XMVECTOR min = XMVectorMin(r, XMVectorMin(g, b)); - XMVECTOR max = XMVectorMax(r, XMVectorMax(g, b)); - - XMVECTOR l = XMVectorMultiply(XMVectorAdd(min, max), g_XMOneHalf); - - XMVECTOR d = XMVectorSubtract(max, min); - - XMVECTOR la = XMVectorSelect(rgb, l, g_XMSelect1110); - - if (XMVector3Less(d, g_XMEpsilon)) - { - // Achromatic, assume H and S of 0 - return XMVectorSelect(la, g_XMZero, g_XMSelect1100); - } - else - { - XMVECTOR s, h; - - XMVECTOR d2 = XMVectorAdd(min, max); - - if (XMVector3Greater(l, g_XMOneHalf)) - { - // d / (2-max-min) - s = XMVectorDivide(d, XMVectorSubtract(g_XMTwo, d2)); - } - else - { - // d / (max+min) - s = XMVectorDivide(d, d2); - } - - if (XMVector3Equal(r, max)) - { - // Red is max - h = XMVectorDivide(XMVectorSubtract(g, b), d); - } - else if (XMVector3Equal(g, max)) - { - // Green is max - h = XMVectorDivide(XMVectorSubtract(b, r), d); - h = XMVectorAdd(h, g_XMTwo); - } - else - { - // Blue is max - h = XMVectorDivide(XMVectorSubtract(r, g), d); - h = XMVectorAdd(h, g_XMFour); - } - - h = XMVectorDivide(h, g_XMSix); - - if (XMVector3Less(h, g_XMZero)) - h = XMVectorAdd(h, g_XMOne); - - XMVECTOR lha = XMVectorSelect(la, h, g_XMSelect1100); - return XMVectorSelect(s, lha, g_XMSelect1011); - } -} - -//------------------------------------------------------------------------------ - -namespace MathInternal -{ - - inline XMVECTOR XM_CALLCONV XMColorHue2Clr(FXMVECTOR p, FXMVECTOR q, FXMVECTOR h) noexcept - { - static const XMVECTORF32 oneSixth = { { { 1.0f / 6.0f, 1.0f / 6.0f, 1.0f / 6.0f, 1.0f / 6.0f } } }; - static const XMVECTORF32 twoThirds = { { { 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f } } }; - - XMVECTOR t = h; - - if (XMVector3Less(t, g_XMZero)) - t = XMVectorAdd(t, g_XMOne); - - if (XMVector3Greater(t, g_XMOne)) - t = XMVectorSubtract(t, g_XMOne); - - if (XMVector3Less(t, oneSixth)) - { - // p + (q - p) * 6 * t - XMVECTOR t1 = XMVectorSubtract(q, p); - XMVECTOR t2 = XMVectorMultiply(g_XMSix, t); - return XMVectorMultiplyAdd(t1, t2, p); - } - - if (XMVector3Less(t, g_XMOneHalf)) - return q; - - if (XMVector3Less(t, twoThirds)) - { - // p + (q - p) * 6 * (2/3 - t) - XMVECTOR t1 = XMVectorSubtract(q, p); - XMVECTOR t2 = XMVectorMultiply(g_XMSix, XMVectorSubtract(twoThirds, t)); - return XMVectorMultiplyAdd(t1, t2, p); - } - - return p; - } - -} // namespace MathInternal - -inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept -{ - static const XMVECTORF32 oneThird = { { { 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f } } }; - - XMVECTOR s = XMVectorSplatY(hsl); - XMVECTOR l = XMVectorSplatZ(hsl); - - if (XMVector3NearEqual(s, g_XMZero, g_XMEpsilon)) - { - // Achromatic - return XMVectorSelect(hsl, l, g_XMSelect1110); - } - else - { - XMVECTOR h = XMVectorSplatX(hsl); - - XMVECTOR q; - if (XMVector3Less(l, g_XMOneHalf)) - { - q = XMVectorMultiply(l, XMVectorAdd(g_XMOne, s)); - } - else - { - q = XMVectorSubtract(XMVectorAdd(l, s), XMVectorMultiply(l, s)); - } - - XMVECTOR p = XMVectorSubtract(XMVectorMultiply(g_XMTwo, l), q); - - XMVECTOR r = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird)); - XMVECTOR g = DirectX::MathInternal::XMColorHue2Clr(p, q, h); - XMVECTOR b = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird)); - - XMVECTOR rg = XMVectorSelect(g, r, g_XMSelect1000); - XMVECTOR ba = XMVectorSelect(hsl, b, g_XMSelect1110); - - return XMVectorSelect(ba, rg, g_XMSelect1100); - } -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToHSV(FXMVECTOR rgb) noexcept -{ - XMVECTOR r = XMVectorSplatX(rgb); - XMVECTOR g = XMVectorSplatY(rgb); - XMVECTOR b = XMVectorSplatZ(rgb); - - XMVECTOR min = XMVectorMin(r, XMVectorMin(g, b)); - XMVECTOR v = XMVectorMax(r, XMVectorMax(g, b)); - - XMVECTOR d = XMVectorSubtract(v, min); - - XMVECTOR s = (XMVector3NearEqual(v, g_XMZero, g_XMEpsilon)) ? g_XMZero : XMVectorDivide(d, v); - - if (XMVector3Less(d, g_XMEpsilon)) - { - // Achromatic, assume H of 0 - XMVECTOR hv = XMVectorSelect(v, g_XMZero, g_XMSelect1000); - XMVECTOR hva = XMVectorSelect(rgb, hv, g_XMSelect1110); - return XMVectorSelect(s, hva, g_XMSelect1011); - } - else - { - XMVECTOR h; - - if (XMVector3Equal(r, v)) - { - // Red is max - h = XMVectorDivide(XMVectorSubtract(g, b), d); - - if (XMVector3Less(g, b)) - h = XMVectorAdd(h, g_XMSix); - } - else if (XMVector3Equal(g, v)) - { - // Green is max - h = XMVectorDivide(XMVectorSubtract(b, r), d); - h = XMVectorAdd(h, g_XMTwo); - } - else - { - // Blue is max - h = XMVectorDivide(XMVectorSubtract(r, g), d); - h = XMVectorAdd(h, g_XMFour); - } - - h = XMVectorDivide(h, g_XMSix); - - XMVECTOR hv = XMVectorSelect(v, h, g_XMSelect1000); - XMVECTOR hva = XMVectorSelect(rgb, hv, g_XMSelect1110); - return XMVectorSelect(s, hva, g_XMSelect1011); - } -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorHSVToRGB(FXMVECTOR hsv) noexcept -{ - XMVECTOR h = XMVectorSplatX(hsv); - XMVECTOR s = XMVectorSplatY(hsv); - XMVECTOR v = XMVectorSplatZ(hsv); - - XMVECTOR h6 = XMVectorMultiply(h, g_XMSix); - - XMVECTOR i = XMVectorFloor(h6); - XMVECTOR f = XMVectorSubtract(h6, i); - - // p = v* (1-s) - XMVECTOR p = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, s)); - - // q = v*(1-f*s) - XMVECTOR q = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, XMVectorMultiply(f, s))); - - // t = v*(1 - (1-f)*s) - XMVECTOR t = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, XMVectorMultiply(XMVectorSubtract(g_XMOne, f), s))); - - auto ii = static_cast(XMVectorGetX(XMVectorMod(i, g_XMSix))); - - XMVECTOR _rgb; - - switch (ii) - { - case 0: // rgb = vtp - { - XMVECTOR vt = XMVectorSelect(t, v, g_XMSelect1000); - _rgb = XMVectorSelect(p, vt, g_XMSelect1100); - } - break; - case 1: // rgb = qvp - { - XMVECTOR qv = XMVectorSelect(v, q, g_XMSelect1000); - _rgb = XMVectorSelect(p, qv, g_XMSelect1100); - } - break; - case 2: // rgb = pvt - { - XMVECTOR pv = XMVectorSelect(v, p, g_XMSelect1000); - _rgb = XMVectorSelect(t, pv, g_XMSelect1100); - } - break; - case 3: // rgb = pqv - { - XMVECTOR pq = XMVectorSelect(q, p, g_XMSelect1000); - _rgb = XMVectorSelect(v, pq, g_XMSelect1100); - } - break; - case 4: // rgb = tpv - { - XMVECTOR tp = XMVectorSelect(p, t, g_XMSelect1000); - _rgb = XMVectorSelect(v, tp, g_XMSelect1100); - } - break; - default: // rgb = vpq - { - XMVECTOR vp = XMVectorSelect(p, v, g_XMSelect1000); - _rgb = XMVectorSelect(q, vp, g_XMSelect1100); - } - break; - } - - return XMVectorSelect(hsv, _rgb, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToYUV(FXMVECTOR rgb) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 0.299f, -0.147f, 0.615f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { 0.587f, -0.289f, -0.515f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 0.114f, 0.436f, -0.100f, 0.0f } } }; - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(rgb, M); - - return XMVectorSelect(rgb, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorYUVToRGB(FXMVECTOR yuv) noexcept -{ - static const XMVECTORF32 Scale1 = { { { 0.0f, -0.395f, 2.032f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 1.140f, -0.581f, 0.0f, 0.0f } } }; - - XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(yuv, M); - - return XMVectorSelect(yuv, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToYUV_HD(FXMVECTOR rgb) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 0.2126f, -0.0997f, 0.6150f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { 0.7152f, -0.3354f, -0.5586f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 0.0722f, 0.4351f, -0.0564f, 0.0f } } }; - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(rgb, M); - - return XMVectorSelect(rgb, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorYUVToRGB_HD(FXMVECTOR yuv) noexcept -{ - static const XMVECTORF32 Scale1 = { { { 0.0f, -0.2153f, 2.1324f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 1.2803f, -0.3806f, 0.0f, 0.0f } } }; - - XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(yuv, M); - - return XMVectorSelect(yuv, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToYUV_UHD(FXMVECTOR rgb) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 0.2627f, -0.1215f, 0.6150f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { 0.6780f, -0.3136f, -0.5655f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 0.0593f, 0.4351f, -0.0495f, 0.0f } } }; - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(rgb, M); - - return XMVectorSelect(rgb, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorYUVToRGB_UHD(FXMVECTOR yuv) noexcept -{ - static const XMVECTORF32 Scale1 = { { { 0.0f, -0.1891f, 2.1620f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 1.1989f, -0.4645f, 0.0f, 0.0f } } }; - - XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(yuv, M); - - return XMVectorSelect(yuv, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToXYZ(FXMVECTOR rgb) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 0.4887180f, 0.1762044f, 0.0000000f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { 0.3106803f, 0.8129847f, 0.0102048f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 0.2006017f, 0.0108109f, 0.9897952f, 0.0f } } }; - static const XMVECTORF32 Scale = { { { 1.f / 0.17697f, 1.f / 0.17697f, 1.f / 0.17697f, 0.0f } } }; - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVectorMultiply(XMVector3Transform(rgb, M), Scale); - - return XMVectorSelect(rgb, clr, g_XMSelect1110); -} - -inline XMVECTOR XM_CALLCONV XMColorXYZToRGB(FXMVECTOR xyz) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 2.3706743f, -0.5138850f, 0.0052982f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { -0.9000405f, 1.4253036f, -0.0146949f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { -0.4706338f, 0.0885814f, 1.0093968f, 0.0f } } }; - static const XMVECTORF32 Scale = { { { 0.17697f, 0.17697f, 0.17697f, 0.0f } } }; - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(XMVectorMultiply(xyz, Scale), M); - - return XMVectorSelect(xyz, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorXYZToSRGB(FXMVECTOR xyz) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 3.2406f, -0.9689f, 0.0557f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { -1.5372f, 1.8758f, -0.2040f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { -0.4986f, 0.0415f, 1.0570f, 0.0f } } }; - static const XMVECTORF32 Cutoff = { { { 0.0031308f, 0.0031308f, 0.0031308f, 0.0f } } }; - static const XMVECTORF32 Exp = { { { 1.0f / 2.4f, 1.0f / 2.4f, 1.0f / 2.4f, 1.0f } } }; - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR lclr = XMVector3Transform(xyz, M); - - XMVECTOR sel = XMVectorGreater(lclr, Cutoff); - - // clr = 12.92 * lclr for lclr <= 0.0031308f - XMVECTOR smallC = XMVectorMultiply(lclr, g_XMsrgbScale); - - // clr = (1+a)*pow(lclr, 1/2.4) - a for lclr > 0.0031308 (where a = 0.055) - XMVECTOR largeC = XMVectorSubtract(XMVectorMultiply(g_XMsrgbA1, XMVectorPow(lclr, Exp)), g_XMsrgbA); - - XMVECTOR clr = XMVectorSelect(smallC, largeC, sel); - - return XMVectorSelect(xyz, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorSRGBToXYZ(FXMVECTOR srgb) noexcept -{ - static const XMVECTORF32 Scale0 = { { { 0.4124f, 0.2126f, 0.0193f, 0.0f } } }; - static const XMVECTORF32 Scale1 = { { { 0.3576f, 0.7152f, 0.1192f, 0.0f } } }; - static const XMVECTORF32 Scale2 = { { { 0.1805f, 0.0722f, 0.9505f, 0.0f } } }; - static const XMVECTORF32 Cutoff = { { { 0.04045f, 0.04045f, 0.04045f, 0.0f } } }; - static const XMVECTORF32 Exp = { { { 2.4f, 2.4f, 2.4f, 1.0f } } }; - - XMVECTOR sel = XMVectorGreater(srgb, Cutoff); - - // lclr = clr / 12.92 - XMVECTOR smallC = XMVectorDivide(srgb, g_XMsrgbScale); - - // lclr = pow( (clr + a) / (1+a), 2.4 ) - XMVECTOR largeC = XMVectorPow(XMVectorDivide(XMVectorAdd(srgb, g_XMsrgbA), g_XMsrgbA1), Exp); - - XMVECTOR lclr = XMVectorSelect(smallC, largeC, sel); - - XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); - XMVECTOR clr = XMVector3Transform(lclr, M); - - return XMVectorSelect(srgb, clr, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorRGBToSRGB(FXMVECTOR rgb) noexcept -{ - static const XMVECTORF32 Cutoff = { { { 0.0031308f, 0.0031308f, 0.0031308f, 1.f } } }; - static const XMVECTORF32 Linear = { { { 12.92f, 12.92f, 12.92f, 1.f } } }; - static const XMVECTORF32 Scale = { { { 1.055f, 1.055f, 1.055f, 1.f } } }; - static const XMVECTORF32 Bias = { { { 0.055f, 0.055f, 0.055f, 0.f } } }; - static const XMVECTORF32 InvGamma = { { { 1.0f / 2.4f, 1.0f / 2.4f, 1.0f / 2.4f, 1.f } } }; - - XMVECTOR V = XMVectorSaturate(rgb); - XMVECTOR V0 = XMVectorMultiply(V, Linear); - XMVECTOR V1 = XMVectorSubtract(XMVectorMultiply(Scale, XMVectorPow(V, InvGamma)), Bias); - XMVECTOR select = XMVectorLess(V, Cutoff); - V = XMVectorSelect(V1, V0, select); - return XMVectorSelect(rgb, V, g_XMSelect1110); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMColorSRGBToRGB(FXMVECTOR srgb) noexcept -{ - static const XMVECTORF32 Cutoff = { { { 0.04045f, 0.04045f, 0.04045f, 1.f } } }; - static const XMVECTORF32 ILinear = { { { 1.f / 12.92f, 1.f / 12.92f, 1.f / 12.92f, 1.f } } }; - static const XMVECTORF32 Scale = { { { 1.f / 1.055f, 1.f / 1.055f, 1.f / 1.055f, 1.f } } }; - static const XMVECTORF32 Bias = { { { 0.055f, 0.055f, 0.055f, 0.f } } }; - static const XMVECTORF32 Gamma = { { { 2.4f, 2.4f, 2.4f, 1.f } } }; - - XMVECTOR V = XMVectorSaturate(srgb); - XMVECTOR V0 = XMVectorMultiply(V, ILinear); - XMVECTOR V1 = XMVectorPow(XMVectorMultiply(XMVectorAdd(V, Bias), Scale), Gamma); - XMVECTOR select = XMVectorGreater(V, Cutoff); - V = XMVectorSelect(V0, V1, select); - return XMVectorSelect(srgb, V, g_XMSelect1110); -} - -/**************************************************************************** - * - * Miscellaneous - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline bool XMVerifyCPUSupport() noexcept -{ -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - int CPUInfo[4] = { -1 }; -#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid) - __cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); -#else - __cpuid(CPUInfo, 0); -#endif - -#ifdef __AVX2__ - if (CPUInfo[0] < 7) - return false; -#else - if (CPUInfo[0] < 1) - return false; -#endif - -#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid) - __cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); -#else - __cpuid(CPUInfo, 1); -#endif - -#if defined(__AVX2__) || defined(_XM_AVX2_INTRINSICS_) - // The compiler can emit FMA3 instructions even without explicit intrinsics use - if ((CPUInfo[2] & 0x38081001) != 0x38081001) - return false; // No F16C/AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support -#elif defined(_XM_FMA3_INTRINSICS_) && defined(_XM_F16C_INTRINSICS_) - if ((CPUInfo[2] & 0x38081001) != 0x38081001) - return false; // No F16C/AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support -#elif defined(_XM_FMA3_INTRINSICS_) - if ((CPUInfo[2] & 0x18081001) != 0x18081001) - return false; // No AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support -#elif defined(_XM_F16C_INTRINSICS_) - if ((CPUInfo[2] & 0x38080001) != 0x38080001) - return false; // No F16C/AVX/OSXSAVE/SSE4.1/SSE3 support -#elif defined(__AVX__) || defined(_XM_AVX_INTRINSICS_) - if ((CPUInfo[2] & 0x18080001) != 0x18080001) - return false; // No AVX/OSXSAVE/SSE4.1/SSE3 support -#elif defined(_XM_SSE4_INTRINSICS_) - if ((CPUInfo[2] & 0x80001) != 0x80001) - return false; // No SSE3/SSE4.1 support -#elif defined(_XM_SSE3_INTRINSICS_) - if (!(CPUInfo[2] & 0x1)) - return false; // No SSE3 support -#endif - - // The x64 processor model requires SSE2 support, but no harm in checking - if ((CPUInfo[3] & 0x6000000) != 0x6000000) - return false; // No SSE2/SSE support - -#if defined(__AVX2__) || defined(_XM_AVX2_INTRINSICS_) -#if defined(__clang__) || defined(__GNUC__) - __cpuid_count(7, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); -#else - __cpuidex(CPUInfo, 7, 0); -#endif - if (!(CPUInfo[1] & 0x20)) - return false; // No AVX2 support -#endif - - return true; -#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - // ARM-NEON support is required for the Windows on ARM platform - return true; -#else - // No intrinsics path always supported - return true; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMFresnelTerm -( - FXMVECTOR CosIncidentAngle, - FXMVECTOR RefractionIndex -) noexcept -{ - assert(!XMVector4IsInfinite(CosIncidentAngle)); - - // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where - // c = CosIncidentAngle - // g = sqrt(c^2 + RefractionIndex^2 - 1) - -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - XMVECTOR G = XMVectorMultiplyAdd(RefractionIndex, RefractionIndex, g_XMNegativeOne.v); - G = XMVectorMultiplyAdd(CosIncidentAngle, CosIncidentAngle, G); - G = XMVectorAbs(G); - G = XMVectorSqrt(G); - - XMVECTOR S = XMVectorAdd(G, CosIncidentAngle); - XMVECTOR D = XMVectorSubtract(G, CosIncidentAngle); - - XMVECTOR V0 = XMVectorMultiply(D, D); - XMVECTOR V1 = XMVectorMultiply(S, S); - V1 = XMVectorReciprocal(V1); - V0 = XMVectorMultiply(g_XMOneHalf.v, V0); - V0 = XMVectorMultiply(V0, V1); - - XMVECTOR V2 = XMVectorMultiplyAdd(CosIncidentAngle, S, g_XMNegativeOne.v); - XMVECTOR V3 = XMVectorMultiplyAdd(CosIncidentAngle, D, g_XMOne.v); - V2 = XMVectorMultiply(V2, V2); - V3 = XMVectorMultiply(V3, V3); - V3 = XMVectorReciprocal(V3); - V2 = XMVectorMultiplyAdd(V2, V3, g_XMOne.v); - - XMVECTOR Result = XMVectorMultiply(V0, V2); - - Result = XMVectorSaturate(Result); - - return Result; - -#elif defined(_XM_SSE_INTRINSICS_) - // G = sqrt(abs((RefractionIndex^2-1) + CosIncidentAngle^2)) - XMVECTOR G = _mm_mul_ps(RefractionIndex, RefractionIndex); - XMVECTOR vTemp = _mm_mul_ps(CosIncidentAngle, CosIncidentAngle); - G = _mm_sub_ps(G, g_XMOne); - vTemp = _mm_add_ps(vTemp, G); - // max((0-vTemp),vTemp) == abs(vTemp) - // The abs is needed to deal with refraction and cosine being zero - G = _mm_setzero_ps(); - G = _mm_sub_ps(G, vTemp); - G = _mm_max_ps(G, vTemp); - // Last operation, the sqrt() - G = _mm_sqrt_ps(G); - - // Calc G-C and G+C - XMVECTOR GAddC = _mm_add_ps(G, CosIncidentAngle); - XMVECTOR GSubC = _mm_sub_ps(G, CosIncidentAngle); - // Perform the term (0.5f *(g - c)^2) / (g + c)^2 - XMVECTOR vResult = _mm_mul_ps(GSubC, GSubC); - vTemp = _mm_mul_ps(GAddC, GAddC); - vResult = _mm_mul_ps(vResult, g_XMOneHalf); - vResult = _mm_div_ps(vResult, vTemp); - // Perform the term ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) - GAddC = _mm_mul_ps(GAddC, CosIncidentAngle); - GSubC = _mm_mul_ps(GSubC, CosIncidentAngle); - GAddC = _mm_sub_ps(GAddC, g_XMOne); - GSubC = _mm_add_ps(GSubC, g_XMOne); - GAddC = _mm_mul_ps(GAddC, GAddC); - GSubC = _mm_mul_ps(GSubC, GSubC); - GAddC = _mm_div_ps(GAddC, GSubC); - GAddC = _mm_add_ps(GAddC, g_XMOne); - // Multiply the two term parts - vResult = _mm_mul_ps(vResult, GAddC); - // Clamp to 0.0 - 1.0f - vResult = _mm_max_ps(vResult, g_XMZero); - vResult = _mm_min_ps(vResult, g_XMOne); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XMScalarNearEqual -( - float S1, - float S2, - float Epsilon -) noexcept -{ - float Delta = S1 - S2; - return (fabsf(Delta) <= Epsilon); -} - -//------------------------------------------------------------------------------ -// Modulo the range of the given angle such that -XM_PI <= Angle < XM_PI -inline float XMScalarModAngle(float Angle) noexcept -{ - // Note: The modulo is performed with unsigned math only to work - // around a precision error on numbers that are close to PI - - // Normalize the range from 0.0f to XM_2PI - Angle = Angle + XM_PI; - // Perform the modulo, unsigned - float fTemp = fabsf(Angle); - fTemp = fTemp - (XM_2PI * static_cast(static_cast(fTemp / XM_2PI))); - // Restore the number to the range of -XM_PI to XM_PI-epsilon - fTemp = fTemp - XM_PI; - // If the modulo'd value was negative, restore negation - if (Angle < 0.0f) - { - fTemp = -fTemp; - } - return fTemp; -} - -//------------------------------------------------------------------------------ - -inline float XMScalarSin(float Value) noexcept -{ - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = XM_1DIV2PI * Value; - if (Value >= 0.0f) - { - quotient = static_cast(static_cast(quotient + 0.5f)); - } - else - { - quotient = static_cast(static_cast(quotient - 0.5f)); - } - float y = Value - XM_2PI * quotient; - - // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). - if (y > XM_PIDIV2) - { - y = XM_PI - y; - } - else if (y < -XM_PIDIV2) - { - y = -XM_PI - y; - } - - // 11-degree minimax approximation - float y2 = y * y; - return (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y; -} - -//------------------------------------------------------------------------------ - -inline float XMScalarSinEst(float Value) noexcept -{ - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = XM_1DIV2PI * Value; - if (Value >= 0.0f) - { - quotient = static_cast(static_cast(quotient + 0.5f)); - } - else - { - quotient = static_cast(static_cast(quotient - 0.5f)); - } - float y = Value - XM_2PI * quotient; - - // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). - if (y > XM_PIDIV2) - { - y = XM_PI - y; - } - else if (y < -XM_PIDIV2) - { - y = -XM_PI - y; - } - - // 7-degree minimax approximation - float y2 = y * y; - return (((-0.00018524670f * y2 + 0.0083139502f) * y2 - 0.16665852f) * y2 + 1.0f) * y; -} - -//------------------------------------------------------------------------------ - -inline float XMScalarCos(float Value) noexcept -{ - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = XM_1DIV2PI * Value; - if (Value >= 0.0f) - { - quotient = static_cast(static_cast(quotient + 0.5f)); - } - else - { - quotient = static_cast(static_cast(quotient - 0.5f)); - } - float y = Value - XM_2PI * quotient; - - // Map y to [-pi/2,pi/2] with cos(y) = sign*cos(x). - float sign; - if (y > XM_PIDIV2) - { - y = XM_PI - y; - sign = -1.0f; - } - else if (y < -XM_PIDIV2) - { - y = -XM_PI - y; - sign = -1.0f; - } - else - { - sign = +1.0f; - } - - // 10-degree minimax approximation - float y2 = y * y; - float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f; - return sign * p; -} - -//------------------------------------------------------------------------------ - -inline float XMScalarCosEst(float Value) noexcept -{ - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = XM_1DIV2PI * Value; - if (Value >= 0.0f) - { - quotient = static_cast(static_cast(quotient + 0.5f)); - } - else - { - quotient = static_cast(static_cast(quotient - 0.5f)); - } - float y = Value - XM_2PI * quotient; - - // Map y to [-pi/2,pi/2] with cos(y) = sign*cos(x). - float sign; - if (y > XM_PIDIV2) - { - y = XM_PI - y; - sign = -1.0f; - } - else if (y < -XM_PIDIV2) - { - y = -XM_PI - y; - sign = -1.0f; - } - else - { - sign = +1.0f; - } - - // 6-degree minimax approximation - float y2 = y * y; - float p = ((-0.0012712436f * y2 + 0.041493919f) * y2 - 0.49992746f) * y2 + 1.0f; - return sign * p; -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline void XMScalarSinCos -( - float* pSin, - float* pCos, - float Value -) noexcept -{ - assert(pSin); - assert(pCos); - - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = XM_1DIV2PI * Value; - if (Value >= 0.0f) - { - quotient = static_cast(static_cast(quotient + 0.5f)); - } - else - { - quotient = static_cast(static_cast(quotient - 0.5f)); - } - float y = Value - XM_2PI * quotient; - - // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). - float sign; - if (y > XM_PIDIV2) - { - y = XM_PI - y; - sign = -1.0f; - } - else if (y < -XM_PIDIV2) - { - y = -XM_PI - y; - sign = -1.0f; - } - else - { - sign = +1.0f; - } - - float y2 = y * y; - - // 11-degree minimax approximation - *pSin = (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y; - - // 10-degree minimax approximation - float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f; - *pCos = sign * p; -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline void XMScalarSinCosEst -( - float* pSin, - float* pCos, - float Value -) noexcept -{ - assert(pSin); - assert(pCos); - - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = XM_1DIV2PI * Value; - if (Value >= 0.0f) - { - quotient = static_cast(static_cast(quotient + 0.5f)); - } - else - { - quotient = static_cast(static_cast(quotient - 0.5f)); - } - float y = Value - XM_2PI * quotient; - - // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). - float sign; - if (y > XM_PIDIV2) - { - y = XM_PI - y; - sign = -1.0f; - } - else if (y < -XM_PIDIV2) - { - y = -XM_PI - y; - sign = -1.0f; - } - else - { - sign = +1.0f; - } - - float y2 = y * y; - - // 7-degree minimax approximation - *pSin = (((-0.00018524670f * y2 + 0.0083139502f) * y2 - 0.16665852f) * y2 + 1.0f) * y; - - // 6-degree minimax approximation - float p = ((-0.0012712436f * y2 + 0.041493919f) * y2 - 0.49992746f) * y2 + 1.0f; - *pCos = sign * p; -} - -//------------------------------------------------------------------------------ - -inline float XMScalarASin(float Value) noexcept -{ - // Clamp input to [-1,1]. - bool nonnegative = (Value >= 0.0f); - float x = fabsf(Value); - float omx = 1.0f - x; - if (omx < 0.0f) - { - omx = 0.0f; - } - float root = sqrtf(omx); - - // 7-degree minimax approximation - float result = ((((((-0.0012624911f * x + 0.0066700901f) * x - 0.0170881256f) * x + 0.0308918810f) * x - 0.0501743046f) * x + 0.0889789874f) * x - 0.2145988016f) * x + 1.5707963050f; - result *= root; // acos(|x|) - - // acos(x) = pi - acos(-x) when x < 0, asin(x) = pi/2 - acos(x) - return (nonnegative ? XM_PIDIV2 - result : result - XM_PIDIV2); -} - -//------------------------------------------------------------------------------ - -inline float XMScalarASinEst(float Value) noexcept -{ - // Clamp input to [-1,1]. - bool nonnegative = (Value >= 0.0f); - float x = fabsf(Value); - float omx = 1.0f - x; - if (omx < 0.0f) - { - omx = 0.0f; - } - float root = sqrtf(omx); - - // 3-degree minimax approximation - float result = ((-0.0187293f * x + 0.0742610f) * x - 0.2121144f) * x + 1.5707288f; - result *= root; // acos(|x|) - - // acos(x) = pi - acos(-x) when x < 0, asin(x) = pi/2 - acos(x) - return (nonnegative ? XM_PIDIV2 - result : result - XM_PIDIV2); -} - -//------------------------------------------------------------------------------ - -inline float XMScalarACos(float Value) noexcept -{ - // Clamp input to [-1,1]. - bool nonnegative = (Value >= 0.0f); - float x = fabsf(Value); - float omx = 1.0f - x; - if (omx < 0.0f) - { - omx = 0.0f; - } - float root = sqrtf(omx); - - // 7-degree minimax approximation - float result = ((((((-0.0012624911f * x + 0.0066700901f) * x - 0.0170881256f) * x + 0.0308918810f) * x - 0.0501743046f) * x + 0.0889789874f) * x - 0.2145988016f) * x + 1.5707963050f; - result *= root; - - // acos(x) = pi - acos(-x) when x < 0 - return (nonnegative ? result : XM_PI - result); -} - -//------------------------------------------------------------------------------ - -inline float XMScalarACosEst(float Value) noexcept -{ - // Clamp input to [-1,1]. - bool nonnegative = (Value >= 0.0f); - float x = fabsf(Value); - float omx = 1.0f - x; - if (omx < 0.0f) - { - omx = 0.0f; - } - float root = sqrtf(omx); - - // 3-degree minimax approximation - float result = ((-0.0187293f * x + 0.0742610f) * x - 0.2121144f) * x + 1.5707288f; - result *= root; - - // acos(x) = pi - acos(-x) when x < 0 - return (nonnegative ? result : XM_PI - result); -} - +//------------------------------------------------------------------------------------- +// DirectXMathMisc.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Quaternion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + return XMVector4Equal(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionNotEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + return XMVector4NotEqual(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionIsNaN(FXMVECTOR Q) noexcept +{ + return XMVector4IsNaN(Q); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionIsInfinite(FXMVECTOR Q) noexcept +{ + return XMVector4IsInfinite(Q); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMQuaternionIsIdentity(FXMVECTOR Q) noexcept +{ + return XMVector4Equal(Q, g_XMIdentityR3.v); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionDot +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + return XMVector4Dot(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionMultiply +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) noexcept +{ + // Returns the product Q2*Q1 (which is the concatenation of a rotation Q1 followed by the rotation Q2) + + // [ (Q2.w * Q1.x) + (Q2.x * Q1.w) + (Q2.y * Q1.z) - (Q2.z * Q1.y), + // (Q2.w * Q1.y) - (Q2.x * Q1.z) + (Q2.y * Q1.w) + (Q2.z * Q1.x), + // (Q2.w * Q1.z) + (Q2.x * Q1.y) - (Q2.y * Q1.x) + (Q2.z * Q1.w), + // (Q2.w * Q1.w) - (Q2.x * Q1.x) - (Q2.y * Q1.y) - (Q2.z * Q1.z) ] + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + (Q2.vector4_f32[3] * Q1.vector4_f32[0]) + (Q2.vector4_f32[0] * Q1.vector4_f32[3]) + (Q2.vector4_f32[1] * Q1.vector4_f32[2]) - (Q2.vector4_f32[2] * Q1.vector4_f32[1]), + (Q2.vector4_f32[3] * Q1.vector4_f32[1]) - (Q2.vector4_f32[0] * Q1.vector4_f32[2]) + (Q2.vector4_f32[1] * Q1.vector4_f32[3]) + (Q2.vector4_f32[2] * Q1.vector4_f32[0]), + (Q2.vector4_f32[3] * Q1.vector4_f32[2]) + (Q2.vector4_f32[0] * Q1.vector4_f32[1]) - (Q2.vector4_f32[1] * Q1.vector4_f32[0]) + (Q2.vector4_f32[2] * Q1.vector4_f32[3]), + (Q2.vector4_f32[3] * Q1.vector4_f32[3]) - (Q2.vector4_f32[0] * Q1.vector4_f32[0]) - (Q2.vector4_f32[1] * Q1.vector4_f32[1]) - (Q2.vector4_f32[2] * Q1.vector4_f32[2]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ControlWZYX = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; + static const XMVECTORF32 ControlZWXY = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; + static const XMVECTORF32 ControlYXWZ = { { { -1.0f, 1.0f, 1.0f, -1.0f } } }; + + float32x2_t Q2L = vget_low_f32(Q2); + float32x2_t Q2H = vget_high_f32(Q2); + + float32x4_t Q2X = vdupq_lane_f32(Q2L, 0); + float32x4_t Q2Y = vdupq_lane_f32(Q2L, 1); + float32x4_t Q2Z = vdupq_lane_f32(Q2H, 0); + XMVECTOR vResult = vmulq_lane_f32(Q1, Q2H, 1); + + // Mul by Q1WZYX + float32x4_t vTemp = vrev64q_f32(Q1); + vTemp = vcombine_f32(vget_high_f32(vTemp), vget_low_f32(vTemp)); + Q2X = vmulq_f32(Q2X, vTemp); + vResult = vmlaq_f32(vResult, Q2X, ControlWZYX); + + // Mul by Q1ZWXY + vTemp = vreinterpretq_f32_u32(vrev64q_u32(vreinterpretq_u32_f32(vTemp))); + Q2Y = vmulq_f32(Q2Y, vTemp); + vResult = vmlaq_f32(vResult, Q2Y, ControlZWXY); + + // Mul by Q1YXWZ + vTemp = vreinterpretq_f32_u32(vrev64q_u32(vreinterpretq_u32_f32(vTemp))); + vTemp = vcombine_f32(vget_high_f32(vTemp), vget_low_f32(vTemp)); + Q2Z = vmulq_f32(Q2Z, vTemp); + vResult = vmlaq_f32(vResult, Q2Z, ControlYXWZ); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ControlWZYX = { { { 1.0f, -1.0f, 1.0f, -1.0f } } }; + static const XMVECTORF32 ControlZWXY = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; + static const XMVECTORF32 ControlYXWZ = { { { -1.0f, 1.0f, 1.0f, -1.0f } } }; + // Copy to SSE registers and use as few as possible for x86 + XMVECTOR Q2X = Q2; + XMVECTOR Q2Y = Q2; + XMVECTOR Q2Z = Q2; + XMVECTOR vResult = Q2; + // Splat with one instruction + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 3, 3, 3)); + Q2X = XM_PERMUTE_PS(Q2X, _MM_SHUFFLE(0, 0, 0, 0)); + Q2Y = XM_PERMUTE_PS(Q2Y, _MM_SHUFFLE(1, 1, 1, 1)); + Q2Z = XM_PERMUTE_PS(Q2Z, _MM_SHUFFLE(2, 2, 2, 2)); + // Retire Q1 and perform Q1*Q2W + vResult = _mm_mul_ps(vResult, Q1); + XMVECTOR Q1Shuffle = Q1; + // Shuffle the copies of Q1 + Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(0, 1, 2, 3)); + // Mul by Q1WZYX + Q2X = _mm_mul_ps(Q2X, Q1Shuffle); + Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(2, 3, 0, 1)); + // Flip the signs on y and z + vResult = XM_FMADD_PS(Q2X, ControlWZYX, vResult); + // Mul by Q1ZWXY + Q2Y = _mm_mul_ps(Q2Y, Q1Shuffle); + Q1Shuffle = XM_PERMUTE_PS(Q1Shuffle, _MM_SHUFFLE(0, 1, 2, 3)); + // Flip the signs on z and w + Q2Y = _mm_mul_ps(Q2Y, ControlZWXY); + // Mul by Q1YXWZ + Q2Z = _mm_mul_ps(Q2Z, Q1Shuffle); + // Flip the signs on x and w + Q2Y = XM_FMADD_PS(Q2Z, ControlYXWZ, Q2Y); + vResult = _mm_add_ps(vResult, Q2Y); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionLengthSq(FXMVECTOR Q) noexcept +{ + return XMVector4LengthSq(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionReciprocalLength(FXMVECTOR Q) noexcept +{ + return XMVector4ReciprocalLength(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionLength(FXMVECTOR Q) noexcept +{ + return XMVector4Length(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionNormalizeEst(FXMVECTOR Q) noexcept +{ + return XMVector4NormalizeEst(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionNormalize(FXMVECTOR Q) noexcept +{ + return XMVector4Normalize(Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionConjugate(FXMVECTOR Q) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + -Q.vector4_f32[0], + -Q.vector4_f32[1], + -Q.vector4_f32[2], + Q.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 NegativeOne3 = { { { -1.0f, -1.0f, -1.0f, 1.0f } } }; + return vmulq_f32(Q, NegativeOne3.v); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 NegativeOne3 = { { { -1.0f, -1.0f, -1.0f, 1.0f } } }; + return _mm_mul_ps(Q, NegativeOne3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionInverse(FXMVECTOR Q) noexcept +{ + XMVECTOR L = XMVector4LengthSq(Q); + XMVECTOR Conjugate = XMQuaternionConjugate(Q); + + XMVECTOR Control = XMVectorLessOrEqual(L, g_XMEpsilon.v); + + XMVECTOR Result = XMVectorDivide(Conjugate, L); + + Result = XMVectorSelect(Result, g_XMZero, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionLn(FXMVECTOR Q) noexcept +{ + static const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; + + XMVECTOR QW = XMVectorSplatW(Q); + XMVECTOR Q0 = XMVectorSelect(g_XMSelect1110.v, Q, g_XMSelect1110.v); + + XMVECTOR ControlW = XMVectorInBounds(QW, OneMinusEpsilon.v); + + XMVECTOR Theta = XMVectorACos(QW); + XMVECTOR SinTheta = XMVectorSin(Theta); + + XMVECTOR S = XMVectorDivide(Theta, SinTheta); + + XMVECTOR Result = XMVectorMultiply(Q0, S); + Result = XMVectorSelect(Q0, Result, ControlW); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionExp(FXMVECTOR Q) noexcept +{ + XMVECTOR Theta = XMVector3Length(Q); + + XMVECTOR SinTheta, CosTheta; + XMVectorSinCos(&SinTheta, &CosTheta, Theta); + + XMVECTOR S = XMVectorDivide(SinTheta, Theta); + + XMVECTOR Result = XMVectorMultiply(Q, S); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon.v); + Result = XMVectorSelect(Result, Q, Control); + + Result = XMVectorSelect(CosTheta, Result, g_XMSelect1110.v); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSlerp +( + FXMVECTOR Q0, + FXMVECTOR Q1, + float t +) noexcept +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSlerpV(Q0, Q1, T); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSlerpV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR T +) noexcept +{ + assert((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); + + // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; + + XMVECTOR CosOmega = XMQuaternionDot(Q0, Q1); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorLess(CosOmega, Zero); + XMVECTOR Sign = XMVectorSelect(g_XMOne.v, g_XMNegativeOne.v, Control); + + CosOmega = XMVectorMultiply(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + XMVECTOR SinOmega = XMVectorNegativeMultiplySubtract(CosOmega, CosOmega, g_XMOne.v); + SinOmega = XMVectorSqrt(SinOmega); + + XMVECTOR Omega = XMVectorATan2(SinOmega, CosOmega); + + XMVECTOR SignMask = XMVectorSplatSignMask(); + XMVECTOR V01 = XMVectorShiftLeft(T, Zero, 2); + SignMask = XMVectorShiftLeft(SignMask, Zero, 3); + V01 = XMVectorXorInt(V01, SignMask); + V01 = XMVectorAdd(g_XMIdentityR0.v, V01); + + XMVECTOR InvSinOmega = XMVectorReciprocal(SinOmega); + + XMVECTOR S0 = XMVectorMultiply(V01, Omega); + S0 = XMVectorSin(S0); + S0 = XMVectorMultiply(S0, InvSinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + XMVECTOR S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = XMVectorMultiply(S1, Sign); + + XMVECTOR Result = XMVectorMultiply(Q0, S0); + Result = XMVectorMultiplyAdd(Q1, S1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 OneMinusEpsilon = { { { 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f } } }; + static const XMVECTORU32 SignMask2 = { { { 0x80000000, 0x00000000, 0x00000000, 0x00000000 } } }; + + XMVECTOR CosOmega = XMQuaternionDot(Q0, Q1); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorLess(CosOmega, Zero); + XMVECTOR Sign = XMVectorSelect(g_XMOne, g_XMNegativeOne, Control); + + CosOmega = _mm_mul_ps(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + XMVECTOR SinOmega = _mm_mul_ps(CosOmega, CosOmega); + SinOmega = _mm_sub_ps(g_XMOne, SinOmega); + SinOmega = _mm_sqrt_ps(SinOmega); + + XMVECTOR Omega = XMVectorATan2(SinOmega, CosOmega); + + XMVECTOR V01 = XM_PERMUTE_PS(T, _MM_SHUFFLE(2, 3, 0, 1)); + V01 = _mm_and_ps(V01, g_XMMaskXY); + V01 = _mm_xor_ps(V01, SignMask2); + V01 = _mm_add_ps(g_XMIdentityR0, V01); + + XMVECTOR S0 = _mm_mul_ps(V01, Omega); + S0 = XMVectorSin(S0); + S0 = _mm_div_ps(S0, SinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + XMVECTOR S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = _mm_mul_ps(S1, Sign); + XMVECTOR Result = _mm_mul_ps(Q0, S0); + S1 = _mm_mul_ps(S1, Q1); + Result = _mm_add_ps(Result, S1); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSquad +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR Q3, + float t +) noexcept +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSquadV(Q0, Q1, Q2, Q3, T); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionSquadV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR Q3, + HXMVECTOR T +) noexcept +{ + assert((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); + + XMVECTOR TP = T; + const XMVECTOR Two = XMVectorSplatConstant(2, 0); + + XMVECTOR Q03 = XMQuaternionSlerpV(Q0, Q3, T); + XMVECTOR Q12 = XMQuaternionSlerpV(Q1, Q2, T); + + TP = XMVectorNegativeMultiplySubtract(TP, TP, TP); + TP = XMVectorMultiply(TP, Two); + + XMVECTOR Result = XMQuaternionSlerpV(Q03, Q12, TP); + + return Result; +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMQuaternionSquadSetup +( + XMVECTOR* pA, + XMVECTOR* pB, + XMVECTOR* pC, + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR Q3 +) noexcept +{ + assert(pA); + assert(pB); + assert(pC); + + XMVECTOR LS12 = XMQuaternionLengthSq(XMVectorAdd(Q1, Q2)); + XMVECTOR LD12 = XMQuaternionLengthSq(XMVectorSubtract(Q1, Q2)); + XMVECTOR SQ2 = XMVectorNegate(Q2); + + XMVECTOR Control1 = XMVectorLess(LS12, LD12); + SQ2 = XMVectorSelect(Q2, SQ2, Control1); + + XMVECTOR LS01 = XMQuaternionLengthSq(XMVectorAdd(Q0, Q1)); + XMVECTOR LD01 = XMQuaternionLengthSq(XMVectorSubtract(Q0, Q1)); + XMVECTOR SQ0 = XMVectorNegate(Q0); + + XMVECTOR LS23 = XMQuaternionLengthSq(XMVectorAdd(SQ2, Q3)); + XMVECTOR LD23 = XMQuaternionLengthSq(XMVectorSubtract(SQ2, Q3)); + XMVECTOR SQ3 = XMVectorNegate(Q3); + + XMVECTOR Control0 = XMVectorLess(LS01, LD01); + XMVECTOR Control2 = XMVectorLess(LS23, LD23); + + SQ0 = XMVectorSelect(Q0, SQ0, Control0); + SQ3 = XMVectorSelect(Q3, SQ3, Control2); + + XMVECTOR InvQ1 = XMQuaternionInverse(Q1); + XMVECTOR InvQ2 = XMQuaternionInverse(SQ2); + + XMVECTOR LnQ0 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ0)); + XMVECTOR LnQ2 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ2)); + XMVECTOR LnQ1 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, Q1)); + XMVECTOR LnQ3 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, SQ3)); + + const XMVECTOR NegativeOneQuarter = XMVectorSplatConstant(-1, 2); + + XMVECTOR ExpQ02 = XMVectorMultiply(XMVectorAdd(LnQ0, LnQ2), NegativeOneQuarter); + XMVECTOR ExpQ13 = XMVectorMultiply(XMVectorAdd(LnQ1, LnQ3), NegativeOneQuarter); + ExpQ02 = XMQuaternionExp(ExpQ02); + ExpQ13 = XMQuaternionExp(ExpQ13); + + *pA = XMQuaternionMultiply(Q1, ExpQ02); + *pB = XMQuaternionMultiply(SQ2, ExpQ13); + *pC = SQ2; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionBaryCentric +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + float f, + float g +) noexcept +{ + float s = f + g; + + XMVECTOR Result; + if ((s < 0.00001f) && (s > -0.00001f)) + { + Result = Q0; + } + else + { + XMVECTOR Q01 = XMQuaternionSlerp(Q0, Q1, s); + XMVECTOR Q02 = XMQuaternionSlerp(Q0, Q2, s); + + Result = XMQuaternionSlerp(Q01, Q02, g / s); + } + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionBaryCentricV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + GXMVECTOR F, + HXMVECTOR G +) noexcept +{ + assert((XMVectorGetY(F) == XMVectorGetX(F)) && (XMVectorGetZ(F) == XMVectorGetX(F)) && (XMVectorGetW(F) == XMVectorGetX(F))); + assert((XMVectorGetY(G) == XMVectorGetX(G)) && (XMVectorGetZ(G) == XMVectorGetX(G)) && (XMVectorGetW(G) == XMVectorGetX(G))); + + const XMVECTOR Epsilon = XMVectorSplatConstant(1, 16); + + XMVECTOR S = XMVectorAdd(F, G); + + XMVECTOR Result; + if (XMVector4InBounds(S, Epsilon)) + { + Result = Q0; + } + else + { + XMVECTOR Q01 = XMQuaternionSlerpV(Q0, Q1, S); + XMVECTOR Q02 = XMQuaternionSlerpV(Q0, Q2, S); + XMVECTOR GS = XMVectorReciprocal(S); + GS = XMVectorMultiply(G, GS); + + Result = XMQuaternionSlerpV(Q01, Q02, GS); + } + + return Result; +} + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionIdentity() noexcept +{ + return g_XMIdentityR3.v; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYaw +( + float Pitch, + float Yaw, + float Roll +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + const float halfpitch = Pitch * 0.5f; + float cp = cosf(halfpitch); + float sp = sinf(halfpitch); + + const float halfyaw = Yaw * 0.5f; + float cy = cosf(halfyaw); + float sy = sinf(halfyaw); + + const float halfroll = Roll * 0.5f; + float cr = cosf(halfroll); + float sr = sinf(halfroll); + + XMVECTORF32 vResult = { { { + cr * sp * cy + sr * cp * sy, + cr * cp * sy - sr * sp * cy, + sr * cp * cy - cr * sp * sy, + cr * cp * cy + sr * sp * sy + } } }; + return vResult; +#else + XMVECTOR Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + return XMQuaternionRotationRollPitchYawFromVector(Angles); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + const float halfpitch = Angles.vector4_f32[0] * 0.5f; + float cp = cosf(halfpitch); + float sp = sinf(halfpitch); + + const float halfyaw = Angles.vector4_f32[1] * 0.5f; + float cy = cosf(halfyaw); + float sy = sinf(halfyaw); + + const float halfroll = Angles.vector4_f32[2] * 0.5f; + float cr = cosf(halfroll); + float sr = sinf(halfroll); + + XMVECTORF32 vResult = { { { + cr * sp * cy + sr * cp * sy, + cr * cp * sy - sr * sp * cy, + sr * cp * cy - cr * sp * sy, + cr * cp * cy + sr * sp * sy + } } }; + return vResult; +#else + static const XMVECTORF32 Sign = { { { 1.0f, -1.0f, -1.0f, 1.0f } } }; + + XMVECTOR HalfAngles = XMVectorMultiply(Angles, g_XMOneHalf.v); + + XMVECTOR SinAngles, CosAngles; + XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); + + XMVECTOR P0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR Y0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR R0 = XMVectorPermute(SinAngles, CosAngles); + XMVECTOR P1 = XMVectorPermute(CosAngles, SinAngles); + XMVECTOR Y1 = XMVectorPermute(CosAngles, SinAngles); + XMVECTOR R1 = XMVectorPermute(CosAngles, SinAngles); + + XMVECTOR Q1 = XMVectorMultiply(P1, Sign.v); + XMVECTOR Q0 = XMVectorMultiply(P0, Y0); + Q1 = XMVectorMultiply(Q1, Y1); + Q0 = XMVectorMultiply(Q0, R0); + XMVECTOR Q = XMVectorMultiplyAdd(Q1, R1, Q0); + + return Q; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationNormal +( + FXMVECTOR NormalAxis, + float Angle +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR N = XMVectorSelect(g_XMOne.v, NormalAxis, g_XMSelect1110.v); + + float SinV, CosV; + XMScalarSinCos(&SinV, &CosV, 0.5f * Angle); + + XMVECTOR Scale = XMVectorSet(SinV, SinV, SinV, CosV); + return XMVectorMultiply(N, Scale); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N = _mm_and_ps(NormalAxis, g_XMMask3); + N = _mm_or_ps(N, g_XMIdentityR3); + XMVECTOR Scale = _mm_set_ps1(0.5f * Angle); + XMVECTOR vSine; + XMVECTOR vCosine; + XMVectorSinCos(&vSine, &vCosine, Scale); + Scale = _mm_and_ps(vSine, g_XMMask3); + vCosine = _mm_and_ps(vCosine, g_XMMaskW); + Scale = _mm_or_ps(Scale, vCosine); + N = _mm_mul_ps(N, Scale); + return N; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationAxis +( + FXMVECTOR Axis, + float Angle +) noexcept +{ + assert(!XMVector3Equal(Axis, XMVectorZero())); + assert(!XMVector3IsInfinite(Axis)); + + XMVECTOR Normal = XMVector3Normalize(Axis); + XMVECTOR Q = XMQuaternionRotationNormal(Normal, Angle); + return Q; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMQuaternionRotationMatrix(FXMMATRIX M) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 q; + float r22 = M.m[2][2]; + if (r22 <= 0.f) // x^2 + y^2 >= z^2 + w^2 + { + float dif10 = M.m[1][1] - M.m[0][0]; + float omr22 = 1.f - r22; + if (dif10 <= 0.f) // x^2 >= y^2 + { + float fourXSqr = omr22 - dif10; + float inv4x = 0.5f / sqrtf(fourXSqr); + q.f[0] = fourXSqr * inv4x; + q.f[1] = (M.m[0][1] + M.m[1][0]) * inv4x; + q.f[2] = (M.m[0][2] + M.m[2][0]) * inv4x; + q.f[3] = (M.m[1][2] - M.m[2][1]) * inv4x; + } + else // y^2 >= x^2 + { + float fourYSqr = omr22 + dif10; + float inv4y = 0.5f / sqrtf(fourYSqr); + q.f[0] = (M.m[0][1] + M.m[1][0]) * inv4y; + q.f[1] = fourYSqr * inv4y; + q.f[2] = (M.m[1][2] + M.m[2][1]) * inv4y; + q.f[3] = (M.m[2][0] - M.m[0][2]) * inv4y; + } + } + else // z^2 + w^2 >= x^2 + y^2 + { + float sum10 = M.m[1][1] + M.m[0][0]; + float opr22 = 1.f + r22; + if (sum10 <= 0.f) // z^2 >= w^2 + { + float fourZSqr = opr22 - sum10; + float inv4z = 0.5f / sqrtf(fourZSqr); + q.f[0] = (M.m[0][2] + M.m[2][0]) * inv4z; + q.f[1] = (M.m[1][2] + M.m[2][1]) * inv4z; + q.f[2] = fourZSqr * inv4z; + q.f[3] = (M.m[0][1] - M.m[1][0]) * inv4z; + } + else // w^2 >= z^2 + { + float fourWSqr = opr22 + sum10; + float inv4w = 0.5f / sqrtf(fourWSqr); + q.f[0] = (M.m[1][2] - M.m[2][1]) * inv4w; + q.f[1] = (M.m[2][0] - M.m[0][2]) * inv4w; + q.f[2] = (M.m[0][1] - M.m[1][0]) * inv4w; + q.f[3] = fourWSqr * inv4w; + } + } + return q.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 XMPMMP = { { { +1.0f, -1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMPMP = { { { -1.0f, +1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMMPP = { { { -1.0f, -1.0f, +1.0f, +1.0f } } }; + static const XMVECTORU32 Select0110 = { { { XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0 } } }; + static const XMVECTORU32 Select0010 = { { { XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0 } } }; + + float32x4_t r0 = M.r[0]; + float32x4_t r1 = M.r[1]; + float32x4_t r2 = M.r[2]; + + float32x4_t r00 = vdupq_lane_f32(vget_low_f32(r0), 0); + float32x4_t r11 = vdupq_lane_f32(vget_low_f32(r1), 1); + float32x4_t r22 = vdupq_lane_f32(vget_high_f32(r2), 0); + + // x^2 >= y^2 equivalent to r11 - r00 <= 0 + float32x4_t r11mr00 = vsubq_f32(r11, r00); + uint32x4_t x2gey2 = vcleq_f32(r11mr00, g_XMZero); + + // z^2 >= w^2 equivalent to r11 + r00 <= 0 + float32x4_t r11pr00 = vaddq_f32(r11, r00); + uint32x4_t z2gew2 = vcleq_f32(r11pr00, g_XMZero); + + // x^2 + y^2 >= z^2 + w^2 equivalent to r22 <= 0 + uint32x4_t x2py2gez2pw2 = vcleq_f32(r22, g_XMZero); + + // (4*x^2, 4*y^2, 4*z^2, 4*w^2) + float32x4_t t0 = vmulq_f32(XMPMMP, r00); + float32x4_t x2y2z2w2 = vmlaq_f32(t0, XMMPMP, r11); + x2y2z2w2 = vmlaq_f32(x2y2z2w2, XMMMPP, r22); + x2y2z2w2 = vaddq_f32(x2y2z2w2, g_XMOne); + + // (r01, r02, r12, r11) + t0 = vextq_f32(r0, r0, 1); + float32x4_t t1 = vextq_f32(r1, r1, 1); + t0 = vcombine_f32(vget_low_f32(t0), vrev64_f32(vget_low_f32(t1))); + + // (r10, r20, r21, r10) + t1 = vextq_f32(r2, r2, 3); + float32x4_t r10 = vdupq_lane_f32(vget_low_f32(r1), 0); + t1 = vbslq_f32(Select0110, t1, r10); + + // (4*x*y, 4*x*z, 4*y*z, unused) + float32x4_t xyxzyz = vaddq_f32(t0, t1); + + // (r21, r20, r10, r10) + t0 = vcombine_f32(vrev64_f32(vget_low_f32(r2)), vget_low_f32(r10)); + + // (r12, r02, r01, r12) + float32x4_t t2 = vcombine_f32(vrev64_f32(vget_high_f32(r0)), vrev64_f32(vget_low_f32(r0))); + float32x4_t t3 = vdupq_lane_f32(vget_high_f32(r1), 0); + t1 = vbslq_f32(Select0110, t2, t3); + + // (4*x*w, 4*y*w, 4*z*w, unused) + float32x4_t xwywzw = vsubq_f32(t0, t1); + xwywzw = vmulq_f32(XMMPMP, xwywzw); + + // (4*x*x, 4*x*y, 4*x*z, 4*x*w) + t0 = vextq_f32(xyxzyz, xyxzyz, 3); + t1 = vbslq_f32(Select0110, t0, x2y2z2w2); + t2 = vdupq_lane_f32(vget_low_f32(xwywzw), 0); + float32x4_t tensor0 = vbslq_f32(g_XMSelect1110, t1, t2); + + // (4*y*x, 4*y*y, 4*y*z, 4*y*w) + t0 = vbslq_f32(g_XMSelect1011, xyxzyz, x2y2z2w2); + t1 = vdupq_lane_f32(vget_low_f32(xwywzw), 1); + float32x4_t tensor1 = vbslq_f32(g_XMSelect1110, t0, t1); + + // (4*z*x, 4*z*y, 4*z*z, 4*z*w) + t0 = vextq_f32(xyxzyz, xyxzyz, 1); + t1 = vcombine_f32(vget_low_f32(t0), vrev64_f32(vget_high_f32(xwywzw))); + float32x4_t tensor2 = vbslq_f32(Select0010, x2y2z2w2, t1); + + // (4*w*x, 4*w*y, 4*w*z, 4*w*w) + float32x4_t tensor3 = vbslq_f32(g_XMSelect1110, xwywzw, x2y2z2w2); + + // Select the row of the tensor-product matrix that has the largest + // magnitude. + t0 = vbslq_f32(x2gey2, tensor0, tensor1); + t1 = vbslq_f32(z2gew2, tensor2, tensor3); + t2 = vbslq_f32(x2py2gez2pw2, t0, t1); + + // Normalize the row. No division by zero is possible because the + // quaternion is unit-length (and the row is a nonzero multiple of + // the quaternion). + t0 = XMVector4Length(t2); + return XMVectorDivide(t2, t0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 XMPMMP = { { { +1.0f, -1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMPMP = { { { -1.0f, +1.0f, -1.0f, +1.0f } } }; + static const XMVECTORF32 XMMMPP = { { { -1.0f, -1.0f, +1.0f, +1.0f } } }; + + XMVECTOR r0 = M.r[0]; // (r00, r01, r02, 0) + XMVECTOR r1 = M.r[1]; // (r10, r11, r12, 0) + XMVECTOR r2 = M.r[2]; // (r20, r21, r22, 0) + + // (r00, r00, r00, r00) + XMVECTOR r00 = XM_PERMUTE_PS(r0, _MM_SHUFFLE(0, 0, 0, 0)); + // (r11, r11, r11, r11) + XMVECTOR r11 = XM_PERMUTE_PS(r1, _MM_SHUFFLE(1, 1, 1, 1)); + // (r22, r22, r22, r22) + XMVECTOR r22 = XM_PERMUTE_PS(r2, _MM_SHUFFLE(2, 2, 2, 2)); + + // x^2 >= y^2 equivalent to r11 - r00 <= 0 + // (r11 - r00, r11 - r00, r11 - r00, r11 - r00) + XMVECTOR r11mr00 = _mm_sub_ps(r11, r00); + XMVECTOR x2gey2 = _mm_cmple_ps(r11mr00, g_XMZero); + + // z^2 >= w^2 equivalent to r11 + r00 <= 0 + // (r11 + r00, r11 + r00, r11 + r00, r11 + r00) + XMVECTOR r11pr00 = _mm_add_ps(r11, r00); + XMVECTOR z2gew2 = _mm_cmple_ps(r11pr00, g_XMZero); + + // x^2 + y^2 >= z^2 + w^2 equivalent to r22 <= 0 + XMVECTOR x2py2gez2pw2 = _mm_cmple_ps(r22, g_XMZero); + + // (4*x^2, 4*y^2, 4*z^2, 4*w^2) + XMVECTOR t0 = XM_FMADD_PS(XMPMMP, r00, g_XMOne); + XMVECTOR t1 = _mm_mul_ps(XMMPMP, r11); + XMVECTOR t2 = XM_FMADD_PS(XMMMPP, r22, t0); + XMVECTOR x2y2z2w2 = _mm_add_ps(t1, t2); + + // (r01, r02, r12, r11) + t0 = _mm_shuffle_ps(r0, r1, _MM_SHUFFLE(1, 2, 2, 1)); + // (r10, r10, r20, r21) + t1 = _mm_shuffle_ps(r1, r2, _MM_SHUFFLE(1, 0, 0, 0)); + // (r10, r20, r21, r10) + t1 = XM_PERMUTE_PS(t1, _MM_SHUFFLE(1, 3, 2, 0)); + // (4*x*y, 4*x*z, 4*y*z, unused) + XMVECTOR xyxzyz = _mm_add_ps(t0, t1); + + // (r21, r20, r10, r10) + t0 = _mm_shuffle_ps(r2, r1, _MM_SHUFFLE(0, 0, 0, 1)); + // (r12, r12, r02, r01) + t1 = _mm_shuffle_ps(r1, r0, _MM_SHUFFLE(1, 2, 2, 2)); + // (r12, r02, r01, r12) + t1 = XM_PERMUTE_PS(t1, _MM_SHUFFLE(1, 3, 2, 0)); + // (4*x*w, 4*y*w, 4*z*w, unused) + XMVECTOR xwywzw = _mm_sub_ps(t0, t1); + xwywzw = _mm_mul_ps(XMMPMP, xwywzw); + + // (4*x^2, 4*y^2, 4*x*y, unused) + t0 = _mm_shuffle_ps(x2y2z2w2, xyxzyz, _MM_SHUFFLE(0, 0, 1, 0)); + // (4*z^2, 4*w^2, 4*z*w, unused) + t1 = _mm_shuffle_ps(x2y2z2w2, xwywzw, _MM_SHUFFLE(0, 2, 3, 2)); + // (4*x*z, 4*y*z, 4*x*w, 4*y*w) + t2 = _mm_shuffle_ps(xyxzyz, xwywzw, _MM_SHUFFLE(1, 0, 2, 1)); + + // (4*x*x, 4*x*y, 4*x*z, 4*x*w) + XMVECTOR tensor0 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0)); + // (4*y*x, 4*y*y, 4*y*z, 4*y*w) + XMVECTOR tensor1 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 1, 2)); + // (4*z*x, 4*z*y, 4*z*z, 4*z*w) + XMVECTOR tensor2 = _mm_shuffle_ps(t2, t1, _MM_SHUFFLE(2, 0, 1, 0)); + // (4*w*x, 4*w*y, 4*w*z, 4*w*w) + XMVECTOR tensor3 = _mm_shuffle_ps(t2, t1, _MM_SHUFFLE(1, 2, 3, 2)); + + // Select the row of the tensor-product matrix that has the largest + // magnitude. + t0 = _mm_and_ps(x2gey2, tensor0); + t1 = _mm_andnot_ps(x2gey2, tensor1); + t0 = _mm_or_ps(t0, t1); + t1 = _mm_and_ps(z2gew2, tensor2); + t2 = _mm_andnot_ps(z2gew2, tensor3); + t1 = _mm_or_ps(t1, t2); + t0 = _mm_and_ps(x2py2gez2pw2, t0); + t1 = _mm_andnot_ps(x2py2gez2pw2, t1); + t2 = _mm_or_ps(t0, t1); + + // Normalize the row. No division by zero is possible because the + // quaternion is unit-length (and the row is a nonzero multiple of + // the quaternion). + t0 = XMVector4Length(t2); + return _mm_div_ps(t2, t0); +#endif +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMQuaternionToAxisAngle +( + XMVECTOR* pAxis, + float* pAngle, + FXMVECTOR Q +) noexcept +{ + assert(pAxis); + assert(pAngle); + + *pAxis = Q; + + *pAngle = 2.0f * XMScalarACos(XMVectorGetW(Q)); +} + +/**************************************************************************** + * + * Plane + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) noexcept +{ + return XMVector4Equal(P1, P2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneNearEqual +( + FXMVECTOR P1, + FXMVECTOR P2, + FXMVECTOR Epsilon +) noexcept +{ + XMVECTOR NP1 = XMPlaneNormalize(P1); + XMVECTOR NP2 = XMPlaneNormalize(P2); + return XMVector4NearEqual(NP1, NP2, Epsilon); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneNotEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) noexcept +{ + return XMVector4NotEqual(P1, P2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneIsNaN(FXMVECTOR P) noexcept +{ + return XMVector4IsNaN(P); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMPlaneIsInfinite(FXMVECTOR P) noexcept +{ + return XMVector4IsInfinite(P); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneDot +( + FXMVECTOR P, + FXMVECTOR V +) noexcept +{ + return XMVector4Dot(P, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneDotCoord +( + FXMVECTOR P, + FXMVECTOR V +) noexcept +{ + // Result = P[0] * V[0] + P[1] * V[1] + P[2] * V[2] + P[3] + + XMVECTOR V3 = XMVectorSelect(g_XMOne.v, V, g_XMSelect1110.v); + XMVECTOR Result = XMVector4Dot(P, V3); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneDotNormal +( + FXMVECTOR P, + FXMVECTOR V +) noexcept +{ + return XMVector3Dot(P, V); +} + +//------------------------------------------------------------------------------ +// XMPlaneNormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMPlaneNormalizeEst(FXMVECTOR P) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR Result = XMVector3ReciprocalLengthEst(P); + return XMVectorMultiply(P, Result); + +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(P, P, 0x7f); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, P); +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(P, P); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.z + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_mul_ps(vDot, P); + return vDot; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fLengthSq = sqrtf((P.vector4_f32[0] * P.vector4_f32[0]) + (P.vector4_f32[1] * P.vector4_f32[1]) + (P.vector4_f32[2] * P.vector4_f32[2])); + // Prevent divide by zero + if (fLengthSq > 0) + { + fLengthSq = 1.0f / fLengthSq; + } + XMVECTORF32 vResult = { { { + P.vector4_f32[0] * fLengthSq, + P.vector4_f32[1] * fLengthSq, + P.vector4_f32[2] * fLengthSq, + P.vector4_f32[3] * fLengthSq + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vLength = XMVector3ReciprocalLength(P); + return XMVectorMultiply(P, vLength); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(P, P, 0x7f); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(P, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vLengthSq); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(P, P); + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 1, 2, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(P, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vLengthSq); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneIntersectLine +( + FXMVECTOR P, + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2 +) noexcept +{ + XMVECTOR V1 = XMVector3Dot(P, LinePoint1); + XMVECTOR V2 = XMVector3Dot(P, LinePoint2); + XMVECTOR D = XMVectorSubtract(V1, V2); + + XMVECTOR VT = XMPlaneDotCoord(P, LinePoint1); + VT = XMVectorDivide(VT, D); + + XMVECTOR Point = XMVectorSubtract(LinePoint2, LinePoint1); + Point = XMVectorMultiplyAdd(Point, VT, LinePoint1); + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR Control = XMVectorNearEqual(D, Zero, g_XMEpsilon.v); + + return XMVectorSelect(Point, g_XMQNaN.v, Control); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMPlaneIntersectPlane +( + XMVECTOR* pLinePoint1, + XMVECTOR* pLinePoint2, + FXMVECTOR P1, + FXMVECTOR P2 +) noexcept +{ + assert(pLinePoint1); + assert(pLinePoint2); + + XMVECTOR V1 = XMVector3Cross(P2, P1); + + XMVECTOR LengthSq = XMVector3LengthSq(V1); + + XMVECTOR V2 = XMVector3Cross(P2, V1); + + XMVECTOR P1W = XMVectorSplatW(P1); + XMVECTOR Point = XMVectorMultiply(V2, P1W); + + XMVECTOR V3 = XMVector3Cross(V1, P1); + + XMVECTOR P2W = XMVectorSplatW(P2); + Point = XMVectorMultiplyAdd(V3, P2W, Point); + + XMVECTOR LinePoint1 = XMVectorDivide(Point, LengthSq); + + XMVECTOR LinePoint2 = XMVectorAdd(LinePoint1, V1); + + XMVECTOR Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon.v); + *pLinePoint1 = XMVectorSelect(LinePoint1, g_XMQNaN.v, Control); + *pLinePoint2 = XMVectorSelect(LinePoint2, g_XMQNaN.v, Control); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneTransform +( + FXMVECTOR P, + FXMMATRIX ITM +) noexcept +{ + XMVECTOR W = XMVectorSplatW(P); + XMVECTOR Z = XMVectorSplatZ(P); + XMVECTOR Y = XMVectorSplatY(P); + XMVECTOR X = XMVectorSplatX(P); + + XMVECTOR Result = XMVectorMultiply(W, ITM.r[3]); + Result = XMVectorMultiplyAdd(Z, ITM.r[2], Result); + Result = XMVectorMultiplyAdd(Y, ITM.r[1], Result); + Result = XMVectorMultiplyAdd(X, ITM.r[0], Result); + return Result; +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMPlaneTransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT4* pInputStream, + size_t InputStride, + size_t PlaneCount, + FXMMATRIX ITM +) noexcept +{ + return XMVector4TransformStream(pOutputStream, + OutputStride, + pInputStream, + InputStride, + PlaneCount, + ITM); +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneFromPointNormal +( + FXMVECTOR Point, + FXMVECTOR Normal +) noexcept +{ + XMVECTOR W = XMVector3Dot(Point, Normal); + W = XMVectorNegate(W); + return XMVectorSelect(W, Normal, g_XMSelect1110.v); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMPlaneFromPoints +( + FXMVECTOR Point1, + FXMVECTOR Point2, + FXMVECTOR Point3 +) noexcept +{ + XMVECTOR V21 = XMVectorSubtract(Point1, Point2); + XMVECTOR V31 = XMVectorSubtract(Point1, Point3); + + XMVECTOR N = XMVector3Cross(V21, V31); + N = XMVector3Normalize(N); + + XMVECTOR D = XMPlaneDotNormal(N, Point1); + D = XMVectorNegate(D); + + XMVECTOR Result = XMVectorSelect(D, N, g_XMSelect1110.v); + + return Result; +} + +/**************************************************************************** + * + * Color + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4Equal(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorNotEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4NotEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorGreater +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4Greater(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorGreaterOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4GreaterOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorLess +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4Less(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorLessOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVector4LessOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorIsNaN(FXMVECTOR C) noexcept +{ + return XMVector4IsNaN(C); +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMColorIsInfinite(FXMVECTOR C) noexcept +{ + return XMVector4IsInfinite(C); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorNegative(FXMVECTOR vColor) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + 1.0f - vColor.vector4_f32[0], + 1.0f - vColor.vector4_f32[1], + 1.0f - vColor.vector4_f32[2], + vColor.vector4_f32[3] + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vTemp = veorq_u32(vreinterpretq_u32_f32(vColor), g_XMNegate3); + return vaddq_f32(vreinterpretq_f32_u32(vTemp), g_XMOne3); +#elif defined(_XM_SSE_INTRINSICS_) + // Negate only x,y and z. + XMVECTOR vTemp = _mm_xor_ps(vColor, g_XMNegate3); + // Add 1,1,1,0 to -x,-y,-z,w + return _mm_add_ps(vTemp, g_XMOne3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorModulate +( + FXMVECTOR C1, + FXMVECTOR C2 +) noexcept +{ + return XMVectorMultiply(C1, C2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorAdjustSaturation +( + FXMVECTOR vColor, + float fSaturation +) noexcept +{ + // Luminance = 0.2125f * C[0] + 0.7154f * C[1] + 0.0721f * C[2]; + // Result = (C - Luminance) * Saturation + Luminance; + + const XMVECTORF32 gvLuminance = { { { 0.2125f, 0.7154f, 0.0721f, 0.0f } } }; +#if defined(_XM_NO_INTRINSICS_) + float fLuminance = (vColor.vector4_f32[0] * gvLuminance.f[0]) + (vColor.vector4_f32[1] * gvLuminance.f[1]) + (vColor.vector4_f32[2] * gvLuminance.f[2]); + XMVECTOR vResult; + vResult.vector4_f32[0] = ((vColor.vector4_f32[0] - fLuminance) * fSaturation) + fLuminance; + vResult.vector4_f32[1] = ((vColor.vector4_f32[1] - fLuminance) * fSaturation) + fLuminance; + vResult.vector4_f32[2] = ((vColor.vector4_f32[2] - fLuminance) * fSaturation) + fLuminance; + vResult.vector4_f32[3] = vColor.vector4_f32[3]; + return vResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vLuminance = XMVector3Dot(vColor, gvLuminance); + XMVECTOR vResult = vsubq_f32(vColor, vLuminance); + vResult = vmlaq_n_f32(vLuminance, vResult, fSaturation); + return vbslq_f32(g_XMSelect1110, vResult, vColor); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vLuminance = XMVector3Dot(vColor, gvLuminance); + // Splat fSaturation + XMVECTOR vSaturation = _mm_set_ps1(fSaturation); + // vResult = ((vColor-vLuminance)*vSaturation)+vLuminance; + XMVECTOR vResult = _mm_sub_ps(vColor, vLuminance); + vResult = XM_FMADD_PS(vResult, vSaturation, vLuminance); + // Retain w from the source color + vLuminance = _mm_shuffle_ps(vResult, vColor, _MM_SHUFFLE(3, 2, 2, 2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult, vLuminance, _MM_SHUFFLE(3, 0, 1, 0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorAdjustContrast +( + FXMVECTOR vColor, + float fContrast +) noexcept +{ + // Result = (vColor - 0.5f) * fContrast + 0.5f; + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + ((vColor.vector4_f32[0] - 0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[1] - 0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[2] - 0.5f) * fContrast) + 0.5f, + vColor.vector4_f32[3] // Leave W untouched + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vResult = vsubq_f32(vColor, g_XMOneHalf.v); + vResult = vmlaq_n_f32(g_XMOneHalf.v, vResult, fContrast); + return vbslq_f32(g_XMSelect1110, vResult, vColor); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(fContrast); // Splat the scale + XMVECTOR vResult = _mm_sub_ps(vColor, g_XMOneHalf); // Subtract 0.5f from the source (Saving source) + vResult = XM_FMADD_PS(vResult, vScale, g_XMOneHalf); +// Retain w from the source color + vScale = _mm_shuffle_ps(vResult, vColor, _MM_SHUFFLE(3, 2, 2, 2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult, vScale, _MM_SHUFFLE(3, 0, 1, 0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept +{ + XMVECTOR r = XMVectorSplatX(rgb); + XMVECTOR g = XMVectorSplatY(rgb); + XMVECTOR b = XMVectorSplatZ(rgb); + + XMVECTOR min = XMVectorMin(r, XMVectorMin(g, b)); + XMVECTOR max = XMVectorMax(r, XMVectorMax(g, b)); + + XMVECTOR l = XMVectorMultiply(XMVectorAdd(min, max), g_XMOneHalf); + + XMVECTOR d = XMVectorSubtract(max, min); + + XMVECTOR la = XMVectorSelect(rgb, l, g_XMSelect1110); + + if (XMVector3Less(d, g_XMEpsilon)) + { + // Achromatic, assume H and S of 0 + return XMVectorSelect(la, g_XMZero, g_XMSelect1100); + } + else + { + XMVECTOR s, h; + + XMVECTOR d2 = XMVectorAdd(min, max); + + if (XMVector3Greater(l, g_XMOneHalf)) + { + // d / (2-max-min) + s = XMVectorDivide(d, XMVectorSubtract(g_XMTwo, d2)); + } + else + { + // d / (max+min) + s = XMVectorDivide(d, d2); + } + + if (XMVector3Equal(r, max)) + { + // Red is max + h = XMVectorDivide(XMVectorSubtract(g, b), d); + } + else if (XMVector3Equal(g, max)) + { + // Green is max + h = XMVectorDivide(XMVectorSubtract(b, r), d); + h = XMVectorAdd(h, g_XMTwo); + } + else + { + // Blue is max + h = XMVectorDivide(XMVectorSubtract(r, g), d); + h = XMVectorAdd(h, g_XMFour); + } + + h = XMVectorDivide(h, g_XMSix); + + if (XMVector3Less(h, g_XMZero)) + h = XMVectorAdd(h, g_XMOne); + + XMVECTOR lha = XMVectorSelect(la, h, g_XMSelect1100); + return XMVectorSelect(s, lha, g_XMSelect1011); + } +} + +//------------------------------------------------------------------------------ + +namespace MathInternal +{ + + inline XMVECTOR XM_CALLCONV XMColorHue2Clr(FXMVECTOR p, FXMVECTOR q, FXMVECTOR h) noexcept + { + static const XMVECTORF32 oneSixth = { { { 1.0f / 6.0f, 1.0f / 6.0f, 1.0f / 6.0f, 1.0f / 6.0f } } }; + static const XMVECTORF32 twoThirds = { { { 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f } } }; + + XMVECTOR t = h; + + if (XMVector3Less(t, g_XMZero)) + t = XMVectorAdd(t, g_XMOne); + + if (XMVector3Greater(t, g_XMOne)) + t = XMVectorSubtract(t, g_XMOne); + + if (XMVector3Less(t, oneSixth)) + { + // p + (q - p) * 6 * t + XMVECTOR t1 = XMVectorSubtract(q, p); + XMVECTOR t2 = XMVectorMultiply(g_XMSix, t); + return XMVectorMultiplyAdd(t1, t2, p); + } + + if (XMVector3Less(t, g_XMOneHalf)) + return q; + + if (XMVector3Less(t, twoThirds)) + { + // p + (q - p) * 6 * (2/3 - t) + XMVECTOR t1 = XMVectorSubtract(q, p); + XMVECTOR t2 = XMVectorMultiply(g_XMSix, XMVectorSubtract(twoThirds, t)); + return XMVectorMultiplyAdd(t1, t2, p); + } + + return p; + } + +} // namespace MathInternal + +inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept +{ + static const XMVECTORF32 oneThird = { { { 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f } } }; + + XMVECTOR s = XMVectorSplatY(hsl); + XMVECTOR l = XMVectorSplatZ(hsl); + + if (XMVector3NearEqual(s, g_XMZero, g_XMEpsilon)) + { + // Achromatic + return XMVectorSelect(hsl, l, g_XMSelect1110); + } + else + { + XMVECTOR h = XMVectorSplatX(hsl); + + XMVECTOR q; + if (XMVector3Less(l, g_XMOneHalf)) + { + q = XMVectorMultiply(l, XMVectorAdd(g_XMOne, s)); + } + else + { + q = XMVectorSubtract(XMVectorAdd(l, s), XMVectorMultiply(l, s)); + } + + XMVECTOR p = XMVectorSubtract(XMVectorMultiply(g_XMTwo, l), q); + + XMVECTOR r = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird)); + XMVECTOR g = DirectX::MathInternal::XMColorHue2Clr(p, q, h); + XMVECTOR b = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird)); + + XMVECTOR rg = XMVectorSelect(g, r, g_XMSelect1000); + XMVECTOR ba = XMVectorSelect(hsl, b, g_XMSelect1110); + + return XMVectorSelect(ba, rg, g_XMSelect1100); + } +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToHSV(FXMVECTOR rgb) noexcept +{ + XMVECTOR r = XMVectorSplatX(rgb); + XMVECTOR g = XMVectorSplatY(rgb); + XMVECTOR b = XMVectorSplatZ(rgb); + + XMVECTOR min = XMVectorMin(r, XMVectorMin(g, b)); + XMVECTOR v = XMVectorMax(r, XMVectorMax(g, b)); + + XMVECTOR d = XMVectorSubtract(v, min); + + XMVECTOR s = (XMVector3NearEqual(v, g_XMZero, g_XMEpsilon)) ? g_XMZero : XMVectorDivide(d, v); + + if (XMVector3Less(d, g_XMEpsilon)) + { + // Achromatic, assume H of 0 + XMVECTOR hv = XMVectorSelect(v, g_XMZero, g_XMSelect1000); + XMVECTOR hva = XMVectorSelect(rgb, hv, g_XMSelect1110); + return XMVectorSelect(s, hva, g_XMSelect1011); + } + else + { + XMVECTOR h; + + if (XMVector3Equal(r, v)) + { + // Red is max + h = XMVectorDivide(XMVectorSubtract(g, b), d); + + if (XMVector3Less(g, b)) + h = XMVectorAdd(h, g_XMSix); + } + else if (XMVector3Equal(g, v)) + { + // Green is max + h = XMVectorDivide(XMVectorSubtract(b, r), d); + h = XMVectorAdd(h, g_XMTwo); + } + else + { + // Blue is max + h = XMVectorDivide(XMVectorSubtract(r, g), d); + h = XMVectorAdd(h, g_XMFour); + } + + h = XMVectorDivide(h, g_XMSix); + + XMVECTOR hv = XMVectorSelect(v, h, g_XMSelect1000); + XMVECTOR hva = XMVectorSelect(rgb, hv, g_XMSelect1110); + return XMVectorSelect(s, hva, g_XMSelect1011); + } +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorHSVToRGB(FXMVECTOR hsv) noexcept +{ + XMVECTOR h = XMVectorSplatX(hsv); + XMVECTOR s = XMVectorSplatY(hsv); + XMVECTOR v = XMVectorSplatZ(hsv); + + XMVECTOR h6 = XMVectorMultiply(h, g_XMSix); + + XMVECTOR i = XMVectorFloor(h6); + XMVECTOR f = XMVectorSubtract(h6, i); + + // p = v* (1-s) + XMVECTOR p = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, s)); + + // q = v*(1-f*s) + XMVECTOR q = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, XMVectorMultiply(f, s))); + + // t = v*(1 - (1-f)*s) + XMVECTOR t = XMVectorMultiply(v, XMVectorSubtract(g_XMOne, XMVectorMultiply(XMVectorSubtract(g_XMOne, f), s))); + + auto ii = static_cast(XMVectorGetX(XMVectorMod(i, g_XMSix))); + + XMVECTOR _rgb; + + switch (ii) + { + case 0: // rgb = vtp + { + XMVECTOR vt = XMVectorSelect(t, v, g_XMSelect1000); + _rgb = XMVectorSelect(p, vt, g_XMSelect1100); + } + break; + case 1: // rgb = qvp + { + XMVECTOR qv = XMVectorSelect(v, q, g_XMSelect1000); + _rgb = XMVectorSelect(p, qv, g_XMSelect1100); + } + break; + case 2: // rgb = pvt + { + XMVECTOR pv = XMVectorSelect(v, p, g_XMSelect1000); + _rgb = XMVectorSelect(t, pv, g_XMSelect1100); + } + break; + case 3: // rgb = pqv + { + XMVECTOR pq = XMVectorSelect(q, p, g_XMSelect1000); + _rgb = XMVectorSelect(v, pq, g_XMSelect1100); + } + break; + case 4: // rgb = tpv + { + XMVECTOR tp = XMVectorSelect(p, t, g_XMSelect1000); + _rgb = XMVectorSelect(v, tp, g_XMSelect1100); + } + break; + default: // rgb = vpq + { + XMVECTOR vp = XMVectorSelect(p, v, g_XMSelect1000); + _rgb = XMVectorSelect(q, vp, g_XMSelect1100); + } + break; + } + + return XMVectorSelect(hsv, _rgb, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToYUV(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.299f, -0.147f, 0.615f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.587f, -0.289f, -0.515f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.114f, 0.436f, -0.100f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(rgb, M); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorYUVToRGB(FXMVECTOR yuv) noexcept +{ + static const XMVECTORF32 Scale1 = { { { 0.0f, -0.395f, 2.032f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 1.140f, -0.581f, 0.0f, 0.0f } } }; + + XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(yuv, M); + + return XMVectorSelect(yuv, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToYUV_HD(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.2126f, -0.0997f, 0.6150f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.7152f, -0.3354f, -0.5586f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.0722f, 0.4351f, -0.0564f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(rgb, M); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorYUVToRGB_HD(FXMVECTOR yuv) noexcept +{ + static const XMVECTORF32 Scale1 = { { { 0.0f, -0.2153f, 2.1324f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 1.2803f, -0.3806f, 0.0f, 0.0f } } }; + + XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(yuv, M); + + return XMVectorSelect(yuv, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToYUV_UHD(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.2627f, -0.1215f, 0.6150f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.6780f, -0.3136f, -0.5655f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.0593f, 0.4351f, -0.0495f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(rgb, M); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorYUVToRGB_UHD(FXMVECTOR yuv) noexcept +{ + static const XMVECTORF32 Scale1 = { { { 0.0f, -0.1891f, 2.1620f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 1.1989f, -0.4645f, 0.0f, 0.0f } } }; + + XMMATRIX M(g_XMOne, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(yuv, M); + + return XMVectorSelect(yuv, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToXYZ(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.4887180f, 0.1762044f, 0.0000000f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.3106803f, 0.8129847f, 0.0102048f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.2006017f, 0.0108109f, 0.9897952f, 0.0f } } }; + static const XMVECTORF32 Scale = { { { 1.f / 0.17697f, 1.f / 0.17697f, 1.f / 0.17697f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVectorMultiply(XMVector3Transform(rgb, M), Scale); + + return XMVectorSelect(rgb, clr, g_XMSelect1110); +} + +inline XMVECTOR XM_CALLCONV XMColorXYZToRGB(FXMVECTOR xyz) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 2.3706743f, -0.5138850f, 0.0052982f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { -0.9000405f, 1.4253036f, -0.0146949f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { -0.4706338f, 0.0885814f, 1.0093968f, 0.0f } } }; + static const XMVECTORF32 Scale = { { { 0.17697f, 0.17697f, 0.17697f, 0.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(XMVectorMultiply(xyz, Scale), M); + + return XMVectorSelect(xyz, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorXYZToSRGB(FXMVECTOR xyz) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 3.2406f, -0.9689f, 0.0557f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { -1.5372f, 1.8758f, -0.2040f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { -0.4986f, 0.0415f, 1.0570f, 0.0f } } }; + static const XMVECTORF32 Cutoff = { { { 0.0031308f, 0.0031308f, 0.0031308f, 0.0f } } }; + static const XMVECTORF32 Exp = { { { 1.0f / 2.4f, 1.0f / 2.4f, 1.0f / 2.4f, 1.0f } } }; + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR lclr = XMVector3Transform(xyz, M); + + XMVECTOR sel = XMVectorGreater(lclr, Cutoff); + + // clr = 12.92 * lclr for lclr <= 0.0031308f + XMVECTOR smallC = XMVectorMultiply(lclr, g_XMsrgbScale); + + // clr = (1+a)*pow(lclr, 1/2.4) - a for lclr > 0.0031308 (where a = 0.055) + XMVECTOR largeC = XMVectorSubtract(XMVectorMultiply(g_XMsrgbA1, XMVectorPow(lclr, Exp)), g_XMsrgbA); + + XMVECTOR clr = XMVectorSelect(smallC, largeC, sel); + + return XMVectorSelect(xyz, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorSRGBToXYZ(FXMVECTOR srgb) noexcept +{ + static const XMVECTORF32 Scale0 = { { { 0.4124f, 0.2126f, 0.0193f, 0.0f } } }; + static const XMVECTORF32 Scale1 = { { { 0.3576f, 0.7152f, 0.1192f, 0.0f } } }; + static const XMVECTORF32 Scale2 = { { { 0.1805f, 0.0722f, 0.9505f, 0.0f } } }; + static const XMVECTORF32 Cutoff = { { { 0.04045f, 0.04045f, 0.04045f, 0.0f } } }; + static const XMVECTORF32 Exp = { { { 2.4f, 2.4f, 2.4f, 1.0f } } }; + + XMVECTOR sel = XMVectorGreater(srgb, Cutoff); + + // lclr = clr / 12.92 + XMVECTOR smallC = XMVectorDivide(srgb, g_XMsrgbScale); + + // lclr = pow( (clr + a) / (1+a), 2.4 ) + XMVECTOR largeC = XMVectorPow(XMVectorDivide(XMVectorAdd(srgb, g_XMsrgbA), g_XMsrgbA1), Exp); + + XMVECTOR lclr = XMVectorSelect(smallC, largeC, sel); + + XMMATRIX M(Scale0, Scale1, Scale2, g_XMZero); + XMVECTOR clr = XMVector3Transform(lclr, M); + + return XMVectorSelect(srgb, clr, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorRGBToSRGB(FXMVECTOR rgb) noexcept +{ + static const XMVECTORF32 Cutoff = { { { 0.0031308f, 0.0031308f, 0.0031308f, 1.f } } }; + static const XMVECTORF32 Linear = { { { 12.92f, 12.92f, 12.92f, 1.f } } }; + static const XMVECTORF32 Scale = { { { 1.055f, 1.055f, 1.055f, 1.f } } }; + static const XMVECTORF32 Bias = { { { 0.055f, 0.055f, 0.055f, 0.f } } }; + static const XMVECTORF32 InvGamma = { { { 1.0f / 2.4f, 1.0f / 2.4f, 1.0f / 2.4f, 1.f } } }; + + XMVECTOR V = XMVectorSaturate(rgb); + XMVECTOR V0 = XMVectorMultiply(V, Linear); + XMVECTOR V1 = XMVectorSubtract(XMVectorMultiply(Scale, XMVectorPow(V, InvGamma)), Bias); + XMVECTOR select = XMVectorLess(V, Cutoff); + V = XMVectorSelect(V1, V0, select); + return XMVectorSelect(rgb, V, g_XMSelect1110); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMColorSRGBToRGB(FXMVECTOR srgb) noexcept +{ + static const XMVECTORF32 Cutoff = { { { 0.04045f, 0.04045f, 0.04045f, 1.f } } }; + static const XMVECTORF32 ILinear = { { { 1.f / 12.92f, 1.f / 12.92f, 1.f / 12.92f, 1.f } } }; + static const XMVECTORF32 Scale = { { { 1.f / 1.055f, 1.f / 1.055f, 1.f / 1.055f, 1.f } } }; + static const XMVECTORF32 Bias = { { { 0.055f, 0.055f, 0.055f, 0.f } } }; + static const XMVECTORF32 Gamma = { { { 2.4f, 2.4f, 2.4f, 1.f } } }; + + XMVECTOR V = XMVectorSaturate(srgb); + XMVECTOR V0 = XMVectorMultiply(V, ILinear); + XMVECTOR V1 = XMVectorPow(XMVectorMultiply(XMVectorAdd(V, Bias), Scale), Gamma); + XMVECTOR select = XMVectorGreater(V, Cutoff); + V = XMVectorSelect(V0, V1, select); + return XMVectorSelect(srgb, V, g_XMSelect1110); +} + +/**************************************************************************** + * + * Miscellaneous + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline bool XMVerifyCPUSupport() noexcept +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + int CPUInfo[4] = { -1 }; +#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid) + __cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); +#else + __cpuid(CPUInfo, 0); +#endif + +#ifdef __AVX2__ + if (CPUInfo[0] < 7) + return false; +#else + if (CPUInfo[0] < 1) + return false; +#endif + +#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid) + __cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); +#else + __cpuid(CPUInfo, 1); +#endif + +#if defined(__AVX2__) || defined(_XM_AVX2_INTRINSICS_) + // The compiler can emit FMA3 instructions even without explicit intrinsics use + if ((CPUInfo[2] & 0x38081001) != 0x38081001) + return false; // No F16C/AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support +#elif defined(_XM_FMA3_INTRINSICS_) && defined(_XM_F16C_INTRINSICS_) + if ((CPUInfo[2] & 0x38081001) != 0x38081001) + return false; // No F16C/AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support +#elif defined(_XM_FMA3_INTRINSICS_) + if ((CPUInfo[2] & 0x18081001) != 0x18081001) + return false; // No AVX/OSXSAVE/SSE4.1/FMA3/SSE3 support +#elif defined(_XM_F16C_INTRINSICS_) + if ((CPUInfo[2] & 0x38080001) != 0x38080001) + return false; // No F16C/AVX/OSXSAVE/SSE4.1/SSE3 support +#elif defined(__AVX__) || defined(_XM_AVX_INTRINSICS_) + if ((CPUInfo[2] & 0x18080001) != 0x18080001) + return false; // No AVX/OSXSAVE/SSE4.1/SSE3 support +#elif defined(_XM_SSE4_INTRINSICS_) + if ((CPUInfo[2] & 0x80001) != 0x80001) + return false; // No SSE3/SSE4.1 support +#elif defined(_XM_SSE3_INTRINSICS_) + if (!(CPUInfo[2] & 0x1)) + return false; // No SSE3 support +#endif + + // The x64 processor model requires SSE2 support, but no harm in checking + if ((CPUInfo[3] & 0x6000000) != 0x6000000) + return false; // No SSE2/SSE support + +#if defined(__AVX2__) || defined(_XM_AVX2_INTRINSICS_) +#if defined(__clang__) || defined(__GNUC__) + __cpuid_count(7, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); +#else + __cpuidex(CPUInfo, 7, 0); +#endif + if (!(CPUInfo[1] & 0x20)) + return false; // No AVX2 support +#endif + + return true; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + // ARM-NEON support is required for the Windows on ARM platform + return true; +#else + // No intrinsics path always supported + return true; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMFresnelTerm +( + FXMVECTOR CosIncidentAngle, + FXMVECTOR RefractionIndex +) noexcept +{ + assert(!XMVector4IsInfinite(CosIncidentAngle)); + + // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where + // c = CosIncidentAngle + // g = sqrt(c^2 + RefractionIndex^2 - 1) + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR G = XMVectorMultiplyAdd(RefractionIndex, RefractionIndex, g_XMNegativeOne.v); + G = XMVectorMultiplyAdd(CosIncidentAngle, CosIncidentAngle, G); + G = XMVectorAbs(G); + G = XMVectorSqrt(G); + + XMVECTOR S = XMVectorAdd(G, CosIncidentAngle); + XMVECTOR D = XMVectorSubtract(G, CosIncidentAngle); + + XMVECTOR V0 = XMVectorMultiply(D, D); + XMVECTOR V1 = XMVectorMultiply(S, S); + V1 = XMVectorReciprocal(V1); + V0 = XMVectorMultiply(g_XMOneHalf.v, V0); + V0 = XMVectorMultiply(V0, V1); + + XMVECTOR V2 = XMVectorMultiplyAdd(CosIncidentAngle, S, g_XMNegativeOne.v); + XMVECTOR V3 = XMVectorMultiplyAdd(CosIncidentAngle, D, g_XMOne.v); + V2 = XMVectorMultiply(V2, V2); + V3 = XMVectorMultiply(V3, V3); + V3 = XMVectorReciprocal(V3); + V2 = XMVectorMultiplyAdd(V2, V3, g_XMOne.v); + + XMVECTOR Result = XMVectorMultiply(V0, V2); + + Result = XMVectorSaturate(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // G = sqrt(abs((RefractionIndex^2-1) + CosIncidentAngle^2)) + XMVECTOR G = _mm_mul_ps(RefractionIndex, RefractionIndex); + XMVECTOR vTemp = _mm_mul_ps(CosIncidentAngle, CosIncidentAngle); + G = _mm_sub_ps(G, g_XMOne); + vTemp = _mm_add_ps(vTemp, G); + // max((0-vTemp),vTemp) == abs(vTemp) + // The abs is needed to deal with refraction and cosine being zero + G = _mm_setzero_ps(); + G = _mm_sub_ps(G, vTemp); + G = _mm_max_ps(G, vTemp); + // Last operation, the sqrt() + G = _mm_sqrt_ps(G); + + // Calc G-C and G+C + XMVECTOR GAddC = _mm_add_ps(G, CosIncidentAngle); + XMVECTOR GSubC = _mm_sub_ps(G, CosIncidentAngle); + // Perform the term (0.5f *(g - c)^2) / (g + c)^2 + XMVECTOR vResult = _mm_mul_ps(GSubC, GSubC); + vTemp = _mm_mul_ps(GAddC, GAddC); + vResult = _mm_mul_ps(vResult, g_XMOneHalf); + vResult = _mm_div_ps(vResult, vTemp); + // Perform the term ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) + GAddC = _mm_mul_ps(GAddC, CosIncidentAngle); + GSubC = _mm_mul_ps(GSubC, CosIncidentAngle); + GAddC = _mm_sub_ps(GAddC, g_XMOne); + GSubC = _mm_add_ps(GSubC, g_XMOne); + GAddC = _mm_mul_ps(GAddC, GAddC); + GSubC = _mm_mul_ps(GSubC, GSubC); + GAddC = _mm_div_ps(GAddC, GSubC); + GAddC = _mm_add_ps(GAddC, g_XMOne); + // Multiply the two term parts + vResult = _mm_mul_ps(vResult, GAddC); + // Clamp to 0.0 - 1.0f + vResult = _mm_max_ps(vResult, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XMScalarNearEqual +( + float S1, + float S2, + float Epsilon +) noexcept +{ + float Delta = S1 - S2; + return (fabsf(Delta) <= Epsilon); +} + +//------------------------------------------------------------------------------ +// Modulo the range of the given angle such that -XM_PI <= Angle < XM_PI +inline float XMScalarModAngle(float Angle) noexcept +{ + // Note: The modulo is performed with unsigned math only to work + // around a precision error on numbers that are close to PI + + // Normalize the range from 0.0f to XM_2PI + Angle = Angle + XM_PI; + // Perform the modulo, unsigned + float fTemp = fabsf(Angle); + fTemp = fTemp - (XM_2PI * static_cast(static_cast(fTemp / XM_2PI))); + // Restore the number to the range of -XM_PI to XM_PI-epsilon + fTemp = fTemp - XM_PI; + // If the modulo'd value was negative, restore negation + if (Angle < 0.0f) + { + fTemp = -fTemp; + } + return fTemp; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarSin(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + if (y > XM_PIDIV2) + { + y = XM_PI - y; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + } + + // 11-degree minimax approximation + float y2 = y * y; + return (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarSinEst(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + if (y > XM_PIDIV2) + { + y = XM_PI - y; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + } + + // 7-degree minimax approximation + float y2 = y * y; + return (((-0.00018524670f * y2 + 0.0083139502f) * y2 - 0.16665852f) * y2 + 1.0f) * y; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarCos(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with cos(y) = sign*cos(x). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + // 10-degree minimax approximation + float y2 = y * y; + float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f; + return sign * p; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarCosEst(float Value) noexcept +{ + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with cos(y) = sign*cos(x). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + // 6-degree minimax approximation + float y2 = y * y; + float p = ((-0.0012712436f * y2 + 0.041493919f) * y2 - 0.49992746f) * y2 + 1.0f; + return sign * p; +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XMScalarSinCos +( + float* pSin, + float* pCos, + float Value +) noexcept +{ + assert(pSin); + assert(pCos); + + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + float y2 = y * y; + + // 11-degree minimax approximation + *pSin = (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y; + + // 10-degree minimax approximation + float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f; + *pCos = sign * p; +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XMScalarSinCosEst +( + float* pSin, + float* pCos, + float Value +) noexcept +{ + assert(pSin); + assert(pCos); + + // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. + float quotient = XM_1DIV2PI * Value; + if (Value >= 0.0f) + { + quotient = static_cast(static_cast(quotient + 0.5f)); + } + else + { + quotient = static_cast(static_cast(quotient - 0.5f)); + } + float y = Value - XM_2PI * quotient; + + // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). + float sign; + if (y > XM_PIDIV2) + { + y = XM_PI - y; + sign = -1.0f; + } + else if (y < -XM_PIDIV2) + { + y = -XM_PI - y; + sign = -1.0f; + } + else + { + sign = +1.0f; + } + + float y2 = y * y; + + // 7-degree minimax approximation + *pSin = (((-0.00018524670f * y2 + 0.0083139502f) * y2 - 0.16665852f) * y2 + 1.0f) * y; + + // 6-degree minimax approximation + float p = ((-0.0012712436f * y2 + 0.041493919f) * y2 - 0.49992746f) * y2 + 1.0f; + *pCos = sign * p; +} + +//------------------------------------------------------------------------------ + +inline float XMScalarASin(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 7-degree minimax approximation + float result = ((((((-0.0012624911f * x + 0.0066700901f) * x - 0.0170881256f) * x + 0.0308918810f) * x - 0.0501743046f) * x + 0.0889789874f) * x - 0.2145988016f) * x + 1.5707963050f; + result *= root; // acos(|x|) + + // acos(x) = pi - acos(-x) when x < 0, asin(x) = pi/2 - acos(x) + return (nonnegative ? XM_PIDIV2 - result : result - XM_PIDIV2); +} + +//------------------------------------------------------------------------------ + +inline float XMScalarASinEst(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 3-degree minimax approximation + float result = ((-0.0187293f * x + 0.0742610f) * x - 0.2121144f) * x + 1.5707288f; + result *= root; // acos(|x|) + + // acos(x) = pi - acos(-x) when x < 0, asin(x) = pi/2 - acos(x) + return (nonnegative ? XM_PIDIV2 - result : result - XM_PIDIV2); +} + +//------------------------------------------------------------------------------ + +inline float XMScalarACos(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 7-degree minimax approximation + float result = ((((((-0.0012624911f * x + 0.0066700901f) * x - 0.0170881256f) * x + 0.0308918810f) * x - 0.0501743046f) * x + 0.0889789874f) * x - 0.2145988016f) * x + 1.5707963050f; + result *= root; + + // acos(x) = pi - acos(-x) when x < 0 + return (nonnegative ? result : XM_PI - result); +} + +//------------------------------------------------------------------------------ + +inline float XMScalarACosEst(float Value) noexcept +{ + // Clamp input to [-1,1]. + bool nonnegative = (Value >= 0.0f); + float x = fabsf(Value); + float omx = 1.0f - x; + if (omx < 0.0f) + { + omx = 0.0f; + } + float root = sqrtf(omx); + + // 3-degree minimax approximation + float result = ((-0.0187293f * x + 0.0742610f) * x - 0.2121144f) * x + 1.5707288f; + result *= root; + + // acos(x) = pi - acos(-x) when x < 0 + return (nonnegative ? result : XM_PI - result); +} + diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathVector.inl b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathVector.inl similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathVector.inl rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathVector.inl index e1ee3d91f..c25b902ca 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXMathVector.inl +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMathVector.inl @@ -1,14869 +1,14869 @@ -//------------------------------------------------------------------------------------- -// DirectXMathVector.inl -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -#if defined(_XM_NO_INTRINSICS_) -#define XMISNAN(x) isnan(x) -#define XMISINF(x) isinf(x) -#endif - -#if defined(_XM_SSE_INTRINSICS_) - -#define XM3UNPACK3INTO4(l1, l2, l3) \ - XMVECTOR V3 = _mm_shuffle_ps(l2, l3, _MM_SHUFFLE(0, 0, 3, 2));\ - XMVECTOR V2 = _mm_shuffle_ps(l2, l1, _MM_SHUFFLE(3, 3, 1, 0));\ - V2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 0, 2));\ - XMVECTOR V4 = _mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(L3), 32 / 8)) - -#define XM3PACK4INTO3(v2x) \ - v2x = _mm_shuffle_ps(V2, V3, _MM_SHUFFLE(1, 0, 2, 1));\ - V2 = _mm_shuffle_ps(V2, V1, _MM_SHUFFLE(2, 2, 0, 0));\ - V1 = _mm_shuffle_ps(V1, V2, _MM_SHUFFLE(0, 2, 1, 0));\ - V3 = _mm_shuffle_ps(V3, V4, _MM_SHUFFLE(0, 0, 2, 2));\ - V3 = _mm_shuffle_ps(V3, V4, _MM_SHUFFLE(2, 1, 2, 0)) - -#endif - -/**************************************************************************** - * - * General Vector - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Assignment operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ -// Return a vector with all elements equaling zero -inline XMVECTOR XM_CALLCONV XMVectorZero() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_n_f32(0); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_setzero_ps(); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with four floating point values -inline XMVECTOR XM_CALLCONV XMVectorSet -( - float x, - float y, - float z, - float w -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { x, y, z, w } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t V0 = vcreate_f32( - static_cast(*reinterpret_cast(&x)) - | (static_cast(*reinterpret_cast(&y)) << 32)); - float32x2_t V1 = vcreate_f32( - static_cast(*reinterpret_cast(&z)) - | (static_cast(*reinterpret_cast(&w)) << 32)); - return vcombine_f32(V0, V1); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_set_ps(w, z, y, x); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with four integer values -inline XMVECTOR XM_CALLCONV XMVectorSetInt -( - uint32_t x, - uint32_t y, - uint32_t z, - uint32_t w -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult = { { { x, y, z, w } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t V0 = vcreate_u32(static_cast(x) | (static_cast(y) << 32)); - uint32x2_t V1 = vcreate_u32(static_cast(z) | (static_cast(w) << 32)); - return vreinterpretq_f32_u32(vcombine_u32(V0, V1)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_set_epi32(static_cast(w), static_cast(z), static_cast(y), static_cast(x)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with a replicated floating point value -inline XMVECTOR XM_CALLCONV XMVectorReplicate(float Value) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = Value; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_n_f32(Value); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_set_ps1(Value); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with a replicated floating point value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorReplicatePtr(const float* pValue) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float Value = pValue[0]; - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = Value; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vld1q_dup_f32(pValue); -#elif defined(_XM_AVX_INTRINSICS_) - return _mm_broadcast_ss(pValue); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_load_ps1(pValue); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with a replicated integer value -inline XMVECTOR XM_CALLCONV XMVectorReplicateInt(uint32_t Value) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = - vResult.u[1] = - vResult.u[2] = - vResult.u[3] = Value; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vdupq_n_u32(Value)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_set1_epi32(static_cast(Value)); - return _mm_castsi128_ps(vTemp); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with a replicated integer value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorReplicateIntPtr(const uint32_t* pValue) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t Value = pValue[0]; - XMVECTORU32 vResult; - vResult.u[0] = - vResult.u[1] = - vResult.u[2] = - vResult.u[3] = Value; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vld1q_dup_u32(pValue)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_load_ps1(reinterpret_cast(pValue)); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with all bits set (true mask) -inline XMVECTOR XM_CALLCONV XMVectorTrueInt() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult = { { { 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_s32(vdupq_n_s32(-1)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_set1_epi32(-1); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -// Initialize a vector with all bits clear (false mask) -inline XMVECTOR XM_CALLCONV XMVectorFalseInt() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; - return vResult; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vdupq_n_u32(0)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_setzero_ps(); -#endif -} - -//------------------------------------------------------------------------------ -// Replicate the x component of the vector -inline XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = V.vector4_f32[0]; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_lane_f32(vget_low_f32(V), 0); -#elif defined(_XM_AVX2_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) - return _mm_broadcastss_ps(V); -#elif defined(_XM_SSE_INTRINSICS_) - return XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); -#endif -} - -//------------------------------------------------------------------------------ -// Replicate the y component of the vector -inline XMVECTOR XM_CALLCONV XMVectorSplatY(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = V.vector4_f32[1]; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_lane_f32(vget_low_f32(V), 1); -#elif defined(_XM_SSE_INTRINSICS_) - return XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); -#endif -} - -//------------------------------------------------------------------------------ -// Replicate the z component of the vector -inline XMVECTOR XM_CALLCONV XMVectorSplatZ(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = V.vector4_f32[2]; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_lane_f32(vget_high_f32(V), 0); -#elif defined(_XM_SSE_INTRINSICS_) - return XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); -#endif -} - -//------------------------------------------------------------------------------ -// Replicate the w component of the vector -inline XMVECTOR XM_CALLCONV XMVectorSplatW(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = V.vector4_f32[3]; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_lane_f32(vget_high_f32(V), 1); -#elif defined(_XM_SSE_INTRINSICS_) - return XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); -#endif -} - -//------------------------------------------------------------------------------ -// Return a vector of 1.0f,1.0f,1.0f,1.0f -inline XMVECTOR XM_CALLCONV XMVectorSplatOne() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = 1.0f; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vdupq_n_f32(1.0f); -#elif defined(_XM_SSE_INTRINSICS_) - return g_XMOne; -#endif -} - -//------------------------------------------------------------------------------ -// Return a vector of INF,INF,INF,INF -inline XMVECTOR XM_CALLCONV XMVectorSplatInfinity() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = - vResult.u[1] = - vResult.u[2] = - vResult.u[3] = 0x7F800000; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vdupq_n_u32(0x7F800000)); -#elif defined(_XM_SSE_INTRINSICS_) - return g_XMInfinity; -#endif -} - -//------------------------------------------------------------------------------ -// Return a vector of Q_NAN,Q_NAN,Q_NAN,Q_NAN -inline XMVECTOR XM_CALLCONV XMVectorSplatQNaN() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = - vResult.u[1] = - vResult.u[2] = - vResult.u[3] = 0x7FC00000; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vdupq_n_u32(0x7FC00000)); -#elif defined(_XM_SSE_INTRINSICS_) - return g_XMQNaN; -#endif -} - -//------------------------------------------------------------------------------ -// Return a vector of 1.192092896e-7f,1.192092896e-7f,1.192092896e-7f,1.192092896e-7f -inline XMVECTOR XM_CALLCONV XMVectorSplatEpsilon() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = - vResult.u[1] = - vResult.u[2] = - vResult.u[3] = 0x34000000; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vdupq_n_u32(0x34000000)); -#elif defined(_XM_SSE_INTRINSICS_) - return g_XMEpsilon; -#endif -} - -//------------------------------------------------------------------------------ -// Return a vector of -0.0f (0x80000000),-0.0f,-0.0f,-0.0f -inline XMVECTOR XM_CALLCONV XMVectorSplatSignMask() noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 vResult; - vResult.u[0] = - vResult.u[1] = - vResult.u[2] = - vResult.u[3] = 0x80000000U; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vdupq_n_u32(0x80000000U)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_set1_epi32(static_cast(0x80000000)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -// Return a floating point value via an index. This is not a recommended -// function to use due to performance loss. -inline float XM_CALLCONV XMVectorGetByIndex(FXMVECTOR V, size_t i) noexcept -{ - assert(i < 4); - _Analysis_assume_(i < 4); -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_f32[i]; -#else - XMVECTORF32 U; - U.v = V; - return U.f[i]; -#endif -} - -//------------------------------------------------------------------------------ -// Return the X component in an FPU register. -inline float XM_CALLCONV XMVectorGetX(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_f32[0]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_f32(V, 0); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cvtss_f32(V); -#endif -} - -// Return the Y component in an FPU register. -inline float XM_CALLCONV XMVectorGetY(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_f32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_f32(V, 1); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - return _mm_cvtss_f32(vTemp); -#endif -} - -// Return the Z component in an FPU register. -inline float XM_CALLCONV XMVectorGetZ(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_f32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_f32(V, 2); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - return _mm_cvtss_f32(vTemp); -#endif -} - -// Return the W component in an FPU register. -inline float XM_CALLCONV XMVectorGetW(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_f32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_f32(V, 3); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - return _mm_cvtss_f32(vTemp); -#endif -} - -//------------------------------------------------------------------------------ - -// Store a component indexed by i into a 32 bit float location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetByIndexPtr(float* f, FXMVECTOR V, size_t i) noexcept -{ - assert(f != nullptr); - assert(i < 4); - _Analysis_assume_(i < 4); -#if defined(_XM_NO_INTRINSICS_) - *f = V.vector4_f32[i]; -#else - XMVECTORF32 U; - U.v = V; - *f = U.f[i]; -#endif -} - -//------------------------------------------------------------------------------ - -// Store the X component into a 32 bit float location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetXPtr(float* x, FXMVECTOR V) noexcept -{ - assert(x != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *x = V.vector4_f32[0]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_f32(x, V, 0); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_ss(x, V); -#endif -} - -// Store the Y component into a 32 bit float location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetYPtr(float* y, FXMVECTOR V) noexcept -{ - assert(y != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *y = V.vector4_f32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_f32(y, V, 1); -#elif defined(_XM_SSE4_INTRINSICS_) - * (reinterpret_cast(y)) = _mm_extract_ps(V, 1); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - _mm_store_ss(y, vResult); -#endif -} - -// Store the Z component into a 32 bit float location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetZPtr(float* z, FXMVECTOR V) noexcept -{ - assert(z != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *z = V.vector4_f32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_f32(z, V, 2); -#elif defined(_XM_SSE4_INTRINSICS_) - * (reinterpret_cast(z)) = _mm_extract_ps(V, 2); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(z, vResult); -#endif -} - -// Store the W component into a 32 bit float location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetWPtr(float* w, FXMVECTOR V) noexcept -{ - assert(w != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *w = V.vector4_f32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_f32(w, V, 3); -#elif defined(_XM_SSE4_INTRINSICS_) - * (reinterpret_cast(w)) = _mm_extract_ps(V, 3); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - _mm_store_ss(w, vResult); -#endif -} - -//------------------------------------------------------------------------------ - -// Return an integer value via an index. This is not a recommended -// function to use due to performance loss. -inline uint32_t XM_CALLCONV XMVectorGetIntByIndex(FXMVECTOR V, size_t i) noexcept -{ - assert(i < 4); - _Analysis_assume_(i < 4); -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_u32[i]; -#else - XMVECTORU32 U; - U.v = V; - return U.u[i]; -#endif -} - -//------------------------------------------------------------------------------ - -// Return the X component in an integer register. -inline uint32_t XM_CALLCONV XMVectorGetIntX(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_u32[0]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_u32(vreinterpretq_u32_f32(V), 0); -#elif defined(_XM_SSE_INTRINSICS_) - return static_cast(_mm_cvtsi128_si32(_mm_castps_si128(V))); -#endif -} - -// Return the Y component in an integer register. -inline uint32_t XM_CALLCONV XMVectorGetIntY(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_u32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_u32(vreinterpretq_u32_f32(V), 1); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i V1 = _mm_castps_si128(V); - return static_cast(_mm_extract_epi32(V1, 1)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(1, 1, 1, 1)); - return static_cast(_mm_cvtsi128_si32(vResulti)); -#endif -} - -// Return the Z component in an integer register. -inline uint32_t XM_CALLCONV XMVectorGetIntZ(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_u32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_u32(vreinterpretq_u32_f32(V), 2); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i V1 = _mm_castps_si128(V); - return static_cast(_mm_extract_epi32(V1, 2)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(2, 2, 2, 2)); - return static_cast(_mm_cvtsi128_si32(vResulti)); -#endif -} - -// Return the W component in an integer register. -inline uint32_t XM_CALLCONV XMVectorGetIntW(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return V.vector4_u32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vgetq_lane_u32(vreinterpretq_u32_f32(V), 3); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i V1 = _mm_castps_si128(V); - return static_cast(_mm_extract_epi32(V1, 3)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(3, 3, 3, 3)); - return static_cast(_mm_cvtsi128_si32(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ - -// Store a component indexed by i into a 32 bit integer location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetIntByIndexPtr(uint32_t* x, FXMVECTOR V, size_t i) noexcept -{ - assert(x != nullptr); - assert(i < 4); - _Analysis_assume_(i < 4); -#if defined(_XM_NO_INTRINSICS_) - *x = V.vector4_u32[i]; -#else - XMVECTORU32 U; - U.v = V; - *x = U.u[i]; -#endif -} - -//------------------------------------------------------------------------------ - -// Store the X component into a 32 bit integer location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetIntXPtr(uint32_t* x, FXMVECTOR V) noexcept -{ - assert(x != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *x = V.vector4_u32[0]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_u32(x, *reinterpret_cast(&V), 0); -#elif defined(_XM_SSE_INTRINSICS_) - _mm_store_ss(reinterpret_cast(x), V); -#endif -} - -// Store the Y component into a 32 bit integer location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetIntYPtr(uint32_t* y, FXMVECTOR V) noexcept -{ - assert(y != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *y = V.vector4_u32[1]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_u32(y, *reinterpret_cast(&V), 1); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i V1 = _mm_castps_si128(V); - *y = static_cast(_mm_extract_epi32(V1, 1)); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - _mm_store_ss(reinterpret_cast(y), vResult); -#endif -} - -// Store the Z component into a 32 bit integer locaCantion in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetIntZPtr(uint32_t* z, FXMVECTOR V) noexcept -{ - assert(z != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *z = V.vector4_u32[2]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_u32(z, *reinterpret_cast(&V), 2); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i V1 = _mm_castps_si128(V); - *z = static_cast(_mm_extract_epi32(V1, 2)); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - _mm_store_ss(reinterpret_cast(z), vResult); -#endif -} - -// Store the W component into a 32 bit integer location in memory. -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorGetIntWPtr(uint32_t* w, FXMVECTOR V) noexcept -{ - assert(w != nullptr); -#if defined(_XM_NO_INTRINSICS_) - *w = V.vector4_u32[3]; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - vst1q_lane_u32(w, *reinterpret_cast(&V), 3); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i V1 = _mm_castps_si128(V); - *w = static_cast(_mm_extract_epi32(V1, 3)); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - _mm_store_ss(reinterpret_cast(w), vResult); -#endif -} - -//------------------------------------------------------------------------------ - -// Set a single indexed floating point component -inline XMVECTOR XM_CALLCONV XMVectorSetByIndex(FXMVECTOR V, float f, size_t i) noexcept -{ - assert(i < 4); - _Analysis_assume_(i < 4); - XMVECTORF32 U; - U.v = V; - U.f[i] = f; - return U.v; -} - -//------------------------------------------------------------------------------ - -// Sets the X component of a vector to a passed floating point value -inline XMVECTOR XM_CALLCONV XMVectorSetX(FXMVECTOR V, float x) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - x, - V.vector4_f32[1], - V.vector4_f32[2], - V.vector4_f32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vsetq_lane_f32(x, V, 0); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_set_ss(x); - vResult = _mm_move_ss(V, vResult); - return vResult; -#endif -} - -// Sets the Y component of a vector to a passed floating point value -inline XMVECTOR XM_CALLCONV XMVectorSetY(FXMVECTOR V, float y) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - V.vector4_f32[0], - y, - V.vector4_f32[2], - V.vector4_f32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vsetq_lane_f32(y, V, 1); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vResult = _mm_set_ss(y); - vResult = _mm_insert_ps(V, vResult, 0x10); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Swap y and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); - // Convert input to vector - XMVECTOR vTemp = _mm_set_ss(y); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap y and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); - return vResult; -#endif -} -// Sets the Z component of a vector to a passed floating point value -inline XMVECTOR XM_CALLCONV XMVectorSetZ(FXMVECTOR V, float z) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - V.vector4_f32[0], - V.vector4_f32[1], - z, - V.vector4_f32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vsetq_lane_f32(z, V, 2); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vResult = _mm_set_ss(z); - vResult = _mm_insert_ps(V, vResult, 0x20); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Swap z and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); - // Convert input to vector - XMVECTOR vTemp = _mm_set_ss(z); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap z and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); - return vResult; -#endif -} - -// Sets the W component of a vector to a passed floating point value -inline XMVECTOR XM_CALLCONV XMVectorSetW(FXMVECTOR V, float w) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - V.vector4_f32[0], - V.vector4_f32[1], - V.vector4_f32[2], - w - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vsetq_lane_f32(w, V, 3); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vResult = _mm_set_ss(w); - vResult = _mm_insert_ps(V, vResult, 0x30); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Swap w and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); - // Convert input to vector - XMVECTOR vTemp = _mm_set_ss(w); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap w and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -// Sets a component of a vector to a floating point value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetByIndexPtr(FXMVECTOR V, const float* f, size_t i) noexcept -{ - assert(f != nullptr); - assert(i < 4); - _Analysis_assume_(i < 4); - XMVECTORF32 U; - U.v = V; - U.f[i] = *f; - return U.v; -} - -//------------------------------------------------------------------------------ - -// Sets the X component of a vector to a floating point value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetXPtr(FXMVECTOR V, const float* x) noexcept -{ - assert(x != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - *x, - V.vector4_f32[1], - V.vector4_f32[2], - V.vector4_f32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vld1q_lane_f32(x, V, 0); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_load_ss(x); - vResult = _mm_move_ss(V, vResult); - return vResult; -#endif -} - -// Sets the Y component of a vector to a floating point value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetYPtr(FXMVECTOR V, const float* y) noexcept -{ - assert(y != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - V.vector4_f32[0], - *y, - V.vector4_f32[2], - V.vector4_f32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vld1q_lane_f32(y, V, 1); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap y and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); - // Convert input to vector - XMVECTOR vTemp = _mm_load_ss(y); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap y and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); - return vResult; -#endif -} - -// Sets the Z component of a vector to a floating point value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetZPtr(FXMVECTOR V, const float* z) noexcept -{ - assert(z != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - V.vector4_f32[0], - V.vector4_f32[1], - *z, - V.vector4_f32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vld1q_lane_f32(z, V, 2); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap z and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); - // Convert input to vector - XMVECTOR vTemp = _mm_load_ss(z); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap z and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); - return vResult; -#endif -} - -// Sets the W component of a vector to a floating point value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetWPtr(FXMVECTOR V, const float* w) noexcept -{ - assert(w != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 U = { { { - V.vector4_f32[0], - V.vector4_f32[1], - V.vector4_f32[2], - *w - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vld1q_lane_f32(w, V, 3); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap w and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); - // Convert input to vector - XMVECTOR vTemp = _mm_load_ss(w); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap w and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -// Sets a component of a vector to an integer passed by value -inline XMVECTOR XM_CALLCONV XMVectorSetIntByIndex(FXMVECTOR V, uint32_t x, size_t i) noexcept -{ - assert(i < 4); - _Analysis_assume_(i < 4); - XMVECTORU32 tmp; - tmp.v = V; - tmp.u[i] = x; - return tmp; -} - -//------------------------------------------------------------------------------ - -// Sets the X component of a vector to an integer passed by value -inline XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - x, - V.vector4_u32[1], - V.vector4_u32[2], - V.vector4_u32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vsetq_lane_u32(x, vreinterpretq_u32_f32(V), 0)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cvtsi32_si128(static_cast(x)); - XMVECTOR vResult = _mm_move_ss(V, _mm_castsi128_ps(vTemp)); - return vResult; -#endif -} - -// Sets the Y component of a vector to an integer passed by value -inline XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - V.vector4_u32[0], - y, - V.vector4_u32[2], - V.vector4_u32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vsetq_lane_u32(y, vreinterpretq_u32_f32(V), 1)); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i vResult = _mm_castps_si128(V); - vResult = _mm_insert_epi32(vResult, static_cast(y), 1); - return _mm_castsi128_ps(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap y and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); - // Convert input to vector - __m128i vTemp = _mm_cvtsi32_si128(static_cast(y)); - // Replace the x component - vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); - // Swap y and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); - return vResult; -#endif -} - -// Sets the Z component of a vector to an integer passed by value -inline XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - V.vector4_u32[0], - V.vector4_u32[1], - z, - V.vector4_u32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vsetq_lane_u32(z, vreinterpretq_u32_f32(V), 2)); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i vResult = _mm_castps_si128(V); - vResult = _mm_insert_epi32(vResult, static_cast(z), 2); - return _mm_castsi128_ps(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap z and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); - // Convert input to vector - __m128i vTemp = _mm_cvtsi32_si128(static_cast(z)); - // Replace the x component - vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); - // Swap z and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); - return vResult; -#endif -} - -// Sets the W component of a vector to an integer passed by value -inline XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - V.vector4_u32[0], - V.vector4_u32[1], - V.vector4_u32[2], - w - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vsetq_lane_u32(w, vreinterpretq_u32_f32(V), 3)); -#elif defined(_XM_SSE4_INTRINSICS_) - __m128i vResult = _mm_castps_si128(V); - vResult = _mm_insert_epi32(vResult, static_cast(w), 3); - return _mm_castsi128_ps(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap w and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); - // Convert input to vector - __m128i vTemp = _mm_cvtsi32_si128(static_cast(w)); - // Replace the x component - vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); - // Swap w and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -// Sets a component of a vector to an integer value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetIntByIndexPtr(FXMVECTOR V, const uint32_t* x, size_t i) noexcept -{ - assert(x != nullptr); - assert(i < 4); - _Analysis_assume_(i < 4); - XMVECTORU32 tmp; - tmp.v = V; - tmp.u[i] = *x; - return tmp; -} - -//------------------------------------------------------------------------------ - -// Sets the X component of a vector to an integer value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetIntXPtr(FXMVECTOR V, const uint32_t* x) noexcept -{ - assert(x != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - *x, - V.vector4_u32[1], - V.vector4_u32[2], - V.vector4_u32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vld1q_lane_u32(x, *reinterpret_cast(&V), 0)); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(x)); - XMVECTOR vResult = _mm_move_ss(V, vTemp); - return vResult; -#endif -} - -// Sets the Y component of a vector to an integer value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetIntYPtr(FXMVECTOR V, const uint32_t* y) noexcept -{ - assert(y != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - V.vector4_u32[0], - *y, - V.vector4_u32[2], - V.vector4_u32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vld1q_lane_u32(y, *reinterpret_cast(&V), 1)); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap y and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); - // Convert input to vector - XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(y)); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap y and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); - return vResult; -#endif -} - -// Sets the Z component of a vector to an integer value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetIntZPtr(FXMVECTOR V, const uint32_t* z) noexcept -{ - assert(z != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - V.vector4_u32[0], - V.vector4_u32[1], - *z, - V.vector4_u32[3] - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vld1q_lane_u32(z, *reinterpret_cast(&V), 2)); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap z and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); - // Convert input to vector - XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(z)); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap z and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); - return vResult; -#endif -} - -// Sets the W component of a vector to an integer value passed by pointer -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorSetIntWPtr(FXMVECTOR V, const uint32_t* w) noexcept -{ - assert(w != nullptr); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORU32 U = { { { - V.vector4_u32[0], - V.vector4_u32[1], - V.vector4_u32[2], - *w - } } }; - return U.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vld1q_lane_u32(w, *reinterpret_cast(&V), 3)); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap w and x - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); - // Convert input to vector - XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(w)); - // Replace the x component - vResult = _mm_move_ss(vResult, vTemp); - // Swap w and x again - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSwizzle -( - FXMVECTOR V, - uint32_t E0, - uint32_t E1, - uint32_t E2, - uint32_t E3 -) noexcept -{ - assert((E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4)); - _Analysis_assume_((E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4)); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - V.vector4_f32[E0], - V.vector4_f32[E1], - V.vector4_f32[E2], - V.vector4_f32[E3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const uint32_t ControlElement[4] = - { - 0x03020100, // XM_SWIZZLE_X - 0x07060504, // XM_SWIZZLE_Y - 0x0B0A0908, // XM_SWIZZLE_Z - 0x0F0E0D0C, // XM_SWIZZLE_W - }; - - uint8x8x2_t tbl; - tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V)); - tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V)); - - uint32x2_t idx = vcreate_u32(static_cast(ControlElement[E0]) | (static_cast(ControlElement[E1]) << 32)); - const uint8x8_t rL = vtbl2_u8(tbl, vreinterpret_u8_u32(idx)); - - idx = vcreate_u32(static_cast(ControlElement[E2]) | (static_cast(ControlElement[E3]) << 32)); - const uint8x8_t rH = vtbl2_u8(tbl, vreinterpret_u8_u32(idx)); - - return vcombine_f32(vreinterpret_f32_u8(rL), vreinterpret_f32_u8(rH)); -#elif defined(_XM_AVX_INTRINSICS_) - unsigned int elem[4] = { E0, E1, E2, E3 }; - __m128i vControl = _mm_loadu_si128(reinterpret_cast(&elem[0])); - return _mm_permutevar_ps(V, vControl); -#else - auto aPtr = reinterpret_cast(&V); - - XMVECTOR Result; - auto pWork = reinterpret_cast(&Result); - - pWork[0] = aPtr[E0]; - pWork[1] = aPtr[E1]; - pWork[2] = aPtr[E2]; - pWork[3] = aPtr[E3]; - - return Result; -#endif -} - -//------------------------------------------------------------------------------ -inline XMVECTOR XM_CALLCONV XMVectorPermute -( - FXMVECTOR V1, - FXMVECTOR V2, - uint32_t PermuteX, - uint32_t PermuteY, - uint32_t PermuteZ, - uint32_t PermuteW -) noexcept -{ - assert(PermuteX <= 7 && PermuteY <= 7 && PermuteZ <= 7 && PermuteW <= 7); - _Analysis_assume_(PermuteX <= 7 && PermuteY <= 7 && PermuteZ <= 7 && PermuteW <= 7); - -#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - static const uint32_t ControlElement[8] = - { - 0x03020100, // XM_PERMUTE_0X - 0x07060504, // XM_PERMUTE_0Y - 0x0B0A0908, // XM_PERMUTE_0Z - 0x0F0E0D0C, // XM_PERMUTE_0W - 0x13121110, // XM_PERMUTE_1X - 0x17161514, // XM_PERMUTE_1Y - 0x1B1A1918, // XM_PERMUTE_1Z - 0x1F1E1D1C, // XM_PERMUTE_1W - }; - - uint8x8x4_t tbl; - tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V1)); - tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V1)); - tbl.val[2] = vreinterpret_u8_f32(vget_low_f32(V2)); - tbl.val[3] = vreinterpret_u8_f32(vget_high_f32(V2)); - - uint32x2_t idx = vcreate_u32(static_cast(ControlElement[PermuteX]) | (static_cast(ControlElement[PermuteY]) << 32)); - const uint8x8_t rL = vtbl4_u8(tbl, vreinterpret_u8_u32(idx)); - - idx = vcreate_u32(static_cast(ControlElement[PermuteZ]) | (static_cast(ControlElement[PermuteW]) << 32)); - const uint8x8_t rH = vtbl4_u8(tbl, vreinterpret_u8_u32(idx)); - - return vcombine_f32(vreinterpret_f32_u8(rL), vreinterpret_f32_u8(rH)); -#elif defined(_XM_AVX_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - static const XMVECTORU32 three = { { { 3, 3, 3, 3 } } }; - - XM_ALIGNED_DATA(16) unsigned int elem[4] = { PermuteX, PermuteY, PermuteZ, PermuteW }; - __m128i vControl = _mm_load_si128(reinterpret_cast(&elem[0])); - - __m128i vSelect = _mm_cmpgt_epi32(vControl, three); - vControl = _mm_castps_si128(_mm_and_ps(_mm_castsi128_ps(vControl), three)); - - __m128 shuffled1 = _mm_permutevar_ps(V1, vControl); - __m128 shuffled2 = _mm_permutevar_ps(V2, vControl); - - __m128 masked1 = _mm_andnot_ps(_mm_castsi128_ps(vSelect), shuffled1); - __m128 masked2 = _mm_and_ps(_mm_castsi128_ps(vSelect), shuffled2); - - return _mm_or_ps(masked1, masked2); -#else - - const uint32_t* aPtr[2]; - aPtr[0] = reinterpret_cast(&V1); - aPtr[1] = reinterpret_cast(&V2); - - XMVECTOR Result; - auto pWork = reinterpret_cast(&Result); - - const uint32_t i0 = PermuteX & 3; - const uint32_t vi0 = PermuteX >> 2; - pWork[0] = aPtr[vi0][i0]; - - const uint32_t i1 = PermuteY & 3; - const uint32_t vi1 = PermuteY >> 2; - pWork[1] = aPtr[vi1][i1]; - - const uint32_t i2 = PermuteZ & 3; - const uint32_t vi2 = PermuteZ >> 2; - pWork[2] = aPtr[vi2][i2]; - - const uint32_t i3 = PermuteW & 3; - const uint32_t vi3 = PermuteW >> 2; - pWork[3] = aPtr[vi3][i3]; - - return Result; -#endif -} - -//------------------------------------------------------------------------------ -// Define a control vector to be used in XMVectorSelect -// operations. The four integers specified in XMVectorSelectControl -// serve as indices to select between components in two vectors. -// The first index controls selection for the first component of -// the vectors involved in a select operation, the second index -// controls selection for the second component etc. A value of -// zero for an index causes the corresponding component from the first -// vector to be selected whereas a one causes the component from the -// second vector to be selected instead. - -inline XMVECTOR XM_CALLCONV XMVectorSelectControl -( - uint32_t VectorIndex0, - uint32_t VectorIndex1, - uint32_t VectorIndex2, - uint32_t VectorIndex3 -) noexcept -{ -#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - // x=Index0,y=Index1,z=Index2,w=Index3 - __m128i vTemp = _mm_set_epi32(static_cast(VectorIndex3), static_cast(VectorIndex2), static_cast(VectorIndex1), static_cast(VectorIndex0)); - // Any non-zero entries become 0xFFFFFFFF else 0 - vTemp = _mm_cmpgt_epi32(vTemp, g_XMZero); - return _mm_castsi128_ps(vTemp); -#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - int32x2_t V0 = vcreate_s32(static_cast(VectorIndex0) | (static_cast(VectorIndex1) << 32)); - int32x2_t V1 = vcreate_s32(static_cast(VectorIndex2) | (static_cast(VectorIndex3) << 32)); - int32x4_t vTemp = vcombine_s32(V0, V1); - // Any non-zero entries become 0xFFFFFFFF else 0 - return vreinterpretq_f32_u32(vcgtq_s32(vTemp, g_XMZero)); -#else - XMVECTOR ControlVector; - const uint32_t ControlElement[] = - { - XM_SELECT_0, - XM_SELECT_1 - }; - - assert(VectorIndex0 < 2); - assert(VectorIndex1 < 2); - assert(VectorIndex2 < 2); - assert(VectorIndex3 < 2); - _Analysis_assume_(VectorIndex0 < 2); - _Analysis_assume_(VectorIndex1 < 2); - _Analysis_assume_(VectorIndex2 < 2); - _Analysis_assume_(VectorIndex3 < 2); - - ControlVector.vector4_u32[0] = ControlElement[VectorIndex0]; - ControlVector.vector4_u32[1] = ControlElement[VectorIndex1]; - ControlVector.vector4_u32[2] = ControlElement[VectorIndex2]; - ControlVector.vector4_u32[3] = ControlElement[VectorIndex3]; - - return ControlVector; - -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSelect -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR Control -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - (V1.vector4_u32[0] & ~Control.vector4_u32[0]) | (V2.vector4_u32[0] & Control.vector4_u32[0]), - (V1.vector4_u32[1] & ~Control.vector4_u32[1]) | (V2.vector4_u32[1] & Control.vector4_u32[1]), - (V1.vector4_u32[2] & ~Control.vector4_u32[2]) | (V2.vector4_u32[2] & Control.vector4_u32[2]), - (V1.vector4_u32[3] & ~Control.vector4_u32[3]) | (V2.vector4_u32[3] & Control.vector4_u32[3]), - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vbslq_f32(vreinterpretq_u32_f32(Control), V2, V1); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp1 = _mm_andnot_ps(Control, V1); - XMVECTOR vTemp2 = _mm_and_ps(V2, Control); - return _mm_or_ps(vTemp1, vTemp2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMergeXY -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - V1.vector4_u32[0], - V2.vector4_u32[0], - V1.vector4_u32[1], - V2.vector4_u32[1], - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vzipq_f32(V1, V2).val[0]; -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_unpacklo_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMergeZW -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - V1.vector4_u32[2], - V2.vector4_u32[2], - V1.vector4_u32[3], - V2.vector4_u32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vzipq_f32(V1, V2).val[1]; -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_unpackhi_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, uint32_t Elements) noexcept -{ - assert(Elements < 4); - _Analysis_assume_(Elements < 4); - return XMVectorPermute(V1, V2, Elements, ((Elements)+1), ((Elements)+2), ((Elements)+3)); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V, uint32_t Elements) noexcept -{ - assert(Elements < 4); - _Analysis_assume_(Elements < 4); - return XMVectorSwizzle(V, Elements & 3, (Elements + 1) & 3, (Elements + 2) & 3, (Elements + 3) & 3); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, uint32_t Elements) noexcept -{ - assert(Elements < 4); - _Analysis_assume_(Elements < 4); - return XMVectorSwizzle(V, (4 - (Elements)) & 3, (5 - (Elements)) & 3, (6 - (Elements)) & 3, (7 - (Elements)) & 3); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorInsert( - FXMVECTOR VD, FXMVECTOR VS, - uint32_t VSLeftRotateElements, - uint32_t Select0, uint32_t Select1, uint32_t Select2, uint32_t Select3) noexcept -{ - XMVECTOR Control = XMVectorSelectControl(Select0 & 1, Select1 & 1, Select2 & 1, Select3 & 1); - return XMVectorSelect(VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control); -} - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFF : 0, - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vceqq_f32(V1, V2)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cmpeq_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorEqualR -( - uint32_t* pCR, - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - assert(pCR != nullptr); -#if defined(_XM_NO_INTRINSICS_) - uint32_t ux = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; - uint32_t uy = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; - uint32_t uz = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; - uint32_t uw = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; - uint32_t CR = 0; - if (ux & uy & uz & uw) - { - // All elements are greater - CR = XM_CRMASK_CR6TRUE; - } - else if (!(ux | uy | uz | uw)) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - - XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; - return Control; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vreinterpret_u8_u32(vget_low_u32(vResult)), vreinterpret_u8_u32(vget_high_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - // All elements are equal - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - // All elements are not equal - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vreinterpretq_f32_u32(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - uint32_t CR = 0; - int iTest = _mm_movemask_ps(vTemp); - if (iTest == 0xf) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -// Treat the components of the vectors as unsigned integers and -// compare individual bits between the two. This is useful for -// comparing control vectors and result vectors returned from -// other comparison operations. - -inline XMVECTOR XM_CALLCONV XMVectorEqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_u32[0] == V2.vector4_u32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_u32[1] == V2.vector4_u32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_u32[2] == V2.vector4_u32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_u32[3] == V2.vector4_u32[3]) ? 0xFFFFFFFF : 0, - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vceqq_s32(vreinterpretq_s32_f32(V1), vreinterpretq_s32_f32(V2))); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorEqualIntR -( - uint32_t* pCR, - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - assert(pCR != nullptr); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Control = XMVectorEqualInt(V1, V2); - - *pCR = 0; - if (XMVector4EqualInt(Control, XMVectorTrueInt())) - { - // All elements are equal - *pCR |= XM_CRMASK_CR6TRUE; - } - else if (XMVector4EqualInt(Control, XMVectorFalseInt())) - { - // All elements are not equal - *pCR |= XM_CRMASK_CR6FALSE; - } - return Control; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - // All elements are equal - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - // All elements are not equal - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vreinterpretq_f32_u32(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - int iTemp = _mm_movemask_ps(_mm_castsi128_ps(V)); - uint32_t CR = 0; - if (iTemp == 0x0F) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTemp) - { - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorNearEqual -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR Epsilon -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - float fDeltax = V1.vector4_f32[0] - V2.vector4_f32[0]; - float fDeltay = V1.vector4_f32[1] - V2.vector4_f32[1]; - float fDeltaz = V1.vector4_f32[2] - V2.vector4_f32[2]; - float fDeltaw = V1.vector4_f32[3] - V2.vector4_f32[3]; - - fDeltax = fabsf(fDeltax); - fDeltay = fabsf(fDeltay); - fDeltaz = fabsf(fDeltaz); - fDeltaw = fabsf(fDeltaw); - - XMVECTORU32 Control = { { { - (fDeltax <= Epsilon.vector4_f32[0]) ? 0xFFFFFFFFU : 0, - (fDeltay <= Epsilon.vector4_f32[1]) ? 0xFFFFFFFFU : 0, - (fDeltaz <= Epsilon.vector4_f32[2]) ? 0xFFFFFFFFU : 0, - (fDeltaw <= Epsilon.vector4_f32[3]) ? 0xFFFFFFFFU : 0, - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vDelta = vsubq_f32(V1, V2); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - return vacleq_f32(vDelta, Epsilon); -#else - return vreinterpretq_f32_u32(vcleq_f32(vabsq_f32(vDelta), Epsilon)); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - // Get the difference - XMVECTOR vDelta = _mm_sub_ps(V1, V2); - // Get the absolute value of the difference - XMVECTOR vTemp = _mm_setzero_ps(); - vTemp = _mm_sub_ps(vTemp, vDelta); - vTemp = _mm_max_ps(vTemp, vDelta); - vTemp = _mm_cmple_ps(vTemp, Epsilon); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorNotEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_f32[0] != V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[1] != V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[2] != V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[3] != V2.vector4_f32[3]) ? 0xFFFFFFFF : 0, - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vmvnq_u32(vceqq_f32(V1, V2))); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cmpneq_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorNotEqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_u32[0] != V2.vector4_u32[0]) ? 0xFFFFFFFFU : 0, - (V1.vector4_u32[1] != V2.vector4_u32[1]) ? 0xFFFFFFFFU : 0, - (V1.vector4_u32[2] != V2.vector4_u32[2]) ? 0xFFFFFFFFU : 0, - (V1.vector4_u32[3] != V2.vector4_u32[3]) ? 0xFFFFFFFFU : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vmvnq_u32( - vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)))); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return _mm_xor_ps(_mm_castsi128_ps(V), g_XMNegOneMask); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorGreater -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vcgtq_f32(V1, V2)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cmpgt_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorGreaterR -( - uint32_t* pCR, - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - assert(pCR != nullptr); -#if defined(_XM_NO_INTRINSICS_) - - uint32_t ux = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; - uint32_t uy = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; - uint32_t uz = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; - uint32_t uw = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; - uint32_t CR = 0; - if (ux & uy & uz & uw) - { - // All elements are greater - CR = XM_CRMASK_CR6TRUE; - } - else if (!(ux | uy | uz | uw)) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - - XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgtq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - // All elements are greater - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vreinterpretq_f32_u32(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - uint32_t CR = 0; - int iTest = _mm_movemask_ps(vTemp); - if (iTest == 0xf) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorGreaterOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vcgeq_f32(V1, V2)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cmpge_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorGreaterOrEqualR -( - uint32_t* pCR, - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - assert(pCR != nullptr); -#if defined(_XM_NO_INTRINSICS_) - - uint32_t ux = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; - uint32_t uy = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; - uint32_t uz = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; - uint32_t uw = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; - uint32_t CR = 0; - if (ux & uy & uz & uw) - { - // All elements are greater - CR = XM_CRMASK_CR6TRUE; - } - else if (!(ux | uy | uz | uw)) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - - XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgeq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - // All elements are greater or equal - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - // All elements are not greater or equal - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vreinterpretq_f32_u32(vResult); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - uint32_t CR = 0; - int iTest = _mm_movemask_ps(vTemp); - if (iTest == 0xf) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - // All elements are not greater - CR = XM_CRMASK_CR6FALSE; - } - *pCR = CR; - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLess -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_f32[0] < V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[1] < V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[2] < V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[3] < V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vcltq_f32(V1, V2)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cmplt_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLessOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V1.vector4_f32[0] <= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[1] <= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[2] <= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V1.vector4_f32[3] <= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vcleq_f32(V1, V2)); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_cmple_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorInBounds -( - FXMVECTOR V, - FXMVECTOR Bounds -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFF : 0, - (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFF : 0, - (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFF : 0, - (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFF : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Test if less than or equal - uint32x4_t vTemp1 = vcleq_f32(V, Bounds); - // Negate the bounds - uint32x4_t vTemp2 = vreinterpretq_u32_f32(vnegq_f32(Bounds)); - // Test if greater or equal (Reversed) - vTemp2 = vcleq_f32(vreinterpretq_f32_u32(vTemp2), V); - // Blend answers - vTemp1 = vandq_u32(vTemp1, vTemp2); - return vreinterpretq_f32_u32(vTemp1); -#elif defined(_XM_SSE_INTRINSICS_) - // Test if less than or equal - XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); - // Negate the bounds - XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); - // Test if greater or equal (Reversed) - vTemp2 = _mm_cmple_ps(vTemp2, V); - // Blend answers - vTemp1 = _mm_and_ps(vTemp1, vTemp2); - return vTemp1; -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMVectorInBoundsR -( - uint32_t* pCR, - FXMVECTOR V, - FXMVECTOR Bounds -) noexcept -{ - assert(pCR != nullptr); -#if defined(_XM_NO_INTRINSICS_) - - uint32_t ux = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFFU : 0; - uint32_t uy = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFFU : 0; - uint32_t uz = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFFU : 0; - uint32_t uw = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFFU : 0; - - uint32_t CR = 0; - if (ux & uy & uz & uw) - { - // All elements are in bounds - CR = XM_CRMASK_CR6BOUNDS; - } - *pCR = CR; - - XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Test if less than or equal - uint32x4_t vTemp1 = vcleq_f32(V, Bounds); - // Negate the bounds - uint32x4_t vTemp2 = vreinterpretq_u32_f32(vnegq_f32(Bounds)); - // Test if greater or equal (Reversed) - vTemp2 = vcleq_f32(vreinterpretq_f32_u32(vTemp2), V); - // Blend answers - vTemp1 = vandq_u32(vTemp1, vTemp2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTemp1)), vget_high_u8(vreinterpretq_u8_u32(vTemp1))); - uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1); - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - // All elements are in bounds - CR = XM_CRMASK_CR6BOUNDS; - } - *pCR = CR; - return vreinterpretq_f32_u32(vTemp1); -#elif defined(_XM_SSE_INTRINSICS_) - // Test if less than or equal - XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); - // Negate the bounds - XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); - // Test if greater or equal (Reversed) - vTemp2 = _mm_cmple_ps(vTemp2, V); - // Blend answers - vTemp1 = _mm_and_ps(vTemp1, vTemp2); - - uint32_t CR = 0; - if (_mm_movemask_ps(vTemp1) == 0xf) - { - // All elements are in bounds - CR = XM_CRMASK_CR6BOUNDS; - } - *pCR = CR; - return vTemp1; -#endif -} - -//------------------------------------------------------------------------------ - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -inline XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - XMISNAN(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0, - XMISNAN(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0, - XMISNAN(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0, - XMISNAN(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - XMVECTORU32 vResult = { { { - isnan(vgetq_lane_f32(V, 0)) ? 0xFFFFFFFFU : 0, - isnan(vgetq_lane_f32(V, 1)) ? 0xFFFFFFFFU : 0, - isnan(vgetq_lane_f32(V, 2)) ? 0xFFFFFFFFU : 0, - isnan(vgetq_lane_f32(V, 3)) ? 0xFFFFFFFFU : 0 } } }; - return vResult.v; -#else -// Test against itself. NaN is always not equal - uint32x4_t vTempNan = vceqq_f32(V, V); - // Flip results - return vreinterpretq_f32_u32(vmvnq_u32(vTempNan)); -#endif -#elif defined(_XM_SSE_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - XM_ALIGNED_DATA(16) float tmp[4]; - _mm_store_ps(tmp, V); - XMVECTORU32 vResult = { { { - isnan(tmp[0]) ? 0xFFFFFFFFU : 0, - isnan(tmp[1]) ? 0xFFFFFFFFU : 0, - isnan(tmp[2]) ? 0xFFFFFFFFU : 0, - isnan(tmp[3]) ? 0xFFFFFFFFU : 0 } } }; - return vResult.v; -#else -// Test against itself. NaN is always not equal - return _mm_cmpneq_ps(V, V); -#endif -#endif -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(pop) -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorIsInfinite(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Control = { { { - XMISINF(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0, - XMISINF(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0, - XMISINF(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0, - XMISINF(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0 - } } }; - return Control.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Mask off the sign bit - uint32x4_t vTemp = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - // Compare to infinity - vTemp = vceqq_f32(vreinterpretq_f32_u32(vTemp), g_XMInfinity); - // If any are infinity, the signs are true. - return vreinterpretq_f32_u32(vTemp); -#elif defined(_XM_SSE_INTRINSICS_) - // Mask off the sign bit - __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); - // Compare to infinity - vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); - // If any are infinity, the signs are true. - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -// Rounding and clamping operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMin -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - (V1.vector4_f32[0] < V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0], - (V1.vector4_f32[1] < V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1], - (V1.vector4_f32[2] < V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2], - (V1.vector4_f32[3] < V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vminq_f32(V1, V2); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_min_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMax -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - (V1.vector4_f32[0] > V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0], - (V1.vector4_f32[1] > V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1], - (V1.vector4_f32[2] > V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2], - (V1.vector4_f32[3] > V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vmaxq_f32(V1, V2); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_max_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -namespace MathInternal -{ - // Round to nearest (even) a.k.a. banker's rounding - inline float round_to_nearest(float x) noexcept - { - float i = floorf(x); - x -= i; - if (x < 0.5f) - return i; - if (x > 0.5f) - return i + 1.f; - - float int_part; - (void)modff(i / 2.f, &int_part); - if ((2.f * int_part) == i) - { - return i; - } - - return i + 1.f; - } -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - MathInternal::round_to_nearest(V.vector4_f32[0]), - MathInternal::round_to_nearest(V.vector4_f32[1]), - MathInternal::round_to_nearest(V.vector4_f32[2]), - MathInternal::round_to_nearest(V.vector4_f32[3]) - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vrndnq_f32(V); -#else - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(V), g_XMNegativeZero); - float32x4_t sMagic = vreinterpretq_f32_u32(vorrq_u32(g_XMNoFraction, sign)); - float32x4_t R1 = vaddq_f32(V, sMagic); - R1 = vsubq_f32(R1, sMagic); - float32x4_t R2 = vabsq_f32(V); - uint32x4_t mask = vcleq_f32(R2, g_XMNoFraction); - return vbslq_f32(mask, R1, V); -#endif -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_round_ps(V, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); -#elif defined(_XM_SSE_INTRINSICS_) - __m128 sign = _mm_and_ps(V, g_XMNegativeZero); - __m128 sMagic = _mm_or_ps(g_XMNoFraction, sign); - __m128 R1 = _mm_add_ps(V, sMagic); - R1 = _mm_sub_ps(R1, sMagic); - __m128 R2 = _mm_and_ps(V, g_XMAbsMask); - __m128 mask = _mm_cmple_ps(R2, g_XMNoFraction); - R2 = _mm_andnot_ps(mask, V); - R1 = _mm_and_ps(R1, mask); - XMVECTOR vResult = _mm_xor_ps(R1, R2); - return vResult; -#endif -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(pop) -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorTruncate(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR Result; - uint32_t i; - - // Avoid C4701 - Result.vector4_f32[0] = 0.0f; - - for (i = 0; i < 4; i++) - { - if (XMISNAN(V.vector4_f32[i])) - { - Result.vector4_u32[i] = 0x7FC00000; - } - else if (fabsf(V.vector4_f32[i]) < 8388608.0f) - { - Result.vector4_f32[i] = static_cast(static_cast(V.vector4_f32[i])); - } - else - { - Result.vector4_f32[i] = V.vector4_f32[i]; - } - } - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vrndq_f32(V); -#else - float32x4_t vTest = vabsq_f32(V); - vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); - - int32x4_t vInt = vcvtq_s32_f32(V); - float32x4_t vResult = vcvtq_f32_s32(vInt); - - // All numbers less than 8388608 will use the round to int - // All others, use the ORIGINAL value - return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); -#endif -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_round_ps(V, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); -#elif defined(_XM_SSE_INTRINSICS_) - // To handle NAN, INF and numbers greater than 8388608, use masking - // Get the abs value - __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF - vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); - // Convert to int and back to float for rounding with truncation - __m128i vInt = _mm_cvttps_epi32(V); - // Convert back to floats - XMVECTOR vResult = _mm_cvtepi32_ps(vInt); - // All numbers less than 8388608 will use the round to int - vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); - // All others, use the ORIGINAL value - vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); - vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorFloor(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - floorf(V.vector4_f32[0]), - floorf(V.vector4_f32[1]), - floorf(V.vector4_f32[2]), - floorf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vrndmq_f32(V); -#else - float32x4_t vTest = vabsq_f32(V); - vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); - // Truncate - int32x4_t vInt = vcvtq_s32_f32(V); - float32x4_t vResult = vcvtq_f32_s32(vInt); - uint32x4_t vLargerMask = vcgtq_f32(vResult, V); - // 0 -> 0, 0xffffffff -> -1.0f - float32x4_t vLarger = vcvtq_f32_s32(vreinterpretq_s32_u32(vLargerMask)); - vResult = vaddq_f32(vResult, vLarger); - // All numbers less than 8388608 will use the round to int - // All others, use the ORIGINAL value - return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); -#endif -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_floor_ps(V); -#elif defined(_XM_SSE_INTRINSICS_) - // To handle NAN, INF and numbers greater than 8388608, use masking - __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); - // Truncate - __m128i vInt = _mm_cvttps_epi32(V); - XMVECTOR vResult = _mm_cvtepi32_ps(vInt); - __m128 vLarger = _mm_cmpgt_ps(vResult, V); - // 0 -> 0, 0xffffffff -> -1.0f - vLarger = _mm_cvtepi32_ps(_mm_castps_si128(vLarger)); - vResult = _mm_add_ps(vResult, vLarger); - // All numbers less than 8388608 will use the round to int - vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); - // All others, use the ORIGINAL value - vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); - vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorCeiling(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - ceilf(V.vector4_f32[0]), - ceilf(V.vector4_f32[1]), - ceilf(V.vector4_f32[2]), - ceilf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vrndpq_f32(V); -#else - float32x4_t vTest = vabsq_f32(V); - vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); - // Truncate - int32x4_t vInt = vcvtq_s32_f32(V); - float32x4_t vResult = vcvtq_f32_s32(vInt); - uint32x4_t vSmallerMask = vcltq_f32(vResult, V); - // 0 -> 0, 0xffffffff -> -1.0f - float32x4_t vSmaller = vcvtq_f32_s32(vreinterpretq_s32_u32(vSmallerMask)); - vResult = vsubq_f32(vResult, vSmaller); - // All numbers less than 8388608 will use the round to int - // All others, use the ORIGINAL value - return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); -#endif -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_ceil_ps(V); -#elif defined(_XM_SSE_INTRINSICS_) - // To handle NAN, INF and numbers greater than 8388608, use masking - __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); - // Truncate - __m128i vInt = _mm_cvttps_epi32(V); - XMVECTOR vResult = _mm_cvtepi32_ps(vInt); - __m128 vSmaller = _mm_cmplt_ps(vResult, V); - // 0 -> 0, 0xffffffff -> -1.0f - vSmaller = _mm_cvtepi32_ps(_mm_castps_si128(vSmaller)); - vResult = _mm_sub_ps(vResult, vSmaller); - // All numbers less than 8388608 will use the round to int - vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); - // All others, use the ORIGINAL value - vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); - vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorClamp -( - FXMVECTOR V, - FXMVECTOR Min, - FXMVECTOR Max -) noexcept -{ - assert(XMVector4LessOrEqual(Min, Max)); - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVectorMax(Min, V); - Result = XMVectorMin(Max, Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmaxq_f32(Min, V); - vResult = vminq_f32(Max, vResult); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult; - vResult = _mm_max_ps(Min, V); - vResult = _mm_min_ps(Max, vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSaturate(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - const XMVECTOR Zero = XMVectorZero(); - - return XMVectorClamp(V, Zero, g_XMOne.v); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Set <0 to 0 - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); - // Set>1 to 1 - return vminq_f32(vResult, vdupq_n_f32(1.0f)); -#elif defined(_XM_SSE_INTRINSICS_) - // Set <0 to 0 - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - // Set>1 to 1 - return _mm_min_ps(vResult, g_XMOne); -#endif -} - -//------------------------------------------------------------------------------ -// Bitwise logical operations -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorAndInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - V1.vector4_u32[0] & V2.vector4_u32[0], - V1.vector4_u32[1] & V2.vector4_u32[1], - V1.vector4_u32[2] & V2.vector4_u32[2], - V1.vector4_u32[3] & V2.vector4_u32[3] - } } }; - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_and_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorAndCInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - V1.vector4_u32[0] & ~V2.vector4_u32[0], - V1.vector4_u32[1] & ~V2.vector4_u32[1], - V1.vector4_u32[2] & ~V2.vector4_u32[2], - V1.vector4_u32[3] & ~V2.vector4_u32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_andnot_si128(_mm_castps_si128(V2), _mm_castps_si128(V1)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorOrInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - V1.vector4_u32[0] | V2.vector4_u32[0], - V1.vector4_u32[1] | V2.vector4_u32[1], - V1.vector4_u32[2] | V2.vector4_u32[2], - V1.vector4_u32[3] | V2.vector4_u32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_or_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorNorInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - ~(V1.vector4_u32[0] | V2.vector4_u32[0]), - ~(V1.vector4_u32[1] | V2.vector4_u32[1]), - ~(V1.vector4_u32[2] | V2.vector4_u32[2]), - ~(V1.vector4_u32[3] | V2.vector4_u32[3]) - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t Result = vorrq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - return vreinterpretq_f32_u32(vbicq_u32(g_XMNegOneMask, Result)); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i Result; - Result = _mm_or_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); - Result = _mm_andnot_si128(Result, g_XMNegOneMask); - return _mm_castsi128_ps(Result); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorXorInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORU32 Result = { { { - V1.vector4_u32[0] ^ V2.vector4_u32[0], - V1.vector4_u32[1] ^ V2.vector4_u32[1], - V1.vector4_u32[2] ^ V2.vector4_u32[2], - V1.vector4_u32[3] ^ V2.vector4_u32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i V = _mm_xor_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return _mm_castsi128_ps(V); -#endif -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorNegate(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - -V.vector4_f32[0], - -V.vector4_f32[1], - -V.vector4_f32[2], - -V.vector4_f32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vnegq_f32(V); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR Z; - - Z = _mm_setzero_ps(); - - return _mm_sub_ps(Z, V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorAdd -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - V1.vector4_f32[0] + V2.vector4_f32[0], - V1.vector4_f32[1] + V2.vector4_f32[1], - V1.vector4_f32[2] + V2.vector4_f32[2], - V1.vector4_f32[3] + V2.vector4_f32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vaddq_f32(V1, V2); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_add_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSum(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result; - Result.f[0] = - Result.f[1] = - Result.f[2] = - Result.f[3] = V.vector4_f32[0] + V.vector4_f32[1] + V.vector4_f32[2] + V.vector4_f32[3]; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - float32x4_t vTemp = vpaddq_f32(V, V); - return vpaddq_f32(vTemp, vTemp); -#else - float32x2_t v1 = vget_low_f32(V); - float32x2_t v2 = vget_high_f32(V); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - return vcombine_f32(v1, v1); -#endif -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vTemp = _mm_hadd_ps(V, V); - return _mm_hadd_ps(vTemp, vTemp); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 3, 0, 1)); - XMVECTOR vTemp2 = _mm_add_ps(V, vTemp); - vTemp = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 0, 3, 2)); - return _mm_add_ps(vTemp, vTemp2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorAddAngles -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - const XMVECTOR Zero = XMVectorZero(); - - // Add the given angles together. If the range of V1 is such - // that -Pi <= V1 < Pi and the range of V2 is such that - // -2Pi <= V2 <= 2Pi, then the range of the resulting angle - // will be -Pi <= Result < Pi. - XMVECTOR Result = XMVectorAdd(V1, V2); - - XMVECTOR Mask = XMVectorLess(Result, g_XMNegativePi.v); - XMVECTOR Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); - - Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); - Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); - - Result = XMVectorAdd(Result, Offset); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Adjust the angles - float32x4_t vResult = vaddq_f32(V1, V2); - // Less than Pi? - uint32x4_t vOffset = vcltq_f32(vResult, g_XMNegativePi); - vOffset = vandq_u32(vOffset, g_XMTwoPi); - // Add 2Pi to all entries less than -Pi - vResult = vaddq_f32(vResult, vreinterpretq_f32_u32(vOffset)); - // Greater than or equal to Pi? - vOffset = vcgeq_f32(vResult, g_XMPi); - vOffset = vandq_u32(vOffset, g_XMTwoPi); - // Sub 2Pi to all entries greater than Pi - vResult = vsubq_f32(vResult, vreinterpretq_f32_u32(vOffset)); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Adjust the angles - XMVECTOR vResult = _mm_add_ps(V1, V2); - // Less than Pi? - XMVECTOR vOffset = _mm_cmplt_ps(vResult, g_XMNegativePi); - vOffset = _mm_and_ps(vOffset, g_XMTwoPi); - // Add 2Pi to all entries less than -Pi - vResult = _mm_add_ps(vResult, vOffset); - // Greater than or equal to Pi? - vOffset = _mm_cmpge_ps(vResult, g_XMPi); - vOffset = _mm_and_ps(vOffset, g_XMTwoPi); - // Sub 2Pi to all entries greater than Pi - vResult = _mm_sub_ps(vResult, vOffset); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSubtract -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - V1.vector4_f32[0] - V2.vector4_f32[0], - V1.vector4_f32[1] - V2.vector4_f32[1], - V1.vector4_f32[2] - V2.vector4_f32[2], - V1.vector4_f32[3] - V2.vector4_f32[3] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vsubq_f32(V1, V2); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_sub_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSubtractAngles -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - const XMVECTOR Zero = XMVectorZero(); - - // Subtract the given angles. If the range of V1 is such - // that -Pi <= V1 < Pi and the range of V2 is such that - // -2Pi <= V2 <= 2Pi, then the range of the resulting angle - // will be -Pi <= Result < Pi. - XMVECTOR Result = XMVectorSubtract(V1, V2); - - XMVECTOR Mask = XMVectorLess(Result, g_XMNegativePi.v); - XMVECTOR Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); - - Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); - Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); - - Result = XMVectorAdd(Result, Offset); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Adjust the angles - XMVECTOR vResult = vsubq_f32(V1, V2); - // Less than Pi? - uint32x4_t vOffset = vcltq_f32(vResult, g_XMNegativePi); - vOffset = vandq_u32(vOffset, g_XMTwoPi); - // Add 2Pi to all entries less than -Pi - vResult = vaddq_f32(vResult, vreinterpretq_f32_u32(vOffset)); - // Greater than or equal to Pi? - vOffset = vcgeq_f32(vResult, g_XMPi); - vOffset = vandq_u32(vOffset, g_XMTwoPi); - // Sub 2Pi to all entries greater than Pi - vResult = vsubq_f32(vResult, vreinterpretq_f32_u32(vOffset)); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Adjust the angles - XMVECTOR vResult = _mm_sub_ps(V1, V2); - // Less than Pi? - XMVECTOR vOffset = _mm_cmplt_ps(vResult, g_XMNegativePi); - vOffset = _mm_and_ps(vOffset, g_XMTwoPi); - // Add 2Pi to all entries less than -Pi - vResult = _mm_add_ps(vResult, vOffset); - // Greater than or equal to Pi? - vOffset = _mm_cmpge_ps(vResult, g_XMPi); - vOffset = _mm_and_ps(vOffset, g_XMTwoPi); - // Sub 2Pi to all entries greater than Pi - vResult = _mm_sub_ps(vResult, vOffset); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMultiply -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - V1.vector4_f32[0] * V2.vector4_f32[0], - V1.vector4_f32[1] * V2.vector4_f32[1], - V1.vector4_f32[2] * V2.vector4_f32[2], - V1.vector4_f32[3] * V2.vector4_f32[3] - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vmulq_f32(V1, V2); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_mul_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMultiplyAdd -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR V3 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - V1.vector4_f32[0] * V2.vector4_f32[0] + V3.vector4_f32[0], - V1.vector4_f32[1] * V2.vector4_f32[1] + V3.vector4_f32[1], - V1.vector4_f32[2] * V2.vector4_f32[2] + V3.vector4_f32[2], - V1.vector4_f32[3] * V2.vector4_f32[3] + V3.vector4_f32[3] - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vfmaq_f32(V3, V1, V2); -#else - return vmlaq_f32(V3, V1, V2); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - return XM_FMADD_PS(V1, V2, V3); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorDivide -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - V1.vector4_f32[0] / V2.vector4_f32[0], - V1.vector4_f32[1] / V2.vector4_f32[1], - V1.vector4_f32[2] / V2.vector4_f32[2], - V1.vector4_f32[3] / V2.vector4_f32[3] - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vdivq_f32(V1, V2); -#else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x4_t Reciprocal = vrecpeq_f32(V2); - float32x4_t S = vrecpsq_f32(Reciprocal, V2); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, V2); - Reciprocal = vmulq_f32(S, Reciprocal); - return vmulq_f32(V1, Reciprocal); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_div_ps(V1, V2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorNegativeMultiplySubtract -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR V3 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - V3.vector4_f32[0] - (V1.vector4_f32[0] * V2.vector4_f32[0]), - V3.vector4_f32[1] - (V1.vector4_f32[1] * V2.vector4_f32[1]), - V3.vector4_f32[2] - (V1.vector4_f32[2] * V2.vector4_f32[2]), - V3.vector4_f32[3] - (V1.vector4_f32[3] * V2.vector4_f32[3]) - } } }; - return Result; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - return vfmsq_f32(V3, V1, V2); -#else - return vmlsq_f32(V3, V1, V2); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - return XM_FNMADD_PS(V1, V2, V3); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorScale -( - FXMVECTOR V, - float ScaleFactor -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - V.vector4_f32[0] * ScaleFactor, - V.vector4_f32[1] * ScaleFactor, - V.vector4_f32[2] * ScaleFactor, - V.vector4_f32[3] * ScaleFactor - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vmulq_n_f32(V, ScaleFactor); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_set_ps1(ScaleFactor); - return _mm_mul_ps(vResult, V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorReciprocalEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - 1.f / V.vector4_f32[0], - 1.f / V.vector4_f32[1], - 1.f / V.vector4_f32[2], - 1.f / V.vector4_f32[3] - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vrecpeq_f32(V); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_rcp_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorReciprocal(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - 1.f / V.vector4_f32[0], - 1.f / V.vector4_f32[1], - 1.f / V.vector4_f32[2], - 1.f / V.vector4_f32[3] - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - float32x4_t one = vdupq_n_f32(1.0f); - return vdivq_f32(one, V); -#else - // 2 iterations of Newton-Raphson refinement - float32x4_t Reciprocal = vrecpeq_f32(V); - float32x4_t S = vrecpsq_f32(Reciprocal, V); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, V); - return vmulq_f32(S, Reciprocal); -#endif -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_div_ps(g_XMOne, V); -#endif -} - -//------------------------------------------------------------------------------ -// Return an estimated square root -inline XMVECTOR XM_CALLCONV XMVectorSqrtEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - sqrtf(V.vector4_f32[0]), - sqrtf(V.vector4_f32[1]), - sqrtf(V.vector4_f32[2]), - sqrtf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // 1 iteration of Newton-Raphson refinment of sqrt - float32x4_t S0 = vrsqrteq_f32(V); - float32x4_t P0 = vmulq_f32(V, S0); - float32x4_t R0 = vrsqrtsq_f32(P0, S0); - float32x4_t S1 = vmulq_f32(S0, R0); - - XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); - XMVECTOR VEqualsZero = XMVectorEqual(V, vdupq_n_f32(0)); - XMVECTOR Result = vmulq_f32(V, S1); - XMVECTOR Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); - return XMVectorSelect(V, Result, Select); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_sqrt_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSqrt(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - sqrtf(V.vector4_f32[0]), - sqrtf(V.vector4_f32[1]), - sqrtf(V.vector4_f32[2]), - sqrtf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // 3 iterations of Newton-Raphson refinment of sqrt - float32x4_t S0 = vrsqrteq_f32(V); - float32x4_t P0 = vmulq_f32(V, S0); - float32x4_t R0 = vrsqrtsq_f32(P0, S0); - float32x4_t S1 = vmulq_f32(S0, R0); - float32x4_t P1 = vmulq_f32(V, S1); - float32x4_t R1 = vrsqrtsq_f32(P1, S1); - float32x4_t S2 = vmulq_f32(S1, R1); - float32x4_t P2 = vmulq_f32(V, S2); - float32x4_t R2 = vrsqrtsq_f32(P2, S2); - float32x4_t S3 = vmulq_f32(S2, R2); - - XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); - XMVECTOR VEqualsZero = XMVectorEqual(V, vdupq_n_f32(0)); - XMVECTOR Result = vmulq_f32(V, S3); - XMVECTOR Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); - return XMVectorSelect(V, Result, Select); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_sqrt_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrtEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - 1.f / sqrtf(V.vector4_f32[0]), - 1.f / sqrtf(V.vector4_f32[1]), - 1.f / sqrtf(V.vector4_f32[2]), - 1.f / sqrtf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vrsqrteq_f32(V); -#elif defined(_XM_SSE_INTRINSICS_) - return _mm_rsqrt_ps(V); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - 1.f / sqrtf(V.vector4_f32[0]), - 1.f / sqrtf(V.vector4_f32[1]), - 1.f / sqrtf(V.vector4_f32[2]), - 1.f / sqrtf(V.vector4_f32[3]) - } } }; - return Result; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x4_t S0 = vrsqrteq_f32(V); - - float32x4_t P0 = vmulq_f32(V, S0); - float32x4_t R0 = vrsqrtsq_f32(P0, S0); - - float32x4_t S1 = vmulq_f32(S0, R0); - float32x4_t P1 = vmulq_f32(V, S1); - float32x4_t R1 = vrsqrtsq_f32(P1, S1); - - return vmulq_f32(S1, R1); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_sqrt_ps(V); - vResult = _mm_div_ps(g_XMOne, vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - exp2f(V.vector4_f32[0]), - exp2f(V.vector4_f32[1]), - exp2f(V.vector4_f32[2]), - exp2f(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t itrunc = vcvtq_s32_f32(V); - float32x4_t ftrunc = vcvtq_f32_s32(itrunc); - float32x4_t y = vsubq_f32(V, ftrunc); - - float32x4_t poly = vmlaq_f32(g_XMExpEst6, g_XMExpEst7, y); - poly = vmlaq_f32(g_XMExpEst5, poly, y); - poly = vmlaq_f32(g_XMExpEst4, poly, y); - poly = vmlaq_f32(g_XMExpEst3, poly, y); - poly = vmlaq_f32(g_XMExpEst2, poly, y); - poly = vmlaq_f32(g_XMExpEst1, poly, y); - poly = vmlaq_f32(g_XMOne, poly, y); - - int32x4_t biased = vaddq_s32(itrunc, g_XMExponentBias); - biased = vshlq_n_s32(biased, 23); - float32x4_t result0 = XMVectorDivide(vreinterpretq_f32_s32(biased), poly); - - biased = vaddq_s32(itrunc, g_XM253); - biased = vshlq_n_s32(biased, 23); - float32x4_t result1 = XMVectorDivide(vreinterpretq_f32_s32(biased), poly); - result1 = vmulq_f32(g_XMMinNormal.v, result1); - - // Use selection to handle the cases - // if (V is NaN) -> QNaN; - // else if (V sign bit set) - // if (V > -150) - // if (V.exponent < -126) -> result1 - // else -> result0 - // else -> +0 - // else - // if (V < 128) -> result0 - // else -> +inf - - uint32x4_t comp = vcltq_s32(vreinterpretq_s32_f32(V), g_XMBin128); - float32x4_t result2 = vbslq_f32(comp, result0, g_XMInfinity); - - comp = vcltq_s32(itrunc, g_XMSubnormalExponent); - float32x4_t result3 = vbslq_f32(comp, result1, result0); - - comp = vcltq_s32(vreinterpretq_s32_f32(V), g_XMBinNeg150); - float32x4_t result4 = vbslq_f32(comp, result3, g_XMZero); - - int32x4_t sign = vandq_s32(vreinterpretq_s32_f32(V), g_XMNegativeZero); - comp = vceqq_s32(sign, g_XMNegativeZero); - float32x4_t result5 = vbslq_f32(comp, result4, result2); - - int32x4_t t0 = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); - int32x4_t t1 = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); - t0 = vreinterpretq_s32_u32(vceqq_s32(t0, g_XMZero)); - t1 = vreinterpretq_s32_u32(vceqq_s32(t1, g_XMInfinity)); - int32x4_t isNaN = vbicq_s32(t1, t0); - - float32x4_t vResult = vbslq_f32(vreinterpretq_u32_s32(isNaN), g_XMQNaN, result5); - return vResult; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_exp2_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i itrunc = _mm_cvttps_epi32(V); - __m128 ftrunc = _mm_cvtepi32_ps(itrunc); - __m128 y = _mm_sub_ps(V, ftrunc); - - __m128 poly = XM_FMADD_PS(g_XMExpEst7, y, g_XMExpEst6); - poly = XM_FMADD_PS(poly, y, g_XMExpEst5); - poly = XM_FMADD_PS(poly, y, g_XMExpEst4); - poly = XM_FMADD_PS(poly, y, g_XMExpEst3); - poly = XM_FMADD_PS(poly, y, g_XMExpEst2); - poly = XM_FMADD_PS(poly, y, g_XMExpEst1); - poly = XM_FMADD_PS(poly, y, g_XMOne); - - __m128i biased = _mm_add_epi32(itrunc, g_XMExponentBias); - biased = _mm_slli_epi32(biased, 23); - __m128 result0 = _mm_div_ps(_mm_castsi128_ps(biased), poly); - - biased = _mm_add_epi32(itrunc, g_XM253); - biased = _mm_slli_epi32(biased, 23); - __m128 result1 = _mm_div_ps(_mm_castsi128_ps(biased), poly); - result1 = _mm_mul_ps(g_XMMinNormal.v, result1); - - // Use selection to handle the cases - // if (V is NaN) -> QNaN; - // else if (V sign bit set) - // if (V > -150) - // if (V.exponent < -126) -> result1 - // else -> result0 - // else -> +0 - // else - // if (V < 128) -> result0 - // else -> +inf - - __m128i comp = _mm_cmplt_epi32(_mm_castps_si128(V), g_XMBin128); - __m128i select0 = _mm_and_si128(comp, _mm_castps_si128(result0)); - __m128i select1 = _mm_andnot_si128(comp, g_XMInfinity); - __m128i result2 = _mm_or_si128(select0, select1); - - comp = _mm_cmplt_epi32(itrunc, g_XMSubnormalExponent); - select1 = _mm_and_si128(comp, _mm_castps_si128(result1)); - select0 = _mm_andnot_si128(comp, _mm_castps_si128(result0)); - __m128i result3 = _mm_or_si128(select0, select1); - - comp = _mm_cmplt_epi32(_mm_castps_si128(V), g_XMBinNeg150); - select0 = _mm_and_si128(comp, result3); - select1 = _mm_andnot_si128(comp, g_XMZero); - __m128i result4 = _mm_or_si128(select0, select1); - - __m128i sign = _mm_and_si128(_mm_castps_si128(V), g_XMNegativeZero); - comp = _mm_cmpeq_epi32(sign, g_XMNegativeZero); - select0 = _mm_and_si128(comp, result4); - select1 = _mm_andnot_si128(comp, result2); - __m128i result5 = _mm_or_si128(select0, select1); - - __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - t0 = _mm_cmpeq_epi32(t0, g_XMZero); - t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); - __m128i isNaN = _mm_andnot_si128(t0, t1); - - select0 = _mm_and_si128(isNaN, g_XMQNaN); - select1 = _mm_andnot_si128(isNaN, result5); - __m128i vResult = _mm_or_si128(select0, select1); - - return _mm_castsi128_ps(vResult); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorExp10(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - powf(10.0f, V.vector4_f32[0]), - powf(10.0f, V.vector4_f32[1]), - powf(10.0f, V.vector4_f32[2]), - powf(10.0f, V.vector4_f32[3]) - } } }; - return Result.v; - -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_exp10_ps(V); - return Result; -#else - // exp10(V) = exp2(vin*log2(10)) - XMVECTOR Vten = XMVectorMultiply(g_XMLg10, V); - return XMVectorExp2(Vten); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorExpE(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - expf(V.vector4_f32[0]), - expf(V.vector4_f32[1]), - expf(V.vector4_f32[2]), - expf(V.vector4_f32[3]) - } } }; - return Result.v; - -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_exp_ps(V); - return Result; -#else - // expE(V) = exp2(vin*log2(e)) - XMVECTOR Ve = XMVectorMultiply(g_XMLgE, V); - return XMVectorExp2(Ve); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept -{ - return XMVectorExp2(V); -} - -//------------------------------------------------------------------------------ - -#if defined(_XM_SSE_INTRINSICS_) - -namespace MathInternal -{ - inline __m128i multi_sll_epi32(__m128i value, __m128i count) noexcept - { - __m128i v = _mm_shuffle_epi32(value, _MM_SHUFFLE(0, 0, 0, 0)); - __m128i c = _mm_shuffle_epi32(count, _MM_SHUFFLE(0, 0, 0, 0)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r0 = _mm_sll_epi32(v, c); - - v = _mm_shuffle_epi32(value, _MM_SHUFFLE(1, 1, 1, 1)); - c = _mm_shuffle_epi32(count, _MM_SHUFFLE(1, 1, 1, 1)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r1 = _mm_sll_epi32(v, c); - - v = _mm_shuffle_epi32(value, _MM_SHUFFLE(2, 2, 2, 2)); - c = _mm_shuffle_epi32(count, _MM_SHUFFLE(2, 2, 2, 2)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r2 = _mm_sll_epi32(v, c); - - v = _mm_shuffle_epi32(value, _MM_SHUFFLE(3, 3, 3, 3)); - c = _mm_shuffle_epi32(count, _MM_SHUFFLE(3, 3, 3, 3)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r3 = _mm_sll_epi32(v, c); - - // (r0,r0,r1,r1) - __m128 r01 = _mm_shuffle_ps(_mm_castsi128_ps(r0), _mm_castsi128_ps(r1), _MM_SHUFFLE(0, 0, 0, 0)); - // (r2,r2,r3,r3) - __m128 r23 = _mm_shuffle_ps(_mm_castsi128_ps(r2), _mm_castsi128_ps(r3), _MM_SHUFFLE(0, 0, 0, 0)); - // (r0,r1,r2,r3) - __m128 result = _mm_shuffle_ps(r01, r23, _MM_SHUFFLE(2, 0, 2, 0)); - return _mm_castps_si128(result); - } - - inline __m128i multi_srl_epi32(__m128i value, __m128i count) noexcept - { - __m128i v = _mm_shuffle_epi32(value, _MM_SHUFFLE(0, 0, 0, 0)); - __m128i c = _mm_shuffle_epi32(count, _MM_SHUFFLE(0, 0, 0, 0)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r0 = _mm_srl_epi32(v, c); - - v = _mm_shuffle_epi32(value, _MM_SHUFFLE(1, 1, 1, 1)); - c = _mm_shuffle_epi32(count, _MM_SHUFFLE(1, 1, 1, 1)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r1 = _mm_srl_epi32(v, c); - - v = _mm_shuffle_epi32(value, _MM_SHUFFLE(2, 2, 2, 2)); - c = _mm_shuffle_epi32(count, _MM_SHUFFLE(2, 2, 2, 2)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r2 = _mm_srl_epi32(v, c); - - v = _mm_shuffle_epi32(value, _MM_SHUFFLE(3, 3, 3, 3)); - c = _mm_shuffle_epi32(count, _MM_SHUFFLE(3, 3, 3, 3)); - c = _mm_and_si128(c, g_XMMaskX); - __m128i r3 = _mm_srl_epi32(v, c); - - // (r0,r0,r1,r1) - __m128 r01 = _mm_shuffle_ps(_mm_castsi128_ps(r0), _mm_castsi128_ps(r1), _MM_SHUFFLE(0, 0, 0, 0)); - // (r2,r2,r3,r3) - __m128 r23 = _mm_shuffle_ps(_mm_castsi128_ps(r2), _mm_castsi128_ps(r3), _MM_SHUFFLE(0, 0, 0, 0)); - // (r0,r1,r2,r3) - __m128 result = _mm_shuffle_ps(r01, r23, _MM_SHUFFLE(2, 0, 2, 0)); - return _mm_castps_si128(result); - } - - inline __m128i GetLeadingBit(const __m128i value) noexcept - { - static const XMVECTORI32 g_XM0000FFFF = { { { 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF } } }; - static const XMVECTORI32 g_XM000000FF = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; - static const XMVECTORI32 g_XM0000000F = { { { 0x0000000F, 0x0000000F, 0x0000000F, 0x0000000F } } }; - static const XMVECTORI32 g_XM00000003 = { { { 0x00000003, 0x00000003, 0x00000003, 0x00000003 } } }; - - __m128i v = value, r, c, b, s; - - c = _mm_cmpgt_epi32(v, g_XM0000FFFF); // c = (v > 0xFFFF) - b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) - r = _mm_slli_epi32(b, 4); // r = (b << 4) - v = multi_srl_epi32(v, r); // v = (v >> r) - - c = _mm_cmpgt_epi32(v, g_XM000000FF); // c = (v > 0xFF) - b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) - s = _mm_slli_epi32(b, 3); // s = (b << 3) - v = multi_srl_epi32(v, s); // v = (v >> s) - r = _mm_or_si128(r, s); // r = (r | s) - - c = _mm_cmpgt_epi32(v, g_XM0000000F); // c = (v > 0xF) - b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) - s = _mm_slli_epi32(b, 2); // s = (b << 2) - v = multi_srl_epi32(v, s); // v = (v >> s) - r = _mm_or_si128(r, s); // r = (r | s) - - c = _mm_cmpgt_epi32(v, g_XM00000003); // c = (v > 0x3) - b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) - s = _mm_slli_epi32(b, 1); // s = (b << 1) - v = multi_srl_epi32(v, s); // v = (v >> s) - r = _mm_or_si128(r, s); // r = (r | s) - - s = _mm_srli_epi32(v, 1); - r = _mm_or_si128(r, s); - return r; - } -} // namespace MathInternal - -#endif // _XM_SSE_INTRINSICS_ - -#if defined(_XM_ARM_NEON_INTRINSICS_) - -namespace MathInternal -{ - inline int32x4_t GetLeadingBit(const int32x4_t value) noexcept - { - static const XMVECTORI32 g_XM0000FFFF = { { { 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF } } }; - static const XMVECTORI32 g_XM000000FF = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; - static const XMVECTORI32 g_XM0000000F = { { { 0x0000000F, 0x0000000F, 0x0000000F, 0x0000000F } } }; - static const XMVECTORI32 g_XM00000003 = { { { 0x00000003, 0x00000003, 0x00000003, 0x00000003 } } }; - - uint32x4_t c = vcgtq_s32(value, g_XM0000FFFF); // c = (v > 0xFFFF) - int32x4_t b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) - int32x4_t r = vshlq_n_s32(b, 4); // r = (b << 4) - r = vnegq_s32(r); - int32x4_t v = vshlq_s32(value, r); // v = (v >> r) - - c = vcgtq_s32(v, g_XM000000FF); // c = (v > 0xFF) - b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) - int32x4_t s = vshlq_n_s32(b, 3); // s = (b << 3) - s = vnegq_s32(s); - v = vshlq_s32(v, s); // v = (v >> s) - r = vorrq_s32(r, s); // r = (r | s) - - c = vcgtq_s32(v, g_XM0000000F); // c = (v > 0xF) - b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) - s = vshlq_n_s32(b, 2); // s = (b << 2) - s = vnegq_s32(s); - v = vshlq_s32(v, s); // v = (v >> s) - r = vorrq_s32(r, s); // r = (r | s) - - c = vcgtq_s32(v, g_XM00000003); // c = (v > 0x3) - b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) - s = vshlq_n_s32(b, 1); // s = (b << 1) - s = vnegq_s32(s); - v = vshlq_s32(v, s); // v = (v >> s) - r = vorrq_s32(r, s); // r = (r | s) - - s = vshrq_n_s32(v, 1); - r = vorrq_s32(r, s); - return r; - } - -} // namespace MathInternal - -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - log2f(V.vector4_f32[0]), - log2f(V.vector4_f32[1]), - log2f(V.vector4_f32[2]), - log2f(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); - int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); - uint32x4_t isExponentZero = vceqq_s32(vreinterpretq_s32_f32(g_XMZero), rawBiased); - - // Compute exponent and significand for normals. - int32x4_t biased = vshrq_n_s32(rawBiased, 23); - int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); - int32x4_t trailingNor = trailing; - - // Compute exponent and significand for subnormals. - int32x4_t leading = MathInternal::GetLeadingBit(trailing); - int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); - int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); - int32x4_t trailingSub = vshlq_s32(trailing, shift); - trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); - int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); - int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); - - // Compute the approximation. - int32x4_t tmp = vorrq_s32(vreinterpretq_s32_f32(g_XMOne), t); - float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); - - float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); - log2 = vmlaq_f32(g_XMLogEst5, log2, y); - log2 = vmlaq_f32(g_XMLogEst4, log2, y); - log2 = vmlaq_f32(g_XMLogEst3, log2, y); - log2 = vmlaq_f32(g_XMLogEst2, log2, y); - log2 = vmlaq_f32(g_XMLogEst1, log2, y); - log2 = vmlaq_f32(g_XMLogEst0, log2, y); - log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); - - // if (x is NaN) -> QNaN - // else if (V is positive) - // if (V is infinite) -> +inf - // else -> log2(V) - // else - // if (V is zero) -> -inf - // else -> -QNaN - - uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - isInfinite = vceqq_u32(isInfinite, g_XMInfinity); - - uint32x4_t isGreaterZero = vcgtq_f32(V, g_XMZero); - uint32x4_t isNotFinite = vcgtq_f32(V, g_XMInfinity); - uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); - - uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - isZero = vceqq_u32(isZero, g_XMZero); - - uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); - uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); - t0 = vceqq_u32(t0, g_XMZero); - t1 = vceqq_u32(t1, g_XMInfinity); - uint32x4_t isNaN = vbicq_u32(t1, t0); - - float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); - float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); - result = vbslq_f32(isPositive, result, tmp2); - result = vbslq_f32(isNaN, g_XMQNaN, result); - return result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_log2_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); - - // Compute exponent and significand for normals. - __m128i biased = _mm_srli_epi32(rawBiased, 23); - __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); - __m128i trailingNor = trailing; - - // Compute exponent and significand for subnormals. - __m128i leading = MathInternal::GetLeadingBit(trailing); - __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); - __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); - __m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift); - trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); - - __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); - __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); - __m128i e = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isExponentZero, trailingSub); - select1 = _mm_andnot_si128(isExponentZero, trailingNor); - __m128i t = _mm_or_si128(select0, select1); - - // Compute the approximation. - __m128i tmp = _mm_or_si128(g_XMOne, t); - __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); - - __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); - log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); - - // if (x is NaN) -> QNaN - // else if (V is positive) - // if (V is infinite) -> +inf - // else -> log2(V) - // else - // if (V is zero) -> -inf - // else -> -QNaN - - __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); - - __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); - __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); - __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); - - __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - isZero = _mm_cmpeq_epi32(isZero, g_XMZero); - - __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - t0 = _mm_cmpeq_epi32(t0, g_XMZero); - t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); - __m128i isNaN = _mm_andnot_si128(t0, t1); - - select0 = _mm_and_si128(isInfinite, g_XMInfinity); - select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); - __m128i result = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isZero, g_XMNegInfinity); - select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); - tmp = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isPositive, result); - select1 = _mm_andnot_si128(isPositive, tmp); - result = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isNaN, g_XMQNaN); - select1 = _mm_andnot_si128(isNaN, result); - result = _mm_or_si128(select0, select1); - - return _mm_castsi128_ps(result); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - log10f(V.vector4_f32[0]), - log10f(V.vector4_f32[1]), - log10f(V.vector4_f32[2]), - log10f(V.vector4_f32[3]) - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); - int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); - uint32x4_t isExponentZero = vceqq_s32(g_XMZero, rawBiased); - - // Compute exponent and significand for normals. - int32x4_t biased = vshrq_n_s32(rawBiased, 23); - int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); - int32x4_t trailingNor = trailing; - - // Compute exponent and significand for subnormals. - int32x4_t leading = MathInternal::GetLeadingBit(trailing); - int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); - int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); - int32x4_t trailingSub = vshlq_s32(trailing, shift); - trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); - int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); - int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); - - // Compute the approximation. - int32x4_t tmp = vorrq_s32(g_XMOne, t); - float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); - - float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); - log2 = vmlaq_f32(g_XMLogEst5, log2, y); - log2 = vmlaq_f32(g_XMLogEst4, log2, y); - log2 = vmlaq_f32(g_XMLogEst3, log2, y); - log2 = vmlaq_f32(g_XMLogEst2, log2, y); - log2 = vmlaq_f32(g_XMLogEst1, log2, y); - log2 = vmlaq_f32(g_XMLogEst0, log2, y); - log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); - - log2 = vmulq_f32(g_XMInvLg10, log2); - - // if (x is NaN) -> QNaN - // else if (V is positive) - // if (V is infinite) -> +inf - // else -> log2(V) - // else - // if (V is zero) -> -inf - // else -> -QNaN - - uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - isInfinite = vceqq_u32(isInfinite, g_XMInfinity); - - uint32x4_t isGreaterZero = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMZero); - uint32x4_t isNotFinite = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); - uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); - - uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - isZero = vceqq_u32(isZero, g_XMZero); - - uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); - uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); - t0 = vceqq_u32(t0, g_XMZero); - t1 = vceqq_u32(t1, g_XMInfinity); - uint32x4_t isNaN = vbicq_u32(t1, t0); - - float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); - float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); - result = vbslq_f32(isPositive, result, tmp2); - result = vbslq_f32(isNaN, g_XMQNaN, result); - return result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_log10_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); - - // Compute exponent and significand for normals. - __m128i biased = _mm_srli_epi32(rawBiased, 23); - __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); - __m128i trailingNor = trailing; - - // Compute exponent and significand for subnormals. - __m128i leading = MathInternal::GetLeadingBit(trailing); - __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); - __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); - __m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift); - trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); - - __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); - __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); - __m128i e = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isExponentZero, trailingSub); - select1 = _mm_andnot_si128(isExponentZero, trailingNor); - __m128i t = _mm_or_si128(select0, select1); - - // Compute the approximation. - __m128i tmp = _mm_or_si128(g_XMOne, t); - __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); - - __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); - log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); - - log2 = _mm_mul_ps(g_XMInvLg10, log2); - - // if (x is NaN) -> QNaN - // else if (V is positive) - // if (V is infinite) -> +inf - // else -> log2(V) - // else - // if (V is zero) -> -inf - // else -> -QNaN - - __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); - - __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); - __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); - __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); - - __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - isZero = _mm_cmpeq_epi32(isZero, g_XMZero); - - __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - t0 = _mm_cmpeq_epi32(t0, g_XMZero); - t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); - __m128i isNaN = _mm_andnot_si128(t0, t1); - - select0 = _mm_and_si128(isInfinite, g_XMInfinity); - select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); - __m128i result = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isZero, g_XMNegInfinity); - select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); - tmp = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isPositive, result); - select1 = _mm_andnot_si128(isPositive, tmp); - result = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isNaN, g_XMQNaN); - select1 = _mm_andnot_si128(isNaN, result); - result = _mm_or_si128(select0, select1); - - return _mm_castsi128_ps(result); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - logf(V.vector4_f32[0]), - logf(V.vector4_f32[1]), - logf(V.vector4_f32[2]), - logf(V.vector4_f32[3]) - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); - int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); - uint32x4_t isExponentZero = vceqq_s32(g_XMZero, rawBiased); - - // Compute exponent and significand for normals. - int32x4_t biased = vshrq_n_s32(rawBiased, 23); - int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); - int32x4_t trailingNor = trailing; - - // Compute exponent and significand for subnormals. - int32x4_t leading = MathInternal::GetLeadingBit(trailing); - int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); - int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); - int32x4_t trailingSub = vshlq_s32(trailing, shift); - trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); - int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); - int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); - - // Compute the approximation. - int32x4_t tmp = vorrq_s32(g_XMOne, t); - float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); - - float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); - log2 = vmlaq_f32(g_XMLogEst5, log2, y); - log2 = vmlaq_f32(g_XMLogEst4, log2, y); - log2 = vmlaq_f32(g_XMLogEst3, log2, y); - log2 = vmlaq_f32(g_XMLogEst2, log2, y); - log2 = vmlaq_f32(g_XMLogEst1, log2, y); - log2 = vmlaq_f32(g_XMLogEst0, log2, y); - log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); - - log2 = vmulq_f32(g_XMInvLgE, log2); - - // if (x is NaN) -> QNaN - // else if (V is positive) - // if (V is infinite) -> +inf - // else -> log2(V) - // else - // if (V is zero) -> -inf - // else -> -QNaN - - uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - isInfinite = vceqq_u32(isInfinite, g_XMInfinity); - - uint32x4_t isGreaterZero = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMZero); - uint32x4_t isNotFinite = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); - uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); - - uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - isZero = vceqq_u32(isZero, g_XMZero); - - uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); - uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); - t0 = vceqq_u32(t0, g_XMZero); - t1 = vceqq_u32(t1, g_XMInfinity); - uint32x4_t isNaN = vbicq_u32(t1, t0); - - float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); - float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); - result = vbslq_f32(isPositive, result, tmp2); - result = vbslq_f32(isNaN, g_XMQNaN, result); - return result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_log_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); - - // Compute exponent and significand for normals. - __m128i biased = _mm_srli_epi32(rawBiased, 23); - __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); - __m128i trailingNor = trailing; - - // Compute exponent and significand for subnormals. - __m128i leading = MathInternal::GetLeadingBit(trailing); - __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); - __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); - __m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift); - trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); - - __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); - __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); - __m128i e = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isExponentZero, trailingSub); - select1 = _mm_andnot_si128(isExponentZero, trailingNor); - __m128i t = _mm_or_si128(select0, select1); - - // Compute the approximation. - __m128i tmp = _mm_or_si128(g_XMOne, t); - __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); - - __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); - log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); - log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); - - log2 = _mm_mul_ps(g_XMInvLgE, log2); - - // if (x is NaN) -> QNaN - // else if (V is positive) - // if (V is infinite) -> +inf - // else -> log2(V) - // else - // if (V is zero) -> -inf - // else -> -QNaN - - __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); - - __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); - __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); - __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); - - __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); - isZero = _mm_cmpeq_epi32(isZero, g_XMZero); - - __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); - __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); - t0 = _mm_cmpeq_epi32(t0, g_XMZero); - t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); - __m128i isNaN = _mm_andnot_si128(t0, t1); - - select0 = _mm_and_si128(isInfinite, g_XMInfinity); - select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); - __m128i result = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isZero, g_XMNegInfinity); - select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); - tmp = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isPositive, result); - select1 = _mm_andnot_si128(isPositive, tmp); - result = _mm_or_si128(select0, select1); - - select0 = _mm_and_si128(isNaN, g_XMQNaN); - select1 = _mm_andnot_si128(isNaN, result); - result = _mm_or_si128(select0, select1); - - return _mm_castsi128_ps(result); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLog(FXMVECTOR V) noexcept -{ - return XMVectorLog2(V); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorPow -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - powf(V1.vector4_f32[0], V2.vector4_f32[0]), - powf(V1.vector4_f32[1], V2.vector4_f32[1]), - powf(V1.vector4_f32[2], V2.vector4_f32[2]), - powf(V1.vector4_f32[3], V2.vector4_f32[3]) - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTORF32 vResult = { { { - powf(vgetq_lane_f32(V1, 0), vgetq_lane_f32(V2, 0)), - powf(vgetq_lane_f32(V1, 1), vgetq_lane_f32(V2, 1)), - powf(vgetq_lane_f32(V1, 2), vgetq_lane_f32(V2, 2)), - powf(vgetq_lane_f32(V1, 3), vgetq_lane_f32(V2, 3)) - } } }; - return vResult.v; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_pow_ps(V1, V2); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - XM_ALIGNED_DATA(16) float a[4]; - XM_ALIGNED_DATA(16) float b[4]; - _mm_store_ps(a, V1); - _mm_store_ps(b, V2); - XMVECTOR vResult = _mm_setr_ps( - powf(a[0], b[0]), - powf(a[1], b[1]), - powf(a[2], b[2]), - powf(a[3], b[3])); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorAbs(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - fabsf(V.vector4_f32[0]), - fabsf(V.vector4_f32[1]), - fabsf(V.vector4_f32[2]), - fabsf(V.vector4_f32[3]) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - return vabsq_f32(V); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_setzero_ps(); - vResult = _mm_sub_ps(vResult, V); - vResult = _mm_max_ps(vResult, V); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorMod -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - // V1 % V2 = V1 - V2 * truncate(V1 / V2) - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Quotient = XMVectorDivide(V1, V2); - Quotient = XMVectorTruncate(Quotient); - XMVECTOR Result = XMVectorNegativeMultiplySubtract(V2, Quotient, V1); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR vResult = XMVectorDivide(V1, V2); - vResult = XMVectorTruncate(vResult); - return vmlsq_f32(V1, vResult, V2); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_div_ps(V1, V2); - vResult = XMVectorTruncate(vResult); - return XM_FNMADD_PS(vResult, V2, V1); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorModAngles(FXMVECTOR Angles) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR V; - XMVECTOR Result; - - // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI - V = XMVectorMultiply(Angles, g_XMReciprocalTwoPi.v); - V = XMVectorRound(V); - Result = XMVectorNegativeMultiplySubtract(g_XMTwoPi.v, V, Angles); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI - XMVECTOR vResult = vmulq_f32(Angles, g_XMReciprocalTwoPi); - // Use the inline function due to complexity for rounding - vResult = XMVectorRound(vResult); - return vmlsq_f32(Angles, vResult, g_XMTwoPi); -#elif defined(_XM_SSE_INTRINSICS_) - // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI - XMVECTOR vResult = _mm_mul_ps(Angles, g_XMReciprocalTwoPi); - // Use the inline function due to complexity for rounding - vResult = XMVectorRound(vResult); - return XM_FNMADD_PS(vResult, g_XMTwoPi, Angles); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSin(FXMVECTOR V) noexcept -{ - // 11-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - sinf(V.vector4_f32[0]), - sinf(V.vector4_f32[1]), - sinf(V.vector4_f32[2]), - sinf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with sin(y) = sin(x). - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); - uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - float32x4_t absx = vabsq_f32(x); - float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); - uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); - x = vbslq_f32(comp, x, rflx); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation - const XMVECTOR SC1 = g_XMSinCoefficients1; - const XMVECTOR SC0 = g_XMSinCoefficients0; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SC0), 1); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(SC1), 0); - - vConstants = vdupq_lane_f32(vget_high_f32(SC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(SC0), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(SC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - Result = vmulq_f32(Result, x); - return Result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_sin_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with sin(y) = sin(x). - __m128 sign = _mm_and_ps(x, g_XMNegativeZero); - __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - __m128 absx = _mm_andnot_ps(sign, x); // |x| - __m128 rflx = _mm_sub_ps(c, x); - __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); - __m128 select0 = _mm_and_ps(comp, x); - __m128 select1 = _mm_andnot_ps(comp, rflx); - x = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation - const XMVECTOR SC1 = g_XMSinCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(SC1, _MM_SHUFFLE(0, 0, 0, 0)); - const XMVECTOR SC0 = g_XMSinCoefficients0; - __m128 vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(2, 2, 2, 2)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, x); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorCos(FXMVECTOR V) noexcept -{ - // 10-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - cosf(V.vector4_f32[0]), - cosf(V.vector4_f32[1]), - cosf(V.vector4_f32[2]), - cosf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Map V to x in [-pi,pi]. - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); - uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - float32x4_t absx = vabsq_f32(x); - float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); - uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); - x = vbslq_f32(comp, x, rflx); - float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation - const XMVECTOR CC1 = g_XMCosCoefficients1; - const XMVECTOR CC0 = g_XMCosCoefficients0; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(CC0), 1); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(CC1), 0); - - vConstants = vdupq_lane_f32(vget_high_f32(CC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(CC0), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(CC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - Result = vmulq_f32(Result, fsign); - return Result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_cos_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - // Map V to x in [-pi,pi]. - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). - XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); - __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - __m128 absx = _mm_andnot_ps(sign, x); // |x| - __m128 rflx = _mm_sub_ps(c, x); - __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); - __m128 select0 = _mm_and_ps(comp, x); - __m128 select1 = _mm_andnot_ps(comp, rflx); - x = _mm_or_ps(select0, select1); - select0 = _mm_and_ps(comp, g_XMOne); - select1 = _mm_andnot_ps(comp, g_XMNegativeOne); - sign = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation - const XMVECTOR CC1 = g_XMCosCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(CC1, _MM_SHUFFLE(0, 0, 0, 0)); - const XMVECTOR CC0 = g_XMCosCoefficients0; - __m128 vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(2, 2, 2, 2)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, sign); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorSinCos -( - XMVECTOR* pSin, - XMVECTOR* pCos, - FXMVECTOR V -) noexcept -{ - assert(pSin != nullptr); - assert(pCos != nullptr); - - // 11/10-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Sin = { { { - sinf(V.vector4_f32[0]), - sinf(V.vector4_f32[1]), - sinf(V.vector4_f32[2]), - sinf(V.vector4_f32[3]) - } } }; - - XMVECTORF32 Cos = { { { - cosf(V.vector4_f32[0]), - cosf(V.vector4_f32[1]), - cosf(V.vector4_f32[2]), - cosf(V.vector4_f32[3]) - } } }; - - *pSin = Sin.v; - *pCos = Cos.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); - uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - float32x4_t absx = vabsq_f32(x); - float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); - uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); - x = vbslq_f32(comp, x, rflx); - float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation for sine - const XMVECTOR SC1 = g_XMSinCoefficients1; - const XMVECTOR SC0 = g_XMSinCoefficients0; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SC0), 1); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(SC1), 0); - - vConstants = vdupq_lane_f32(vget_high_f32(SC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(SC0), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(SC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - *pSin = vmulq_f32(Result, x); - - // Compute polynomial approximation for cosine - const XMVECTOR CC1 = g_XMCosCoefficients1; - const XMVECTOR CC0 = g_XMCosCoefficients0; - vConstants = vdupq_lane_f32(vget_high_f32(CC0), 1); - Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(CC1), 0); - - vConstants = vdupq_lane_f32(vget_high_f32(CC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(CC0), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(CC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - *pCos = vmulq_f32(Result, fsign); -#elif defined(_XM_SVML_INTRINSICS_) - *pSin = _mm_sincos_ps(pCos, V); -#elif defined(_XM_SSE_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with sin(y) = sin(x), cos(y) = sign*cos(x). - XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); - __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - __m128 absx = _mm_andnot_ps(sign, x); // |x| - __m128 rflx = _mm_sub_ps(c, x); - __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); - __m128 select0 = _mm_and_ps(comp, x); - __m128 select1 = _mm_andnot_ps(comp, rflx); - x = _mm_or_ps(select0, select1); - select0 = _mm_and_ps(comp, g_XMOne); - select1 = _mm_andnot_ps(comp, g_XMNegativeOne); - sign = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation of sine - const XMVECTOR SC1 = g_XMSinCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(SC1, _MM_SHUFFLE(0, 0, 0, 0)); - const XMVECTOR SC0 = g_XMSinCoefficients0; - __m128 vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(2, 2, 2, 2)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, x); - *pSin = Result; - - // Compute polynomial approximation of cosine - const XMVECTOR CC1 = g_XMCosCoefficients1; - vConstantsB = XM_PERMUTE_PS(CC1, _MM_SHUFFLE(0, 0, 0, 0)); - const XMVECTOR CC0 = g_XMCosCoefficients0; - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(3, 3, 3, 3)); - Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(2, 2, 2, 2)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, sign); - *pCos = Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorTan(FXMVECTOR V) noexcept -{ - // Cody and Waite algorithm to compute tangent. - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - tanf(V.vector4_f32[0]), - tanf(V.vector4_f32[1]), - tanf(V.vector4_f32[2]), - tanf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_tan_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - static const XMVECTORF32 TanCoefficients0 = { { { 1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f } } }; - static const XMVECTORF32 TanCoefficients1 = { { { 4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f } } }; - static const XMVECTORF32 TanConstants = { { { 1.570796371f, 6.077100628e-11f, 0.000244140625f, 0.63661977228f /*2 / Pi*/ } } }; - static const XMVECTORU32 Mask = { { { 0x1, 0x1, 0x1, 0x1 } } }; - - XMVECTOR TwoDivPi = XMVectorSplatW(TanConstants.v); - - XMVECTOR Zero = XMVectorZero(); - - XMVECTOR C0 = XMVectorSplatX(TanConstants.v); - XMVECTOR C1 = XMVectorSplatY(TanConstants.v); - XMVECTOR Epsilon = XMVectorSplatZ(TanConstants.v); - - XMVECTOR VA = XMVectorMultiply(V, TwoDivPi); - - VA = XMVectorRound(VA); - - XMVECTOR VC = XMVectorNegativeMultiplySubtract(VA, C0, V); - - XMVECTOR VB = XMVectorAbs(VA); - - VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); - -#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - VB = vreinterpretq_f32_u32(vcvtq_u32_f32(VB)); -#elif defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - reinterpret_cast<__m128i*>(&VB)[0] = _mm_cvttps_epi32(VB); -#else - for (size_t i = 0; i < 4; i++) - { - VB.vector4_u32[i] = static_cast(VB.vector4_f32[i]); - } -#endif - - XMVECTOR VC2 = XMVectorMultiply(VC, VC); - - XMVECTOR T7 = XMVectorSplatW(TanCoefficients1.v); - XMVECTOR T6 = XMVectorSplatZ(TanCoefficients1.v); - XMVECTOR T4 = XMVectorSplatX(TanCoefficients1.v); - XMVECTOR T3 = XMVectorSplatW(TanCoefficients0.v); - XMVECTOR T5 = XMVectorSplatY(TanCoefficients1.v); - XMVECTOR T2 = XMVectorSplatZ(TanCoefficients0.v); - XMVECTOR T1 = XMVectorSplatY(TanCoefficients0.v); - XMVECTOR T0 = XMVectorSplatX(TanCoefficients0.v); - - XMVECTOR VBIsEven = XMVectorAndInt(VB, Mask.v); - VBIsEven = XMVectorEqualInt(VBIsEven, Zero); - - XMVECTOR N = XMVectorMultiplyAdd(VC2, T7, T6); - XMVECTOR D = XMVectorMultiplyAdd(VC2, T4, T3); - N = XMVectorMultiplyAdd(VC2, N, T5); - D = XMVectorMultiplyAdd(VC2, D, T2); - N = XMVectorMultiply(VC2, N); - D = XMVectorMultiplyAdd(VC2, D, T1); - N = XMVectorMultiplyAdd(VC, N, VC); - XMVECTOR VCNearZero = XMVectorInBounds(VC, Epsilon); - D = XMVectorMultiplyAdd(VC2, D, T0); - - N = XMVectorSelect(N, VC, VCNearZero); - D = XMVectorSelect(D, g_XMOne.v, VCNearZero); - - XMVECTOR R0 = XMVectorNegate(N); - XMVECTOR R1 = XMVectorDivide(N, D); - R0 = XMVectorDivide(D, R0); - - XMVECTOR VIsZero = XMVectorEqual(V, Zero); - - XMVECTOR Result = XMVectorSelect(R0, R1, VBIsEven); - - Result = XMVectorSelect(Result, Zero, VIsZero); - - return Result; - -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSinH(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - sinhf(V.vector4_f32[0]), - sinhf(V.vector4_f32[1]), - sinhf(V.vector4_f32[2]), - sinhf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) - - XMVECTOR V1 = vmlaq_f32(g_XMNegativeOne.v, V, Scale.v); - XMVECTOR V2 = vmlsq_f32(g_XMNegativeOne.v, V, Scale.v); - XMVECTOR E1 = XMVectorExp(V1); - XMVECTOR E2 = XMVectorExp(V2); - - return vsubq_f32(E1, E2); -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_sinh_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) - - XMVECTOR V1 = XM_FMADD_PS(V, Scale, g_XMNegativeOne); - XMVECTOR V2 = XM_FNMADD_PS(V, Scale, g_XMNegativeOne); - XMVECTOR E1 = XMVectorExp(V1); - XMVECTOR E2 = XMVectorExp(V2); - - return _mm_sub_ps(E1, E2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorCosH(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - coshf(V.vector4_f32[0]), - coshf(V.vector4_f32[1]), - coshf(V.vector4_f32[2]), - coshf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) - - XMVECTOR V1 = vmlaq_f32(g_XMNegativeOne.v, V, Scale.v); - XMVECTOR V2 = vmlsq_f32(g_XMNegativeOne.v, V, Scale.v); - XMVECTOR E1 = XMVectorExp(V1); - XMVECTOR E2 = XMVectorExp(V2); - return vaddq_f32(E1, E2); -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_cosh_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) - - XMVECTOR V1 = XM_FMADD_PS(V, Scale.v, g_XMNegativeOne.v); - XMVECTOR V2 = XM_FNMADD_PS(V, Scale.v, g_XMNegativeOne.v); - XMVECTOR E1 = XMVectorExp(V1); - XMVECTOR E2 = XMVectorExp(V2); - return _mm_add_ps(E1, E2); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorTanH(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - tanhf(V.vector4_f32[0]), - tanhf(V.vector4_f32[1]), - tanhf(V.vector4_f32[2]), - tanhf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f } } }; // 2.0f / ln(2.0f) - - XMVECTOR E = vmulq_f32(V, Scale.v); - E = XMVectorExp(E); - E = vmlaq_f32(g_XMOneHalf.v, E, g_XMOneHalf.v); - E = XMVectorReciprocal(E); - return vsubq_f32(g_XMOne.v, E); -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_tanh_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f } } }; // 2.0f / ln(2.0f) - - XMVECTOR E = _mm_mul_ps(V, Scale.v); - E = XMVectorExp(E); - E = XM_FMADD_PS(E, g_XMOneHalf.v, g_XMOneHalf.v); - E = _mm_div_ps(g_XMOne.v, E); - return _mm_sub_ps(g_XMOne.v, E); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorASin(FXMVECTOR V) noexcept -{ - // 7-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - asinf(V.vector4_f32[0]), - asinf(V.vector4_f32[1]), - asinf(V.vector4_f32[2]), - asinf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); - float32x4_t x = vabsq_f32(V); - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - float32x4_t oneMValue = vsubq_f32(g_XMOne, x); - float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); - float32x4_t root = XMVectorSqrt(clampOneMValue); - - // Compute polynomial approximation - const XMVECTOR AC1 = g_XMArcCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AC1), 0); - XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AC1), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(AC1), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AC1), 0); - t0 = vmlaq_f32(vConstants, t0, x); - - const XMVECTOR AC0 = g_XMArcCoefficients0; - vConstants = vdupq_lane_f32(vget_high_f32(AC0), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_high_f32(AC0), 0); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AC0), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AC0), 0); - t0 = vmlaq_f32(vConstants, t0, x); - t0 = vmulq_f32(t0, root); - - float32x4_t t1 = vsubq_f32(g_XMPi, t0); - t0 = vbslq_f32(nonnegative, t0, t1); - t0 = vsubq_f32(g_XMHalfPi, t0); - return t0; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_asin_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); - __m128 mvalue = _mm_sub_ps(g_XMZero, V); - __m128 x = _mm_max_ps(V, mvalue); // |V| - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - __m128 oneMValue = _mm_sub_ps(g_XMOne, x); - __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); - __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) - - // Compute polynomial approximation - const XMVECTOR AC1 = g_XMArcCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(1, 1, 1, 1)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(0, 0, 0, 0)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - const XMVECTOR AC0 = g_XMArcCoefficients0; - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(3, 3, 3, 3)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(2, 2, 2, 2)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(1, 1, 1, 1)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(0, 0, 0, 0)); - t0 = XM_FMADD_PS(t0, x, vConstants); - t0 = _mm_mul_ps(t0, root); - - __m128 t1 = _mm_sub_ps(g_XMPi, t0); - t0 = _mm_and_ps(nonnegative, t0); - t1 = _mm_andnot_ps(nonnegative, t1); - t0 = _mm_or_ps(t0, t1); - t0 = _mm_sub_ps(g_XMHalfPi, t0); - return t0; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorACos(FXMVECTOR V) noexcept -{ - // 7-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - acosf(V.vector4_f32[0]), - acosf(V.vector4_f32[1]), - acosf(V.vector4_f32[2]), - acosf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); - float32x4_t x = vabsq_f32(V); - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - float32x4_t oneMValue = vsubq_f32(g_XMOne, x); - float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); - float32x4_t root = XMVectorSqrt(clampOneMValue); - - // Compute polynomial approximation - const XMVECTOR AC1 = g_XMArcCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AC1), 0); - XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AC1), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(AC1), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AC1), 0); - t0 = vmlaq_f32(vConstants, t0, x); - - const XMVECTOR AC0 = g_XMArcCoefficients0; - vConstants = vdupq_lane_f32(vget_high_f32(AC0), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_high_f32(AC0), 0); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AC0), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AC0), 0); - t0 = vmlaq_f32(vConstants, t0, x); - t0 = vmulq_f32(t0, root); - - float32x4_t t1 = vsubq_f32(g_XMPi, t0); - t0 = vbslq_f32(nonnegative, t0, t1); - return t0; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_acos_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); - __m128 mvalue = _mm_sub_ps(g_XMZero, V); - __m128 x = _mm_max_ps(V, mvalue); // |V| - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - __m128 oneMValue = _mm_sub_ps(g_XMOne, x); - __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); - __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) - - // Compute polynomial approximation - const XMVECTOR AC1 = g_XMArcCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(1, 1, 1, 1)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(0, 0, 0, 0)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - const XMVECTOR AC0 = g_XMArcCoefficients0; - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(3, 3, 3, 3)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(2, 2, 2, 2)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(1, 1, 1, 1)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(0, 0, 0, 0)); - t0 = XM_FMADD_PS(t0, x, vConstants); - t0 = _mm_mul_ps(t0, root); - - __m128 t1 = _mm_sub_ps(g_XMPi, t0); - t0 = _mm_and_ps(nonnegative, t0); - t1 = _mm_andnot_ps(nonnegative, t1); - t0 = _mm_or_ps(t0, t1); - return t0; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorATan(FXMVECTOR V) noexcept -{ - // 17-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - atanf(V.vector4_f32[0]), - atanf(V.vector4_f32[1]), - atanf(V.vector4_f32[2]), - atanf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t absV = vabsq_f32(V); - float32x4_t invV = XMVectorReciprocal(V); - uint32x4_t comp = vcgtq_f32(V, g_XMOne); - float32x4_t sign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); - comp = vcleq_f32(absV, g_XMOne); - sign = vbslq_f32(comp, g_XMZero, sign); - float32x4_t x = vbslq_f32(comp, V, invV); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation - const XMVECTOR TC1 = g_XMATanCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(TC1), 0); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(TC1), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(TC1), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(TC1), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - const XMVECTOR TC0 = g_XMATanCoefficients0; - vConstants = vdupq_lane_f32(vget_high_f32(TC0), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_high_f32(TC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(TC0), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(TC0), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - Result = vmulq_f32(Result, x); - - float32x4_t result1 = vmulq_f32(sign, g_XMHalfPi); - result1 = vsubq_f32(result1, Result); - - comp = vceqq_f32(sign, g_XMZero); - Result = vbslq_f32(comp, Result, result1); - return Result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_atan_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 absV = XMVectorAbs(V); - __m128 invV = _mm_div_ps(g_XMOne, V); - __m128 comp = _mm_cmpgt_ps(V, g_XMOne); - __m128 select0 = _mm_and_ps(comp, g_XMOne); - __m128 select1 = _mm_andnot_ps(comp, g_XMNegativeOne); - __m128 sign = _mm_or_ps(select0, select1); - comp = _mm_cmple_ps(absV, g_XMOne); - select0 = _mm_and_ps(comp, g_XMZero); - select1 = _mm_andnot_ps(comp, sign); - sign = _mm_or_ps(select0, select1); - select0 = _mm_and_ps(comp, V); - select1 = _mm_andnot_ps(comp, invV); - __m128 x = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation - const XMVECTOR TC1 = g_XMATanCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - const XMVECTOR TC0 = g_XMATanCoefficients0; - vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(3, 3, 3, 3)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(2, 2, 2, 2)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - Result = XM_FMADD_PS(Result, x2, g_XMOne); - - Result = _mm_mul_ps(Result, x); - __m128 result1 = _mm_mul_ps(sign, g_XMHalfPi); - result1 = _mm_sub_ps(result1, Result); - - comp = _mm_cmpeq_ps(sign, g_XMZero); - select0 = _mm_and_ps(comp, Result); - select1 = _mm_andnot_ps(comp, result1); - Result = _mm_or_ps(select0, select1); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorATan2 -( - FXMVECTOR Y, - FXMVECTOR X -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - atan2f(Y.vector4_f32[0], X.vector4_f32[0]), - atan2f(Y.vector4_f32[1], X.vector4_f32[1]), - atan2f(Y.vector4_f32[2], X.vector4_f32[2]), - atan2f(Y.vector4_f32[3], X.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_atan2_ps(Y, X); - return Result; -#else - - // Return the inverse tangent of Y / X in the range of -Pi to Pi with the following exceptions: - - // Y == 0 and X is Negative -> Pi with the sign of Y - // y == 0 and x is positive -> 0 with the sign of y - // Y != 0 and X == 0 -> Pi / 2 with the sign of Y - // Y != 0 and X is Negative -> atan(y/x) + (PI with the sign of Y) - // X == -Infinity and Finite Y -> Pi with the sign of Y - // X == +Infinity and Finite Y -> 0 with the sign of Y - // Y == Infinity and X is Finite -> Pi / 2 with the sign of Y - // Y == Infinity and X == -Infinity -> 3Pi / 4 with the sign of Y - // Y == Infinity and X == +Infinity -> Pi / 4 with the sign of Y - - static const XMVECTORF32 ATan2Constants = { { { XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f } } }; - - XMVECTOR Zero = XMVectorZero(); - XMVECTOR ATanResultValid = XMVectorTrueInt(); - - XMVECTOR Pi = XMVectorSplatX(ATan2Constants); - XMVECTOR PiOverTwo = XMVectorSplatY(ATan2Constants); - XMVECTOR PiOverFour = XMVectorSplatZ(ATan2Constants); - XMVECTOR ThreePiOverFour = XMVectorSplatW(ATan2Constants); - - XMVECTOR YEqualsZero = XMVectorEqual(Y, Zero); - XMVECTOR XEqualsZero = XMVectorEqual(X, Zero); - XMVECTOR XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); - XIsPositive = XMVectorEqualInt(XIsPositive, Zero); - XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); - XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); - - XMVECTOR YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); - Pi = XMVectorOrInt(Pi, YSign); - PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); - PiOverFour = XMVectorOrInt(PiOverFour, YSign); - ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); - - XMVECTOR R1 = XMVectorSelect(Pi, YSign, XIsPositive); - XMVECTOR R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); - XMVECTOR R3 = XMVectorSelect(R2, R1, YEqualsZero); - XMVECTOR R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); - XMVECTOR R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); - XMVECTOR Result = XMVectorSelect(R3, R5, YEqualsInfinity); - ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); - - XMVECTOR V = XMVectorDivide(Y, X); - - XMVECTOR R0 = XMVectorATan(V); - - R1 = XMVectorSelect(Pi, g_XMNegativeZero, XIsPositive); - R2 = XMVectorAdd(R0, R1); - - return XMVectorSelect(Result, R2, ATanResultValid); - -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorSinEst(FXMVECTOR V) noexcept -{ - // 7-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - sinf(V.vector4_f32[0]), - sinf(V.vector4_f32[1]), - sinf(V.vector4_f32[2]), - sinf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with sin(y) = sin(x). - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); - uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - float32x4_t absx = vabsq_f32(x); - float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); - uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); - x = vbslq_f32(comp, x, rflx); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation - const XMVECTOR SEC = g_XMSinCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SEC), 0); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(SEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(SEC), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - Result = vmulq_f32(Result, x); - return Result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_sin_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with sin(y) = sin(x). - __m128 sign = _mm_and_ps(x, g_XMNegativeZero); - __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - __m128 absx = _mm_andnot_ps(sign, x); // |x| - __m128 rflx = _mm_sub_ps(c, x); - __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); - __m128 select0 = _mm_and_ps(comp, x); - __m128 select1 = _mm_andnot_ps(comp, rflx); - x = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation - const XMVECTOR SEC = g_XMSinCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, x); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorCosEst(FXMVECTOR V) noexcept -{ - // 6-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - cosf(V.vector4_f32[0]), - cosf(V.vector4_f32[1]), - cosf(V.vector4_f32[2]), - cosf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Map V to x in [-pi,pi]. - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); - uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - float32x4_t absx = vabsq_f32(x); - float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); - uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); - x = vbslq_f32(comp, x, rflx); - float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation - const XMVECTOR CEC = g_XMCosCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(CEC), 0); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(CEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(CEC), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - Result = vmulq_f32(Result, fsign); - return Result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_cos_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - // Map V to x in [-pi,pi]. - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). - XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); - __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - __m128 absx = _mm_andnot_ps(sign, x); // |x| - __m128 rflx = _mm_sub_ps(c, x); - __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); - __m128 select0 = _mm_and_ps(comp, x); - __m128 select1 = _mm_andnot_ps(comp, rflx); - x = _mm_or_ps(select0, select1); - select0 = _mm_and_ps(comp, g_XMOne); - select1 = _mm_andnot_ps(comp, g_XMNegativeOne); - sign = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation - const XMVECTOR CEC = g_XMCosCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, sign); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline void XM_CALLCONV XMVectorSinCosEst -( - XMVECTOR* pSin, - XMVECTOR* pCos, - FXMVECTOR V -) noexcept -{ - assert(pSin != nullptr); - assert(pCos != nullptr); - - // 7/6-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Sin = { { { - sinf(V.vector4_f32[0]), - sinf(V.vector4_f32[1]), - sinf(V.vector4_f32[2]), - sinf(V.vector4_f32[3]) - } } }; - - XMVECTORF32 Cos = { { { - cosf(V.vector4_f32[0]), - cosf(V.vector4_f32[1]), - cosf(V.vector4_f32[2]), - cosf(V.vector4_f32[3]) - } } }; - - *pSin = Sin.v; - *pCos = Cos.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). - uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); - uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - float32x4_t absx = vabsq_f32(x); - float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); - uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); - x = vbslq_f32(comp, x, rflx); - float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation for sine - const XMVECTOR SEC = g_XMSinCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SEC), 0); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(SEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(SEC), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - *pSin = vmulq_f32(Result, x); - - // Compute polynomial approximation - const XMVECTOR CEC = g_XMCosCoefficients1; - vConstants = vdupq_lane_f32(vget_high_f32(CEC), 0); - Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(CEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(CEC), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - Result = vmlaq_f32(g_XMOne, Result, x2); - *pCos = vmulq_f32(Result, fsign); -#elif defined(_XM_SSE_INTRINSICS_) - // Force the value within the bounds of pi - XMVECTOR x = XMVectorModAngles(V); - - // Map in [-pi/2,pi/2] with sin(y) = sin(x), cos(y) = sign*cos(x). - XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); - __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 - __m128 absx = _mm_andnot_ps(sign, x); // |x| - __m128 rflx = _mm_sub_ps(c, x); - __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); - __m128 select0 = _mm_and_ps(comp, x); - __m128 select1 = _mm_andnot_ps(comp, rflx); - x = _mm_or_ps(select0, select1); - select0 = _mm_and_ps(comp, g_XMOne); - select1 = _mm_andnot_ps(comp, g_XMNegativeOne); - sign = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation for sine - const XMVECTOR SEC = g_XMSinCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, x); - *pSin = Result; - - // Compute polynomial approximation for cosine - const XMVECTOR CEC = g_XMCosCoefficients1; - vConstantsB = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(3, 3, 3, 3)); - vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(2, 2, 2, 2)); - Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - Result = XM_FMADD_PS(Result, x2, g_XMOne); - Result = _mm_mul_ps(Result, sign); - *pCos = Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorTanEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - tanf(V.vector4_f32[0]), - tanf(V.vector4_f32[1]), - tanf(V.vector4_f32[2]), - tanf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_tan_ps(V); - return Result; -#else - - XMVECTOR OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients.v); - - XMVECTOR V1 = XMVectorMultiply(V, OneOverPi); - V1 = XMVectorRound(V1); - - V1 = XMVectorNegativeMultiplySubtract(g_XMPi.v, V1, V); - - XMVECTOR T0 = XMVectorSplatX(g_XMTanEstCoefficients.v); - XMVECTOR T1 = XMVectorSplatY(g_XMTanEstCoefficients.v); - XMVECTOR T2 = XMVectorSplatZ(g_XMTanEstCoefficients.v); - - XMVECTOR V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); - XMVECTOR V2 = XMVectorMultiply(V1, V1); - XMVECTOR V1T0 = XMVectorMultiply(V1, T0); - XMVECTOR V1T1 = XMVectorMultiply(V1, T1); - - XMVECTOR D = XMVectorReciprocalEst(V2T2); - XMVECTOR N = XMVectorMultiplyAdd(V2, V1T1, V1T0); - - return XMVectorMultiply(N, D); - -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorASinEst(FXMVECTOR V) noexcept -{ - // 3-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result; - Result.f[0] = asinf(V.vector4_f32[0]); - Result.f[1] = asinf(V.vector4_f32[1]); - Result.f[2] = asinf(V.vector4_f32[2]); - Result.f[3] = asinf(V.vector4_f32[3]); - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); - float32x4_t x = vabsq_f32(V); - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - float32x4_t oneMValue = vsubq_f32(g_XMOne, x); - float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); - float32x4_t root = XMVectorSqrt(clampOneMValue); - - // Compute polynomial approximation - const XMVECTOR AEC = g_XMArcEstCoefficients; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); - XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); - t0 = vmlaq_f32(vConstants, t0, x); - t0 = vmulq_f32(t0, root); - - float32x4_t t1 = vsubq_f32(g_XMPi, t0); - t0 = vbslq_f32(nonnegative, t0, t1); - t0 = vsubq_f32(g_XMHalfPi, t0); - return t0; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_asin_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); - __m128 mvalue = _mm_sub_ps(g_XMZero, V); - __m128 x = _mm_max_ps(V, mvalue); // |V| - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - __m128 oneMValue = _mm_sub_ps(g_XMOne, x); - __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); - __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) - - // Compute polynomial approximation - const XMVECTOR AEC = g_XMArcEstCoefficients; - __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); - - vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); - t0 = XM_FMADD_PS(t0, x, vConstants); - t0 = _mm_mul_ps(t0, root); - - __m128 t1 = _mm_sub_ps(g_XMPi, t0); - t0 = _mm_and_ps(nonnegative, t0); - t1 = _mm_andnot_ps(nonnegative, t1); - t0 = _mm_or_ps(t0, t1); - t0 = _mm_sub_ps(g_XMHalfPi, t0); - return t0; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorACosEst(FXMVECTOR V) noexcept -{ - // 3-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - acosf(V.vector4_f32[0]), - acosf(V.vector4_f32[1]), - acosf(V.vector4_f32[2]), - acosf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); - float32x4_t x = vabsq_f32(V); - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - float32x4_t oneMValue = vsubq_f32(g_XMOne, x); - float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); - float32x4_t root = XMVectorSqrt(clampOneMValue); - - // Compute polynomial approximation - const XMVECTOR AEC = g_XMArcEstCoefficients; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); - XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); - t0 = vmlaq_f32(vConstants, t0, x); - - vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); - t0 = vmlaq_f32(vConstants, t0, x); - t0 = vmulq_f32(t0, root); - - float32x4_t t1 = vsubq_f32(g_XMPi, t0); - t0 = vbslq_f32(nonnegative, t0, t1); - return t0; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_acos_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); - __m128 mvalue = _mm_sub_ps(g_XMZero, V); - __m128 x = _mm_max_ps(V, mvalue); // |V| - - // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. - __m128 oneMValue = _mm_sub_ps(g_XMOne, x); - __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); - __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) - - // Compute polynomial approximation - const XMVECTOR AEC = g_XMArcEstCoefficients; - __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); - - vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); - t0 = XM_FMADD_PS(t0, x, vConstants); - - vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); - t0 = XM_FMADD_PS(t0, x, vConstants); - t0 = _mm_mul_ps(t0, root); - - __m128 t1 = _mm_sub_ps(g_XMPi, t0); - t0 = _mm_and_ps(nonnegative, t0); - t1 = _mm_andnot_ps(nonnegative, t1); - t0 = _mm_or_ps(t0, t1); - return t0; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorATanEst(FXMVECTOR V) noexcept -{ - // 9-degree minimax approximation - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - atanf(V.vector4_f32[0]), - atanf(V.vector4_f32[1]), - atanf(V.vector4_f32[2]), - atanf(V.vector4_f32[3]) - } } }; - return Result.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t absV = vabsq_f32(V); - float32x4_t invV = XMVectorReciprocalEst(V); - uint32x4_t comp = vcgtq_f32(V, g_XMOne); - float32x4_t sign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); - comp = vcleq_f32(absV, g_XMOne); - sign = vbslq_f32(comp, g_XMZero, sign); - float32x4_t x = vbslq_f32(comp, V, invV); - - float32x4_t x2 = vmulq_f32(x, x); - - // Compute polynomial approximation - const XMVECTOR AEC = g_XMATanEstCoefficients1; - XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); - XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(AEC), 1); - - vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); - Result = vmlaq_f32(vConstants, Result, x2); - - vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); - Result = vmlaq_f32(vConstants, Result, x2); - - // ATanEstCoefficients0 is already splatted - Result = vmlaq_f32(g_XMATanEstCoefficients0, Result, x2); - Result = vmulq_f32(Result, x); - - float32x4_t result1 = vmulq_f32(sign, g_XMHalfPi); - result1 = vsubq_f32(result1, Result); - - comp = vceqq_f32(sign, g_XMZero); - Result = vbslq_f32(comp, Result, result1); - return Result; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_atan_ps(V); - return Result; -#elif defined(_XM_SSE_INTRINSICS_) - __m128 absV = XMVectorAbs(V); - __m128 invV = _mm_div_ps(g_XMOne, V); - __m128 comp = _mm_cmpgt_ps(V, g_XMOne); - __m128 select0 = _mm_and_ps(comp, g_XMOne); - __m128 select1 = _mm_andnot_ps(comp, g_XMNegativeOne); - __m128 sign = _mm_or_ps(select0, select1); - comp = _mm_cmple_ps(absV, g_XMOne); - select0 = _mm_and_ps(comp, g_XMZero); - select1 = _mm_andnot_ps(comp, sign); - sign = _mm_or_ps(select0, select1); - select0 = _mm_and_ps(comp, V); - select1 = _mm_andnot_ps(comp, invV); - __m128 x = _mm_or_ps(select0, select1); - - __m128 x2 = _mm_mul_ps(x, x); - - // Compute polynomial approximation - const XMVECTOR AEC = g_XMATanEstCoefficients1; - __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); - - vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); - Result = XM_FMADD_PS(Result, x2, vConstants); - - vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); - Result = XM_FMADD_PS(Result, x2, vConstants); - // ATanEstCoefficients0 is already splatted - Result = XM_FMADD_PS(Result, x2, g_XMATanEstCoefficients0); - Result = _mm_mul_ps(Result, x); - __m128 result1 = _mm_mul_ps(sign, g_XMHalfPi); - result1 = _mm_sub_ps(result1, Result); - - comp = _mm_cmpeq_ps(sign, g_XMZero); - select0 = _mm_and_ps(comp, Result); - select1 = _mm_andnot_ps(comp, result1); - Result = _mm_or_ps(select0, select1); - return Result; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorATan2Est -( - FXMVECTOR Y, - FXMVECTOR X -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 Result = { { { - atan2f(Y.vector4_f32[0], X.vector4_f32[0]), - atan2f(Y.vector4_f32[1], X.vector4_f32[1]), - atan2f(Y.vector4_f32[2], X.vector4_f32[2]), - atan2f(Y.vector4_f32[3], X.vector4_f32[3]), - } } }; - return Result.v; -#elif defined(_XM_SVML_INTRINSICS_) - XMVECTOR Result = _mm_atan2_ps(Y, X); - return Result; -#else - - static const XMVECTORF32 ATan2Constants = { { { XM_PI, XM_PIDIV2, XM_PIDIV4, 2.3561944905f /* Pi*3/4 */ } } }; - - const XMVECTOR Zero = XMVectorZero(); - XMVECTOR ATanResultValid = XMVectorTrueInt(); - - XMVECTOR Pi = XMVectorSplatX(ATan2Constants); - XMVECTOR PiOverTwo = XMVectorSplatY(ATan2Constants); - XMVECTOR PiOverFour = XMVectorSplatZ(ATan2Constants); - XMVECTOR ThreePiOverFour = XMVectorSplatW(ATan2Constants); - - XMVECTOR YEqualsZero = XMVectorEqual(Y, Zero); - XMVECTOR XEqualsZero = XMVectorEqual(X, Zero); - XMVECTOR XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); - XIsPositive = XMVectorEqualInt(XIsPositive, Zero); - XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); - XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); - - XMVECTOR YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); - Pi = XMVectorOrInt(Pi, YSign); - PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); - PiOverFour = XMVectorOrInt(PiOverFour, YSign); - ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); - - XMVECTOR R1 = XMVectorSelect(Pi, YSign, XIsPositive); - XMVECTOR R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); - XMVECTOR R3 = XMVectorSelect(R2, R1, YEqualsZero); - XMVECTOR R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); - XMVECTOR R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); - XMVECTOR Result = XMVectorSelect(R3, R5, YEqualsInfinity); - ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); - - XMVECTOR Reciprocal = XMVectorReciprocalEst(X); - XMVECTOR V = XMVectorMultiply(Y, Reciprocal); - XMVECTOR R0 = XMVectorATanEst(V); - - R1 = XMVectorSelect(Pi, g_XMNegativeZero, XIsPositive); - R2 = XMVectorAdd(R0, R1); - - Result = XMVectorSelect(Result, R2, ATanResultValid); - - return Result; - -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLerp -( - FXMVECTOR V0, - FXMVECTOR V1, - float t -) noexcept -{ - // V0 + t * (V1 - V0) - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Scale = XMVectorReplicate(t); - XMVECTOR Length = XMVectorSubtract(V1, V0); - return XMVectorMultiplyAdd(Length, Scale, V0); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR L = vsubq_f32(V1, V0); - return vmlaq_n_f32(V0, L, t); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR L = _mm_sub_ps(V1, V0); - XMVECTOR S = _mm_set_ps1(t); - return XM_FMADD_PS(L, S, V0); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorLerpV -( - FXMVECTOR V0, - FXMVECTOR V1, - FXMVECTOR T -) noexcept -{ - // V0 + T * (V1 - V0) - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Length = XMVectorSubtract(V1, V0); - return XMVectorMultiplyAdd(Length, T, V0); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR L = vsubq_f32(V1, V0); - return vmlaq_f32(V0, L, T); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR Length = _mm_sub_ps(V1, V0); - return XM_FMADD_PS(Length, T, V0); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorHermite -( - FXMVECTOR Position0, - FXMVECTOR Tangent0, - FXMVECTOR Position1, - GXMVECTOR Tangent1, - float t -) noexcept -{ - // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + - // (t^3 - 2 * t^2 + t) * Tangent0 + - // (-2 * t^3 + 3 * t^2) * Position1 + - // (t^3 - t^2) * Tangent1 - -#if defined(_XM_NO_INTRINSICS_) - - float t2 = t * t; - float t3 = t * t2; - - XMVECTOR P0 = XMVectorReplicate(2.0f * t3 - 3.0f * t2 + 1.0f); - XMVECTOR T0 = XMVectorReplicate(t3 - 2.0f * t2 + t); - XMVECTOR P1 = XMVectorReplicate(-2.0f * t3 + 3.0f * t2); - XMVECTOR T1 = XMVectorReplicate(t3 - t2); - - XMVECTOR Result = XMVectorMultiply(P0, Position0); - Result = XMVectorMultiplyAdd(T0, Tangent0, Result); - Result = XMVectorMultiplyAdd(P1, Position1, Result); - Result = XMVectorMultiplyAdd(T1, Tangent1, Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float t2 = t * t; - float t3 = t * t2; - - float p0 = 2.0f * t3 - 3.0f * t2 + 1.0f; - float t0 = t3 - 2.0f * t2 + t; - float p1 = -2.0f * t3 + 3.0f * t2; - float t1 = t3 - t2; - - XMVECTOR vResult = vmulq_n_f32(Position0, p0); - vResult = vmlaq_n_f32(vResult, Tangent0, t0); - vResult = vmlaq_n_f32(vResult, Position1, p1); - vResult = vmlaq_n_f32(vResult, Tangent1, t1); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - float t2 = t * t; - float t3 = t * t2; - - XMVECTOR P0 = _mm_set_ps1(2.0f * t3 - 3.0f * t2 + 1.0f); - XMVECTOR T0 = _mm_set_ps1(t3 - 2.0f * t2 + t); - XMVECTOR P1 = _mm_set_ps1(-2.0f * t3 + 3.0f * t2); - XMVECTOR T1 = _mm_set_ps1(t3 - t2); - - XMVECTOR vResult = _mm_mul_ps(P0, Position0); - vResult = XM_FMADD_PS(Tangent0, T0, vResult); - vResult = XM_FMADD_PS(Position1, P1, vResult); - vResult = XM_FMADD_PS(Tangent1, T1, vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorHermiteV -( - FXMVECTOR Position0, - FXMVECTOR Tangent0, - FXMVECTOR Position1, - GXMVECTOR Tangent1, - HXMVECTOR T -) noexcept -{ - // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + - // (t^3 - 2 * t^2 + t) * Tangent0 + - // (-2 * t^3 + 3 * t^2) * Position1 + - // (t^3 - t^2) * Tangent1 - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR T2 = XMVectorMultiply(T, T); - XMVECTOR T3 = XMVectorMultiply(T, T2); - - XMVECTOR P0 = XMVectorReplicate(2.0f * T3.vector4_f32[0] - 3.0f * T2.vector4_f32[0] + 1.0f); - XMVECTOR T0 = XMVectorReplicate(T3.vector4_f32[1] - 2.0f * T2.vector4_f32[1] + T.vector4_f32[1]); - XMVECTOR P1 = XMVectorReplicate(-2.0f * T3.vector4_f32[2] + 3.0f * T2.vector4_f32[2]); - XMVECTOR T1 = XMVectorReplicate(T3.vector4_f32[3] - T2.vector4_f32[3]); - - XMVECTOR Result = XMVectorMultiply(P0, Position0); - Result = XMVectorMultiplyAdd(T0, Tangent0, Result); - Result = XMVectorMultiplyAdd(P1, Position1, Result); - Result = XMVectorMultiplyAdd(T1, Tangent1, Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 CatMulT2 = { { { -3.0f, -2.0f, 3.0f, -1.0f } } }; - static const XMVECTORF32 CatMulT3 = { { { 2.0f, 1.0f, -2.0f, 1.0f } } }; - - XMVECTOR T2 = vmulq_f32(T, T); - XMVECTOR T3 = vmulq_f32(T, T2); - // Mul by the constants against t^2 - T2 = vmulq_f32(T2, CatMulT2); - // Mul by the constants against t^3 - T3 = vmlaq_f32(T2, T3, CatMulT3); - // T3 now has the pre-result. - // I need to add t.y only - T2 = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T), g_XMMaskY)); - T3 = vaddq_f32(T3, T2); - // Add 1.0f to x - T3 = vaddq_f32(T3, g_XMIdentityR0); - // Now, I have the constants created - // Mul the x constant to Position0 - XMVECTOR vResult = vmulq_lane_f32(Position0, vget_low_f32(T3), 0); // T3[0] - // Mul the y constant to Tangent0 - vResult = vmlaq_lane_f32(vResult, Tangent0, vget_low_f32(T3), 1); // T3[1] - // Mul the z constant to Position1 - vResult = vmlaq_lane_f32(vResult, Position1, vget_high_f32(T3), 0); // T3[2] - // Mul the w constant to Tangent1 - vResult = vmlaq_lane_f32(vResult, Tangent1, vget_high_f32(T3), 1); // T3[3] - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 CatMulT2 = { { { -3.0f, -2.0f, 3.0f, -1.0f } } }; - static const XMVECTORF32 CatMulT3 = { { { 2.0f, 1.0f, -2.0f, 1.0f } } }; - - XMVECTOR T2 = _mm_mul_ps(T, T); - XMVECTOR T3 = _mm_mul_ps(T, T2); - // Mul by the constants against t^2 - T2 = _mm_mul_ps(T2, CatMulT2); - // Mul by the constants against t^3 - T3 = XM_FMADD_PS(T3, CatMulT3, T2); - // T3 now has the pre-result. - // I need to add t.y only - T2 = _mm_and_ps(T, g_XMMaskY); - T3 = _mm_add_ps(T3, T2); - // Add 1.0f to x - T3 = _mm_add_ps(T3, g_XMIdentityR0); - // Now, I have the constants created - // Mul the x constant to Position0 - XMVECTOR vResult = XM_PERMUTE_PS(T3, _MM_SHUFFLE(0, 0, 0, 0)); - vResult = _mm_mul_ps(vResult, Position0); - // Mul the y constant to Tangent0 - T2 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(1, 1, 1, 1)); - vResult = XM_FMADD_PS(T2, Tangent0, vResult); - // Mul the z constant to Position1 - T2 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(2, 2, 2, 2)); - vResult = XM_FMADD_PS(T2, Position1, vResult); - // Mul the w constant to Tangent1 - T3 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(3, 3, 3, 3)); - vResult = XM_FMADD_PS(T3, Tangent1, vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorCatmullRom -( - FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, - GXMVECTOR Position3, - float t -) noexcept -{ - // Result = ((-t^3 + 2 * t^2 - t) * Position0 + - // (3 * t^3 - 5 * t^2 + 2) * Position1 + - // (-3 * t^3 + 4 * t^2 + t) * Position2 + - // (t^3 - t^2) * Position3) * 0.5 - -#if defined(_XM_NO_INTRINSICS_) - - float t2 = t * t; - float t3 = t * t2; - - XMVECTOR P0 = XMVectorReplicate((-t3 + 2.0f * t2 - t) * 0.5f); - XMVECTOR P1 = XMVectorReplicate((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); - XMVECTOR P2 = XMVectorReplicate((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); - XMVECTOR P3 = XMVectorReplicate((t3 - t2) * 0.5f); - - XMVECTOR Result = XMVectorMultiply(P0, Position0); - Result = XMVectorMultiplyAdd(P1, Position1, Result); - Result = XMVectorMultiplyAdd(P2, Position2, Result); - Result = XMVectorMultiplyAdd(P3, Position3, Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float t2 = t * t; - float t3 = t * t2; - - float p0 = (-t3 + 2.0f * t2 - t) * 0.5f; - float p1 = (3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f; - float p2 = (-3.0f * t3 + 4.0f * t2 + t) * 0.5f; - float p3 = (t3 - t2) * 0.5f; - - XMVECTOR P1 = vmulq_n_f32(Position1, p1); - XMVECTOR P0 = vmlaq_n_f32(P1, Position0, p0); - XMVECTOR P3 = vmulq_n_f32(Position3, p3); - XMVECTOR P2 = vmlaq_n_f32(P3, Position2, p2); - P0 = vaddq_f32(P0, P2); - return P0; -#elif defined(_XM_SSE_INTRINSICS_) - float t2 = t * t; - float t3 = t * t2; - - XMVECTOR P0 = _mm_set_ps1((-t3 + 2.0f * t2 - t) * 0.5f); - XMVECTOR P1 = _mm_set_ps1((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); - XMVECTOR P2 = _mm_set_ps1((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); - XMVECTOR P3 = _mm_set_ps1((t3 - t2) * 0.5f); - - P1 = _mm_mul_ps(Position1, P1); - P0 = XM_FMADD_PS(Position0, P0, P1); - P3 = _mm_mul_ps(Position3, P3); - P2 = XM_FMADD_PS(Position2, P2, P3); - P0 = _mm_add_ps(P0, P2); - return P0; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorCatmullRomV -( - FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, - GXMVECTOR Position3, - HXMVECTOR T -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float fx = T.vector4_f32[0]; - float fy = T.vector4_f32[1]; - float fz = T.vector4_f32[2]; - float fw = T.vector4_f32[3]; - XMVECTORF32 vResult = { { { - 0.5f * ((-fx * fx * fx + 2 * fx * fx - fx) * Position0.vector4_f32[0] - + (3 * fx * fx * fx - 5 * fx * fx + 2) * Position1.vector4_f32[0] - + (-3 * fx * fx * fx + 4 * fx * fx + fx) * Position2.vector4_f32[0] - + (fx * fx * fx - fx * fx) * Position3.vector4_f32[0]), - - 0.5f * ((-fy * fy * fy + 2 * fy * fy - fy) * Position0.vector4_f32[1] - + (3 * fy * fy * fy - 5 * fy * fy + 2) * Position1.vector4_f32[1] - + (-3 * fy * fy * fy + 4 * fy * fy + fy) * Position2.vector4_f32[1] - + (fy * fy * fy - fy * fy) * Position3.vector4_f32[1]), - - 0.5f * ((-fz * fz * fz + 2 * fz * fz - fz) * Position0.vector4_f32[2] - + (3 * fz * fz * fz - 5 * fz * fz + 2) * Position1.vector4_f32[2] - + (-3 * fz * fz * fz + 4 * fz * fz + fz) * Position2.vector4_f32[2] - + (fz * fz * fz - fz * fz) * Position3.vector4_f32[2]), - - 0.5f * ((-fw * fw * fw + 2 * fw * fw - fw) * Position0.vector4_f32[3] - + (3 * fw * fw * fw - 5 * fw * fw + 2) * Position1.vector4_f32[3] - + (-3 * fw * fw * fw + 4 * fw * fw + fw) * Position2.vector4_f32[3] - + (fw * fw * fw - fw * fw) * Position3.vector4_f32[3]) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Catmul2 = { { { 2.0f, 2.0f, 2.0f, 2.0f } } }; - static const XMVECTORF32 Catmul3 = { { { 3.0f, 3.0f, 3.0f, 3.0f } } }; - static const XMVECTORF32 Catmul4 = { { { 4.0f, 4.0f, 4.0f, 4.0f } } }; - static const XMVECTORF32 Catmul5 = { { { 5.0f, 5.0f, 5.0f, 5.0f } } }; - // Cache T^2 and T^3 - XMVECTOR T2 = vmulq_f32(T, T); - XMVECTOR T3 = vmulq_f32(T, T2); - // Perform the Position0 term - XMVECTOR vResult = vaddq_f32(T2, T2); - vResult = vsubq_f32(vResult, T); - vResult = vsubq_f32(vResult, T3); - vResult = vmulq_f32(vResult, Position0); - // Perform the Position1 term and add - XMVECTOR vTemp = vmulq_f32(T3, Catmul3); - vTemp = vmlsq_f32(vTemp, T2, Catmul5); - vTemp = vaddq_f32(vTemp, Catmul2); - vResult = vmlaq_f32(vResult, vTemp, Position1); - // Perform the Position2 term and add - vTemp = vmulq_f32(T2, Catmul4); - vTemp = vmlsq_f32(vTemp, T3, Catmul3); - vTemp = vaddq_f32(vTemp, T); - vResult = vmlaq_f32(vResult, vTemp, Position2); - // Position3 is the last term - T3 = vsubq_f32(T3, T2); - vResult = vmlaq_f32(vResult, T3, Position3); - // Multiply by 0.5f and exit - vResult = vmulq_f32(vResult, g_XMOneHalf); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Catmul2 = { { { 2.0f, 2.0f, 2.0f, 2.0f } } }; - static const XMVECTORF32 Catmul3 = { { { 3.0f, 3.0f, 3.0f, 3.0f } } }; - static const XMVECTORF32 Catmul4 = { { { 4.0f, 4.0f, 4.0f, 4.0f } } }; - static const XMVECTORF32 Catmul5 = { { { 5.0f, 5.0f, 5.0f, 5.0f } } }; - // Cache T^2 and T^3 - XMVECTOR T2 = _mm_mul_ps(T, T); - XMVECTOR T3 = _mm_mul_ps(T, T2); - // Perform the Position0 term - XMVECTOR vResult = _mm_add_ps(T2, T2); - vResult = _mm_sub_ps(vResult, T); - vResult = _mm_sub_ps(vResult, T3); - vResult = _mm_mul_ps(vResult, Position0); - // Perform the Position1 term and add - XMVECTOR vTemp = _mm_mul_ps(T3, Catmul3); - vTemp = XM_FNMADD_PS(T2, Catmul5, vTemp); - vTemp = _mm_add_ps(vTemp, Catmul2); - vResult = XM_FMADD_PS(vTemp, Position1, vResult); - // Perform the Position2 term and add - vTemp = _mm_mul_ps(T2, Catmul4); - vTemp = XM_FNMADD_PS(T3, Catmul3, vTemp); - vTemp = _mm_add_ps(vTemp, T); - vResult = XM_FMADD_PS(vTemp, Position2, vResult); - // Position3 is the last term - T3 = _mm_sub_ps(T3, T2); - vResult = XM_FMADD_PS(T3, Position3, vResult); - // Multiply by 0.5f and exit - vResult = _mm_mul_ps(vResult, g_XMOneHalf); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorBaryCentric -( - FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, - float f, - float g -) noexcept -{ - // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR P10 = XMVectorSubtract(Position1, Position0); - XMVECTOR ScaleF = XMVectorReplicate(f); - - XMVECTOR P20 = XMVectorSubtract(Position2, Position0); - XMVECTOR ScaleG = XMVectorReplicate(g); - - XMVECTOR Result = XMVectorMultiplyAdd(P10, ScaleF, Position0); - Result = XMVectorMultiplyAdd(P20, ScaleG, Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR R1 = vsubq_f32(Position1, Position0); - XMVECTOR R2 = vsubq_f32(Position2, Position0); - R1 = vmlaq_n_f32(Position0, R1, f); - return vmlaq_n_f32(R1, R2, g); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR R1 = _mm_sub_ps(Position1, Position0); - XMVECTOR R2 = _mm_sub_ps(Position2, Position0); - XMVECTOR SF = _mm_set_ps1(f); - R1 = XM_FMADD_PS(R1, SF, Position0); - XMVECTOR SG = _mm_set_ps1(g); - return XM_FMADD_PS(R2, SG, R1); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVectorBaryCentricV -( - FXMVECTOR Position0, - FXMVECTOR Position1, - FXMVECTOR Position2, - GXMVECTOR F, - HXMVECTOR G -) noexcept -{ - // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR P10 = XMVectorSubtract(Position1, Position0); - XMVECTOR P20 = XMVectorSubtract(Position2, Position0); - - XMVECTOR Result = XMVectorMultiplyAdd(P10, F, Position0); - Result = XMVectorMultiplyAdd(P20, G, Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR R1 = vsubq_f32(Position1, Position0); - XMVECTOR R2 = vsubq_f32(Position2, Position0); - R1 = vmlaq_f32(Position0, R1, F); - return vmlaq_f32(R1, R2, G); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR R1 = _mm_sub_ps(Position1, Position0); - XMVECTOR R2 = _mm_sub_ps(Position2, Position0); - R1 = XM_FMADD_PS(R1, F, Position0); - return XM_FMADD_PS(R2, G, R1); -#endif -} - -/**************************************************************************** - * - * 2D Vector - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2Equal -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - // z and w are don't care - return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); -#endif -} - - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector2EqualR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - uint32_t CR = 0; - if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && - (V1.vector4_f32[1] == V2.vector4_f32[1])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && - (V1.vector4_f32[1] != V2.vector4_f32[1])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); - uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); - uint32_t CR = 0; - if (r == 0xFFFFFFFFFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - // z and w are don't care - int iTest = _mm_movemask_ps(vTemp) & 3; - uint32_t CR = 0; - if (iTest == 3) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2EqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3) == 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector2EqualIntR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - uint32_t CR = 0; - if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && - (V1.vector4_u32[1] == V2.vector4_u32[1])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && - (V1.vector4_u32[1] != V2.vector4_u32[1])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); - uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); - uint32_t CR = 0; - if (r == 0xFFFFFFFFFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - int iTest = _mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3; - uint32_t CR = 0; - if (iTest == 3) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2NearEqual -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR Epsilon -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); - float dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); - return ((dx <= Epsilon.vector4_f32[0]) && - (dy <= Epsilon.vector4_f32[1])); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t vDelta = vsub_f32(vget_low_f32(V1), vget_low_f32(V2)); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - uint32x2_t vTemp = vacle_f32(vDelta, vget_low_u32(Epsilon)); -#else - uint32x2_t vTemp = vcle_f32(vabs_f32(vDelta), vget_low_f32(Epsilon)); -#endif - uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); - return (r == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - // Get the difference - XMVECTOR vDelta = _mm_sub_ps(V1, V2); - // Get the absolute value of the difference - XMVECTOR vTemp = _mm_setzero_ps(); - vTemp = _mm_sub_ps(vTemp, vDelta); - vTemp = _mm_max_ps(vTemp, vDelta); - vTemp = _mm_cmple_ps(vTemp, Epsilon); - // z and w are don't care - return (((_mm_movemask_ps(vTemp) & 3) == 0x3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2NotEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - // z and w are don't care - return (((_mm_movemask_ps(vTemp) & 3) != 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2NotEqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3) != 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2Greater -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vcgt_f32(vget_low_f32(V1), vget_low_f32(V2)); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - // z and w are don't care - return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector2GreaterR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - uint32_t CR = 0; - if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && - (V1.vector4_f32[1] > V2.vector4_f32[1])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && - (V1.vector4_f32[1] <= V2.vector4_f32[1])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vcgt_f32(vget_low_f32(V1), vget_low_f32(V2)); - uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); - uint32_t CR = 0; - if (r == 0xFFFFFFFFFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - int iTest = _mm_movemask_ps(vTemp) & 3; - uint32_t CR = 0; - if (iTest == 3) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2GreaterOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vcge_f32(vget_low_f32(V1), vget_low_f32(V2)); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector2GreaterOrEqualR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - uint32_t CR = 0; - if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && - (V1.vector4_f32[1] >= V2.vector4_f32[1])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && - (V1.vector4_f32[1] < V2.vector4_f32[1])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vcge_f32(vget_low_f32(V1), vget_low_f32(V2)); - uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); - uint32_t CR = 0; - if (r == 0xFFFFFFFFFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - int iTest = _mm_movemask_ps(vTemp) & 3; - uint32_t CR = 0; - if (iTest == 3) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2Less -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vclt_f32(vget_low_f32(V1), vget_low_f32(V2)); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2LessOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vTemp = vcle_f32(vget_low_f32(V1), vget_low_f32(V2)); - return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmple_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2InBounds -( - FXMVECTOR V, - FXMVECTOR Bounds -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && - (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - float32x2_t B = vget_low_f32(Bounds); - // Test if less than or equal - uint32x2_t ivTemp1 = vcle_f32(VL, B); - // Negate the bounds - float32x2_t vTemp2 = vneg_f32(B); - // Test if greater or equal (Reversed) - uint32x2_t ivTemp2 = vcle_f32(vTemp2, VL); - // Blend answers - ivTemp1 = vand_u32(ivTemp1, ivTemp2); - // x and y in bounds? - return (vget_lane_u64(vreinterpret_u64_u32(ivTemp1), 0) == 0xFFFFFFFFFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - // Test if less than or equal - XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); - // Negate the bounds - XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); - // Test if greater or equal (Reversed) - vTemp2 = _mm_cmple_ps(vTemp2, V); - // Blend answers - vTemp1 = _mm_and_ps(vTemp1, vTemp2); - // x and y in bounds? (z and w are don't care) - return (((_mm_movemask_ps(vTemp1) & 0x3) == 0x3) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -inline bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (XMISNAN(V.vector4_f32[0]) || - XMISNAN(V.vector4_f32[1])); -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - return isnan(vgetq_lane_f32(V, 0)) || isnan(vgetq_lane_f32(V, 1)); -#else - float32x2_t VL = vget_low_f32(V); - // Test against itself. NaN is always not equal - uint32x2_t vTempNan = vceq_f32(VL, VL); - // If x or y are NaN, the mask is zero - return (vget_lane_u64(vreinterpret_u64_u32(vTempNan), 0) != 0xFFFFFFFFFFFFFFFFU); -#endif -#elif defined(_XM_SSE_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - XM_ALIGNED_DATA(16) float tmp[4]; - _mm_store_ps(tmp, V); - return isnan(tmp[0]) || isnan(tmp[1]); -#else -// Test against itself. NaN is always not equal - XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); - // If x or y are NaN, the mask is non-zero - return ((_mm_movemask_ps(vTempNan) & 3) != 0); -#endif -#endif -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(pop) -#endif - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector2IsInfinite(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - return (XMISINF(V.vector4_f32[0]) || - XMISINF(V.vector4_f32[1])); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Mask off the sign bit - uint32x2_t vTemp = vand_u32(vget_low_u32(vreinterpretq_u32_f32(V)), vget_low_u32(g_XMAbsMask)); - // Compare to infinity - vTemp = vceq_f32(vreinterpret_f32_u32(vTemp), vget_low_f32(g_XMInfinity)); - // If any are infinity, the signs are true. - return vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0; -#elif defined(_XM_SSE_INTRINSICS_) - // Mask off the sign bit - __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); - // Compare to infinity - vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); - // If x or z are infinity, the signs are true. - return ((_mm_movemask_ps(vTemp) & 3) != 0); -#endif -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Dot -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result; - Result.f[0] = - Result.f[1] = - Result.f[2] = - Result.f[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1]; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Perform the dot product on x and y - float32x2_t vTemp = vmul_f32(vget_low_f32(V1), vget_low_f32(V2)); - vTemp = vpadd_f32(vTemp, vTemp); - return vcombine_f32(vTemp, vTemp); -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_dp_ps(V1, V2, 0x3f); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vDot = _mm_mul_ps(V1, V2); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_moveldup_ps(vDot); - return vDot; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y - XMVECTOR vLengthSq = _mm_mul_ps(V1, V2); - // vTemp has y splatted - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - // x+y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Cross -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - // [ V1.x*V2.y - V1.y*V2.x, V1.x*V2.y - V1.y*V2.x ] - -#if defined(_XM_NO_INTRINSICS_) - float fCross = (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]); - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = fCross; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Negate = { { { 1.f, -1.f, 0, 0 } } }; - - float32x2_t vTemp = vmul_f32(vget_low_f32(V1), vrev64_f32(vget_low_f32(V2))); - vTemp = vmul_f32(vTemp, vget_low_f32(Negate)); - vTemp = vpadd_f32(vTemp, vTemp); - return vcombine_f32(vTemp, vTemp); -#elif defined(_XM_SSE_INTRINSICS_) - // Swap x and y - XMVECTOR vResult = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 1, 0, 1)); - // Perform the muls - vResult = _mm_mul_ps(vResult, V1); - // Splat y - XMVECTOR vTemp = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(1, 1, 1, 1)); - // Sub the values - vResult = _mm_sub_ss(vResult, vTemp); - // Splat the cross product - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 0, 0, 0)); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2LengthSq(FXMVECTOR V) noexcept -{ - return XMVector2Dot(V, V); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2ReciprocalLengthEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector2LengthSq(V); - Result = XMVectorReciprocalSqrtEst(Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - // Dot2 - float32x2_t vTemp = vmul_f32(VL, VL); - vTemp = vpadd_f32(vTemp, vTemp); - // Reciprocal sqrt (estimate) - vTemp = vrsqrte_f32(vTemp); - return vcombine_f32(vTemp, vTemp); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); - return _mm_rsqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_rsqrt_ss(vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has y splatted - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - // x+y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = _mm_rsqrt_ss(vLengthSq); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2ReciprocalLength(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector2LengthSq(V); - Result = XMVectorReciprocalSqrt(Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - // Dot2 - float32x2_t vTemp = vmul_f32(VL, VL); - vTemp = vpadd_f32(vTemp, vTemp); - // Reciprocal sqrt - float32x2_t S0 = vrsqrte_f32(vTemp); - float32x2_t P0 = vmul_f32(vTemp, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(vTemp, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t Result = vmul_f32(S1, R1); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); - XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); - return _mm_div_ps(g_XMOne, vLengthSq); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ss(vTemp); - vLengthSq = _mm_div_ss(g_XMOne, vLengthSq); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has y splatted - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - // x+y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = _mm_sqrt_ss(vLengthSq); - vLengthSq = _mm_div_ss(g_XMOne, vLengthSq); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2LengthEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector2LengthSq(V); - Result = XMVectorSqrtEst(Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - // Dot2 - float32x2_t vTemp = vmul_f32(VL, VL); - vTemp = vpadd_f32(vTemp, vTemp); - const float32x2_t zero = vdup_n_f32(0); - uint32x2_t VEqualsZero = vceq_f32(vTemp, zero); - // Sqrt (estimate) - float32x2_t Result = vrsqrte_f32(vTemp); - Result = vmul_f32(vTemp, Result); - Result = vbsl_f32(VEqualsZero, zero, Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); - return _mm_sqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ss(vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has y splatted - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - // x+y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = _mm_sqrt_ss(vLengthSq); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Length(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector2LengthSq(V); - Result = XMVectorSqrt(Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - // Dot2 - float32x2_t vTemp = vmul_f32(VL, VL); - vTemp = vpadd_f32(vTemp, vTemp); - const float32x2_t zero = vdup_n_f32(0); - uint32x2_t VEqualsZero = vceq_f32(vTemp, zero); - // Sqrt - float32x2_t S0 = vrsqrte_f32(vTemp); - float32x2_t P0 = vmul_f32(vTemp, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(vTemp, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t Result = vmul_f32(S1, R1); - Result = vmul_f32(vTemp, Result); - Result = vbsl_f32(VEqualsZero, zero, Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); - return _mm_sqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ss(vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has y splatted - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - // x+y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ -// XMVector2NormalizeEst uses a reciprocal estimate and -// returns QNaN on zero and infinite vectors. - -inline XMVECTOR XM_CALLCONV XMVector2NormalizeEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector2ReciprocalLength(V); - Result = XMVectorMultiply(V, Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - // Dot2 - float32x2_t vTemp = vmul_f32(VL, VL); - vTemp = vpadd_f32(vTemp, vTemp); - // Reciprocal sqrt (estimate) - vTemp = vrsqrte_f32(vTemp); - // Normalize - float32x2_t Result = vmul_f32(VL, vTemp); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); - XMVECTOR vResult = _mm_rsqrt_ps(vTemp); - return _mm_mul_ps(vResult, V); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_rsqrt_ss(vLengthSq); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - vLengthSq = _mm_mul_ps(vLengthSq, V); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has y splatted - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - // x+y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = _mm_rsqrt_ss(vLengthSq); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - vLengthSq = _mm_mul_ps(vLengthSq, V); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Normalize(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR vResult = XMVector2Length(V); - float fLength = vResult.vector4_f32[0]; - - // Prevent divide by zero - if (fLength > 0) - { - fLength = 1.0f / fLength; - } - - vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; - vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; - vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; - vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; - return vResult; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - // Dot2 - float32x2_t vTemp = vmul_f32(VL, VL); - vTemp = vpadd_f32(vTemp, vTemp); - uint32x2_t VEqualsZero = vceq_f32(vTemp, vdup_n_f32(0)); - uint32x2_t VEqualsInf = vceq_f32(vTemp, vget_low_f32(g_XMInfinity)); - // Reciprocal sqrt (2 iterations of Newton-Raphson) - float32x2_t S0 = vrsqrte_f32(vTemp); - float32x2_t P0 = vmul_f32(vTemp, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(vTemp, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - vTemp = vmul_f32(S1, R1); - // Normalize - float32x2_t Result = vmul_f32(VL, vTemp); - Result = vbsl_f32(VEqualsZero, vdup_n_f32(0), Result); - Result = vbsl_f32(VEqualsInf, vget_low_f32(g_XMQNaN), Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0x3f); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Reciprocal mul to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#elif defined(_XM_SSE3_INTRINSICS_) - // Perform the dot product on x and y only - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_moveldup_ps(vLengthSq); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Reciprocal mul to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x and y only - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Reciprocal mul to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2ClampLength -( - FXMVECTOR V, - float LengthMin, - float LengthMax -) noexcept -{ - XMVECTOR ClampMax = XMVectorReplicate(LengthMax); - XMVECTOR ClampMin = XMVectorReplicate(LengthMin); - return XMVector2ClampLengthV(V, ClampMin, ClampMax); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2ClampLengthV -( - FXMVECTOR V, - FXMVECTOR LengthMin, - FXMVECTOR LengthMax -) noexcept -{ - assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin))); - assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax))); - assert(XMVector2GreaterOrEqual(LengthMin, g_XMZero)); - assert(XMVector2GreaterOrEqual(LengthMax, g_XMZero)); - assert(XMVector2GreaterOrEqual(LengthMax, LengthMin)); - - XMVECTOR LengthSq = XMVector2LengthSq(V); - - const XMVECTOR Zero = XMVectorZero(); - - XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); - - XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); - XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); - - XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); - - XMVECTOR Normal = XMVectorMultiply(V, RcpLength); - - XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); - Length = XMVectorSelect(LengthSq, Length, Select); - Normal = XMVectorSelect(LengthSq, Normal, Select); - - XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); - XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); - - XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); - ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); - - XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); - - // Preserve the original vector (with no precision loss) if the length falls within the given range - XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); - Result = XMVectorSelect(Result, V, Control); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Reflect -( - FXMVECTOR Incident, - FXMVECTOR Normal -) noexcept -{ - // Result = Incident - (2 * dot(Incident, Normal)) * Normal - - XMVECTOR Result; - Result = XMVector2Dot(Incident, Normal); - Result = XMVectorAdd(Result, Result); - Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Refract -( - FXMVECTOR Incident, - FXMVECTOR Normal, - float RefractionIndex -) noexcept -{ - XMVECTOR Index = XMVectorReplicate(RefractionIndex); - return XMVector2RefractV(Incident, Normal, Index); -} - -//------------------------------------------------------------------------------ - -// Return the refraction of a 2D vector -inline XMVECTOR XM_CALLCONV XMVector2RefractV -( - FXMVECTOR Incident, - FXMVECTOR Normal, - FXMVECTOR RefractionIndex -) noexcept -{ - // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + - // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) - -#if defined(_XM_NO_INTRINSICS_) - - float IDotN = (Incident.vector4_f32[0] * Normal.vector4_f32[0]) + (Incident.vector4_f32[1] * Normal.vector4_f32[1]); - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - float RY = 1.0f - (IDotN * IDotN); - float RX = 1.0f - (RY * RefractionIndex.vector4_f32[0] * RefractionIndex.vector4_f32[0]); - RY = 1.0f - (RY * RefractionIndex.vector4_f32[1] * RefractionIndex.vector4_f32[1]); - if (RX >= 0.0f) - { - RX = (RefractionIndex.vector4_f32[0] * Incident.vector4_f32[0]) - (Normal.vector4_f32[0] * ((RefractionIndex.vector4_f32[0] * IDotN) + sqrtf(RX))); - } - else - { - RX = 0.0f; - } - if (RY >= 0.0f) - { - RY = (RefractionIndex.vector4_f32[1] * Incident.vector4_f32[1]) - (Normal.vector4_f32[1] * ((RefractionIndex.vector4_f32[1] * IDotN) + sqrtf(RY))); - } - else - { - RY = 0.0f; - } - - XMVECTOR vResult; - vResult.vector4_f32[0] = RX; - vResult.vector4_f32[1] = RY; - vResult.vector4_f32[2] = 0.0f; - vResult.vector4_f32[3] = 0.0f; - return vResult; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t IL = vget_low_f32(Incident); - float32x2_t NL = vget_low_f32(Normal); - float32x2_t RIL = vget_low_f32(RefractionIndex); - // Get the 2D Dot product of Incident-Normal - float32x2_t vTemp = vmul_f32(IL, NL); - float32x2_t IDotN = vpadd_f32(vTemp, vTemp); - // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - vTemp = vmls_f32(vget_low_f32(g_XMOne), IDotN, IDotN); - vTemp = vmul_f32(vTemp, RIL); - vTemp = vmls_f32(vget_low_f32(g_XMOne), vTemp, RIL); - // If any terms are <=0, sqrt() will fail, punt to zero - uint32x2_t vMask = vcgt_f32(vTemp, vget_low_f32(g_XMZero)); - // Sqrt(vTemp) - float32x2_t S0 = vrsqrte_f32(vTemp); - float32x2_t P0 = vmul_f32(vTemp, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(vTemp, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t S2 = vmul_f32(S1, R1); - vTemp = vmul_f32(vTemp, S2); - // R = RefractionIndex * IDotN + sqrt(R) - vTemp = vmla_f32(vTemp, RIL, IDotN); - // Result = RefractionIndex * Incident - Normal * R - float32x2_t vResult = vmul_f32(RIL, IL); - vResult = vmls_f32(vResult, vTemp, NL); - vResult = vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(vResult), vMask)); - return vcombine_f32(vResult, vResult); -#elif defined(_XM_SSE_INTRINSICS_) - // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + - // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) - // Get the 2D Dot product of Incident-Normal - XMVECTOR IDotN = XMVector2Dot(Incident, Normal); - // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - XMVECTOR vTemp = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); - vTemp = _mm_mul_ps(vTemp, RefractionIndex); - vTemp = XM_FNMADD_PS(vTemp, RefractionIndex, g_XMOne); - // If any terms are <=0, sqrt() will fail, punt to zero - XMVECTOR vMask = _mm_cmpgt_ps(vTemp, g_XMZero); - // R = RefractionIndex * IDotN + sqrt(R) - vTemp = _mm_sqrt_ps(vTemp); - vTemp = XM_FMADD_PS(RefractionIndex, IDotN, vTemp); - // Result = RefractionIndex * Incident - Normal * R - XMVECTOR vResult = _mm_mul_ps(RefractionIndex, Incident); - vResult = XM_FNMADD_PS(vTemp, Normal, vResult); - vResult = _mm_and_ps(vResult, vMask); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Orthogonal(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - -V.vector4_f32[1], - V.vector4_f32[0], - 0.f, - 0.f - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Negate = { { { -1.f, 1.f, 0, 0 } } }; - const float32x2_t zero = vdup_n_f32(0); - - float32x2_t VL = vget_low_f32(V); - float32x2_t Result = vmul_f32(vrev64_f32(VL), vget_low_f32(Negate)); - return vcombine_f32(Result, zero); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); - vResult = _mm_mul_ps(vResult, g_XMNegateX); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormalsEst -( - FXMVECTOR N1, - FXMVECTOR N2 -) noexcept -{ - XMVECTOR Result = XMVector2Dot(N1, N2); - Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); - Result = XMVectorACosEst(Result); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormals -( - FXMVECTOR N1, - FXMVECTOR N2 -) noexcept -{ - XMVECTOR Result = XMVector2Dot(N1, N2); - Result = XMVectorClamp(Result, g_XMNegativeOne, g_XMOne); - Result = XMVectorACos(Result); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenVectors -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - XMVECTOR L1 = XMVector2ReciprocalLength(V1); - XMVECTOR L2 = XMVector2ReciprocalLength(V2); - - XMVECTOR Dot = XMVector2Dot(V1, V2); - - L1 = XMVectorMultiply(L1, L2); - - XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); - CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); - - return XMVectorACos(CosAngle); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2LinePointDistance -( - FXMVECTOR LinePoint1, - FXMVECTOR LinePoint2, - FXMVECTOR Point -) noexcept -{ - // Given a vector PointVector from LinePoint1 to Point and a vector - // LineVector from LinePoint1 to LinePoint2, the scaled distance - // PointProjectionScale from LinePoint1 to the perpendicular projection - // of PointVector onto the line is defined as: - // - // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) - - XMVECTOR PointVector = XMVectorSubtract(Point, LinePoint1); - XMVECTOR LineVector = XMVectorSubtract(LinePoint2, LinePoint1); - - XMVECTOR LengthSq = XMVector2LengthSq(LineVector); - - XMVECTOR PointProjectionScale = XMVector2Dot(PointVector, LineVector); - PointProjectionScale = XMVectorDivide(PointProjectionScale, LengthSq); - - XMVECTOR DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); - DistanceVector = XMVectorSubtract(PointVector, DistanceVector); - - return XMVector2Length(DistanceVector); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2IntersectLine -( - FXMVECTOR Line1Point1, - FXMVECTOR Line1Point2, - FXMVECTOR Line2Point1, - GXMVECTOR Line2Point2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) - - XMVECTOR V1 = XMVectorSubtract(Line1Point2, Line1Point1); - XMVECTOR V2 = XMVectorSubtract(Line2Point2, Line2Point1); - XMVECTOR V3 = XMVectorSubtract(Line1Point1, Line2Point1); - - XMVECTOR C1 = XMVector2Cross(V1, V2); - XMVECTOR C2 = XMVector2Cross(V2, V3); - - XMVECTOR Result; - const XMVECTOR Zero = XMVectorZero(); - if (XMVector2NearEqual(C1, Zero, g_XMEpsilon.v)) - { - if (XMVector2NearEqual(C2, Zero, g_XMEpsilon.v)) - { - // Coincident - Result = g_XMInfinity.v; - } - else - { - // Parallel - Result = g_XMQNaN.v; - } - } - else - { - // Intersection point = Line1Point1 + V1 * (C2 / C1) - XMVECTOR Scale = XMVectorReciprocal(C1); - Scale = XMVectorMultiply(C2, Scale); - Result = XMVectorMultiplyAdd(V1, Scale, Line1Point1); - } - - return Result; - -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR V1 = _mm_sub_ps(Line1Point2, Line1Point1); - XMVECTOR V2 = _mm_sub_ps(Line2Point2, Line2Point1); - XMVECTOR V3 = _mm_sub_ps(Line1Point1, Line2Point1); - // Generate the cross products - XMVECTOR C1 = XMVector2Cross(V1, V2); - XMVECTOR C2 = XMVector2Cross(V2, V3); - // If C1 is not close to epsilon, use the calculated value - XMVECTOR vResultMask = _mm_setzero_ps(); - vResultMask = _mm_sub_ps(vResultMask, C1); - vResultMask = _mm_max_ps(vResultMask, C1); - // 0xFFFFFFFF if the calculated value is to be used - vResultMask = _mm_cmpgt_ps(vResultMask, g_XMEpsilon); - // If C1 is close to epsilon, which fail type is it? INFINITY or NAN? - XMVECTOR vFailMask = _mm_setzero_ps(); - vFailMask = _mm_sub_ps(vFailMask, C2); - vFailMask = _mm_max_ps(vFailMask, C2); - vFailMask = _mm_cmple_ps(vFailMask, g_XMEpsilon); - XMVECTOR vFail = _mm_and_ps(vFailMask, g_XMInfinity); - vFailMask = _mm_andnot_ps(vFailMask, g_XMQNaN); - // vFail is NAN or INF - vFail = _mm_or_ps(vFail, vFailMask); - // Intersection point = Line1Point1 + V1 * (C2 / C1) - XMVECTOR vResult = _mm_div_ps(C2, C1); - vResult = XM_FMADD_PS(vResult, V1, Line1Point1); - // Use result, or failure value - vResult = _mm_and_ps(vResult, vResultMask); - vResultMask = _mm_andnot_ps(vResultMask, vFail); - vResult = _mm_or_ps(vResult, vResultMask); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2Transform -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); - Result = XMVectorMultiplyAdd(X, M.r[0], Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - float32x4_t Result = vmlaq_lane_f32(M.r[3], M.r[1], VL, 1); // Y - return vmlaq_lane_f32(Result, M.r[0], VL, 0); // X -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y - vResult = XM_FMADD_PS(vResult, M.r[1], M.r[3]); - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X - vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream -( - XMFLOAT4* pOutputStream, - size_t OutputStride, - const XMFLOAT2* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT2)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); - - assert(OutputStride >= sizeof(XMFLOAT4)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Y, row1, row3); - Result = XMVectorMultiplyAdd(X, row0, Result); - - #ifdef _PREFAST_ - #pragma prefast(push) - #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) - #endif - - XMStoreFloat4(reinterpret_cast(pOutputVector), Result); - - #ifdef _PREFAST_ - #pragma prefast(pop) - #endif - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT4))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - float32x2_t r3 = vget_low_f32(row3); - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M - XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N - - XM_PREFETCH(pInputVector); - - r3 = vget_high_f32(row3); - r = vget_high_f32(row0); - XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O - XMVECTOR vResult3 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(row1); - vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O - vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - float32x4x4_t R; - R.val[0] = vResult0; - R.val[1] = vResult1; - R.val[2] = vResult2; - R.val[3] = vResult3; - - vst4q_f32(reinterpret_cast(pOutputVector), R); - pOutputVector += sizeof(XMFLOAT4) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vResult = vmlaq_lane_f32(row3, row0, V, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y - - vst1q_f32(reinterpret_cast(pOutputVector), vResult); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_AVX2_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - __m256 row0 = _mm256_broadcast_ps(&M.r[0]); - __m256 row1 = _mm256_broadcast_ps(&M.r[1]); - __m256 row3 = _mm256_broadcast_ps(&M.r[3]); - - if (InputStride == sizeof(XMFLOAT2)) - { - if (OutputStride == sizeof(XMFLOAT4)) - { - if (!(reinterpret_cast(pOutputStream) & 0x1F)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); - __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); - __m256 vTempA = _mm256_mul_ps(X1, row0); - __m256 vTempA2 = _mm256_mul_ps(X2, row0); - vTempA = _mm256_add_ps(vTempA, vTempB); - vTempA2 = _mm256_add_ps(vTempA2, vTempB2); - - X1 = _mm256_insertf128_ps(vTempA, _mm256_castps256_ps128(vTempA2), 1); - XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); - pOutputVector += sizeof(XMFLOAT4) * 2; - - X2 = _mm256_insertf128_ps(vTempA2, _mm256_extractf128_ps(vTempA, 1), 0); - XM256_STREAM_PS(reinterpret_cast(pOutputVector), X2); - pOutputVector += sizeof(XMFLOAT4) * 2; - - i += 4; - } - } - else - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); - __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); - __m256 vTempA = _mm256_mul_ps(X1, row0); - __m256 vTempA2 = _mm256_mul_ps(X2, row0); - vTempA = _mm256_add_ps(vTempA, vTempB); - vTempA2 = _mm256_add_ps(vTempA2, vTempB2); - - X1 = _mm256_insertf128_ps(vTempA, _mm256_castps256_ps128(vTempA2), 1); - _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); - pOutputVector += sizeof(XMFLOAT4) * 2; - - X2 = _mm256_insertf128_ps(vTempA2, _mm256_extractf128_ps(vTempA, 1), 0); - _mm256_storeu_ps(reinterpret_cast(pOutputVector), X2); - pOutputVector += sizeof(XMFLOAT4) * 2; - - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); - __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); - __m256 vTempA = _mm256_mul_ps(X1, row0); - __m256 vTempA2 = _mm256_mul_ps(X2, row0); - vTempA = _mm256_add_ps(vTempA, vTempB); - vTempA2 = _mm256_add_ps(vTempA2, vTempB2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempA)); - pOutputVector += OutputStride; - - _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempA2)); - pOutputVector += OutputStride; - - _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempA, 1)); - pOutputVector += OutputStride; - - _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempA2, 1)); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - if (i < VectorCount) - { - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - for (; i < VectorCount; i++) - { - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t two = VectorCount >> 1; - if (two > 0) - { - if (InputStride == sizeof(XMFLOAT2)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) - { - // Packed input, aligned output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = XM_FMADD_PS(Y, row1, row3); - vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 2; - } - } - else - { - // Packed input, unaligned output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = XM_FMADD_PS(Y, row1, row3); - vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 2; - } - } - } - } - - if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) - { - // Aligned input, aligned output - for (; i < VectorCount; i++) - { - XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - } - else - { - // Aligned input, unaligned output - for (; i < VectorCount; i++) - { - XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - } - } - else - { - // Unaligned input - for (; i < VectorCount; i++) - { - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2TransformCoord -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); - Result = XMVectorMultiplyAdd(X, M.r[0], Result); - - XMVECTOR W = XMVectorSplatW(Result); - return XMVectorDivide(Result, W); -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream -( - XMFLOAT2* pOutputStream, - size_t OutputStride, - const XMFLOAT2* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT2)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); - - assert(OutputStride >= sizeof(XMFLOAT2)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT2)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Y, row1, row3); - Result = XMVectorMultiplyAdd(X, row0, Result); - - XMVECTOR W = XMVectorSplatW(Result); - - Result = XMVectorDivide(Result, W); - - #ifdef _PREFAST_ - #pragma prefast(push) - #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) - #endif - - XMStoreFloat2(reinterpret_cast(pOutputVector), Result); - - #ifdef _PREFAST_ - #pragma prefast(pop) - #endif - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT2))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - float32x2_t r3 = vget_low_f32(row3); - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M - XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N - - XM_PREFETCH(pInputVector); - - r3 = vget_high_f32(row3); - r = vget_high_f32(row0); - XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(row1); - W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - V.val[0] = vdivq_f32(vResult0, W); - V.val[1] = vdivq_f32(vResult1, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - V.val[0] = vmulq_f32(vResult0, Reciprocal); - V.val[1] = vmulq_f32(vResult1, Reciprocal); - #endif - - vst2q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT2) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vResult = vmlaq_lane_f32(row3, row0, V, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y - - V = vget_high_f32(vResult); - float32x2_t W = vdup_lane_f32(V, 1); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - V = vget_low_f32(vResult); - V = vdiv_f32(V, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal for W - float32x2_t Reciprocal = vrecpe_f32(W); - float32x2_t S = vrecps_f32(Reciprocal, W); - Reciprocal = vmul_f32(S, Reciprocal); - S = vrecps_f32(Reciprocal, W); - Reciprocal = vmul_f32(S, Reciprocal); - - V = vget_low_f32(vResult); - V = vmul_f32(V, Reciprocal); - #endif - - vst1_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_AVX2_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - __m256 row0 = _mm256_broadcast_ps(&M.r[0]); - __m256 row1 = _mm256_broadcast_ps(&M.r[1]); - __m256 row3 = _mm256_broadcast_ps(&M.r[3]); - - if (InputStride == sizeof(XMFLOAT2)) - { - if (OutputStride == sizeof(XMFLOAT2)) - { - if (!(reinterpret_cast(pOutputStream) & 0x1F)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); - __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); - __m256 vTempA = _mm256_mul_ps(X1, row0); - __m256 vTempA2 = _mm256_mul_ps(X2, row0); - vTempA = _mm256_add_ps(vTempA, vTempB); - vTempA2 = _mm256_add_ps(vTempA2, vTempB2); - - __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); - vTempA = _mm256_div_ps(vTempA, W); - - W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); - vTempA2 = _mm256_div_ps(vTempA2, W); - - X1 = _mm256_shuffle_ps(vTempA, vTempA2, 0x44); - XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); - pOutputVector += sizeof(XMFLOAT2) * 4; - - i += 4; - } - } - else - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); - __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); - __m256 vTempA = _mm256_mul_ps(X1, row0); - __m256 vTempA2 = _mm256_mul_ps(X2, row0); - vTempA = _mm256_add_ps(vTempA, vTempB); - vTempA2 = _mm256_add_ps(vTempA2, vTempB2); - - __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); - vTempA = _mm256_div_ps(vTempA, W); - - W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); - vTempA2 = _mm256_div_ps(vTempA2, W); - - X1 = _mm256_shuffle_ps(vTempA, vTempA2, 0x44); - _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); - pOutputVector += sizeof(XMFLOAT2) * 4; - - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); - __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); - __m256 vTempA = _mm256_mul_ps(X1, row0); - __m256 vTempA2 = _mm256_mul_ps(X2, row0); - vTempA = _mm256_add_ps(vTempA, vTempB); - vTempA2 = _mm256_add_ps(vTempA2, vTempB2); - - __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); - vTempA = _mm256_div_ps(vTempA, W); - - W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); - vTempA2 = _mm256_div_ps(vTempA2, W); - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_castps256_ps128(vTempA))); - pOutputVector += OutputStride; - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_castps256_ps128(vTempA2))); - pOutputVector += OutputStride; - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_extractf128_ps(vTempA, 1))); - pOutputVector += OutputStride; - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_extractf128_ps(vTempA2, 1))); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - if (i < VectorCount) - { - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - for (; i < VectorCount; i++) - { - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t two = VectorCount >> 1; - if (two > 0) - { - if (InputStride == sizeof(XMFLOAT2)) - { - if (OutputStride == sizeof(XMFLOAT2)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - // Result 1 - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - XMVECTOR V1 = _mm_div_ps(vTemp, W); - - // Result 2 - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = XM_FMADD_PS(Y, row1, row3); - vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - XMVECTOR V2 = _mm_div_ps(vTemp, W); - - vTemp = _mm_movelh_ps(V1, V2); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += sizeof(XMFLOAT2) * 2; - - i += 2; - } - } - else - { - // Packed input, unaligned & packed output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - // Result 1 - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - XMVECTOR V1 = _mm_div_ps(vTemp, W); - - // Result 2 - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = XM_FMADD_PS(Y, row1, row3); - vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - XMVECTOR V2 = _mm_div_ps(vTemp, W); - - vTemp = _mm_movelh_ps(V1, V2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += sizeof(XMFLOAT2) * 2; - - i += 2; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - // Result 1 - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - - // Result 2 - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = XM_FMADD_PS(Y, row1, row3); - vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - - i += 2; - } - } - } - } - - if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) - { - // Aligned input - for (; i < VectorCount; i++) - { - XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - } - } - else - { - // Unaligned input - for (; i < VectorCount; i++) - { - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); - XMVECTOR vTemp2 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector2TransformNormal -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiply(Y, M.r[1]); - Result = XMVectorMultiplyAdd(X, M.r[0], Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - float32x4_t Result = vmulq_lane_f32(M.r[1], VL, 1); // Y - return vmlaq_lane_f32(Result, M.r[0], VL, 0); // X -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y - vResult = _mm_mul_ps(vResult, M.r[1]); - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X - vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream -( - XMFLOAT2* pOutputStream, - size_t OutputStride, - const XMFLOAT2* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT2)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); - - assert(OutputStride >= sizeof(XMFLOAT2)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT2)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiply(Y, row1); - Result = XMVectorMultiplyAdd(X, row0, Result); - - #ifdef _PREFAST_ - #pragma prefast(push) - #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) - #endif - - XMStoreFloat2(reinterpret_cast(pOutputVector), Result); - - #ifdef _PREFAST_ - #pragma prefast(pop) - #endif - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT2))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax - XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx - - XM_PREFETCH(pInputVector); - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - V.val[0] = vResult0; - V.val[1] = vResult1; - - vst2q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT2) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vResult = vmulq_lane_f32(row0, V, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y - - V = vget_low_f32(vResult); - vst1_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_AVX2_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - __m256 row0 = _mm256_broadcast_ps(&M.r[0]); - __m256 row1 = _mm256_broadcast_ps(&M.r[1]); - - if (InputStride == sizeof(XMFLOAT2)) - { - if (OutputStride == sizeof(XMFLOAT2)) - { - if (!(reinterpret_cast(pOutputStream) & 0x1F)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempA = _mm256_mul_ps(Y1, row1); - __m256 vTempB = _mm256_mul_ps(Y2, row1); - vTempA = _mm256_fmadd_ps(X1, row0, vTempA); - vTempB = _mm256_fmadd_ps(X2, row0, vTempB); - - X1 = _mm256_shuffle_ps(vTempA, vTempB, 0x44); - XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); - pOutputVector += sizeof(XMFLOAT2) * 4; - - i += 4; - } - } - else - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempA = _mm256_mul_ps(Y1, row1); - __m256 vTempB = _mm256_mul_ps(Y2, row1); - vTempA = _mm256_fmadd_ps(X1, row0, vTempA); - vTempB = _mm256_fmadd_ps(X2, row0, vTempB); - - X1 = _mm256_shuffle_ps(vTempA, vTempB, 0x44); - _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); - pOutputVector += sizeof(XMFLOAT2) * 4; - - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 4; - - __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - - __m256 vTempA = _mm256_mul_ps(Y1, row1); - __m256 vTempB = _mm256_mul_ps(Y2, row1); - vTempA = _mm256_fmadd_ps(X1, row0, vTempA); - vTempB = _mm256_fmadd_ps(X2, row0, vTempB); - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_castps256_ps128(vTempA))); - pOutputVector += OutputStride; - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_castps256_ps128(vTempB))); - pOutputVector += OutputStride; - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_extractf128_ps(vTempA, 1))); - pOutputVector += OutputStride; - - _mm_store_sd(reinterpret_cast(pOutputVector), - _mm_castps_pd(_mm256_extractf128_ps(vTempB, 1))); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - if (i < VectorCount) - { - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - - for (; i < VectorCount; i++) - { - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Y, row1); - vTemp = XM_FMADD_PS(X, row0, vTemp); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - - size_t i = 0; - size_t two = VectorCount >> 1; - if (two > 0) - { - if (InputStride == sizeof(XMFLOAT2)) - { - if (OutputStride == sizeof(XMFLOAT2)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - // Result 1 - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Y, row1); - XMVECTOR V1 = XM_FMADD_PS(X, row0, vTemp); - - // Result 2 - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = _mm_mul_ps(Y, row1); - XMVECTOR V2 = XM_FMADD_PS(X, row0, vTemp); - - vTemp = _mm_movelh_ps(V1, V2); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += sizeof(XMFLOAT2) * 2; - - i += 2; - } - } - else - { - // Packed input, unaligned & packed output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - // Result 1 - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Y, row1); - XMVECTOR V1 = XM_FMADD_PS(X, row0, vTemp); - - // Result 2 - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = _mm_mul_ps(Y, row1); - XMVECTOR V2 = XM_FMADD_PS(X, row0, vTemp); - - vTemp = _mm_movelh_ps(V1, V2); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += sizeof(XMFLOAT2) * 2; - - i += 2; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < two; ++j) - { - XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT2) * 2; - - // Result 1 - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Y, row1); - vTemp = XM_FMADD_PS(X, row0, vTemp); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - - // Result 2 - Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - - vTemp = _mm_mul_ps(Y, row1); - vTemp = XM_FMADD_PS(X, row0, vTemp); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - - i += 2; - } - } - } - } - - if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) - { - // Aligned input - for (; i < VectorCount; i++) - { - XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Y, row1); - vTemp = XM_FMADD_PS(X, row0, vTemp); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - } - } - else - { - // Unaligned input - for (; i < VectorCount; i++) - { - __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); - pInputVector += InputStride; - - XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Y, row1); - vTemp = XM_FMADD_PS(X, row0, vTemp); - - _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -/**************************************************************************** - * - * 3D Vector - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3Equal -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector3EqualR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t CR = 0; - if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && - (V1.vector4_f32[1] == V2.vector4_f32[1]) && - (V1.vector4_f32[2] == V2.vector4_f32[2])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && - (V1.vector4_f32[1] != V2.vector4_f32[1]) && - (V1.vector4_f32[2] != V2.vector4_f32[2])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; - - uint32_t CR = 0; - if (r == 0xFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - int iTest = _mm_movemask_ps(vTemp) & 7; - uint32_t CR = 0; - if (iTest == 7) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3EqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7) == 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector3EqualIntR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t CR = 0; - if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && - (V1.vector4_u32[1] == V2.vector4_u32[1]) && - (V1.vector4_u32[2] == V2.vector4_u32[2])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && - (V1.vector4_u32[1] != V2.vector4_u32[1]) && - (V1.vector4_u32[2] != V2.vector4_u32[2])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; - - uint32_t CR = 0; - if (r == 0xFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - int iTemp = _mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7; - uint32_t CR = 0; - if (iTemp == 7) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTemp) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3NearEqual -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR Epsilon -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float dx, dy, dz; - - dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); - dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); - dz = fabsf(V1.vector4_f32[2] - V2.vector4_f32[2]); - return (((dx <= Epsilon.vector4_f32[0]) && - (dy <= Epsilon.vector4_f32[1]) && - (dz <= Epsilon.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vDelta = vsubq_f32(V1, V2); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - uint32x4_t vResult = vacleq_f32(vDelta, Epsilon); -#else - uint32x4_t vResult = vcleq_f32(vabsq_f32(vDelta), Epsilon); -#endif - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - // Get the difference - XMVECTOR vDelta = _mm_sub_ps(V1, V2); - // Get the absolute value of the difference - XMVECTOR vTemp = _mm_setzero_ps(); - vTemp = _mm_sub_ps(vTemp, vDelta); - vTemp = _mm_max_ps(vTemp, vDelta); - vTemp = _mm_cmple_ps(vTemp, Epsilon); - // w is don't care - return (((_mm_movemask_ps(vTemp) & 7) == 0x7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3NotEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 7) != 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3NotEqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7) != 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3Greater -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgtq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector3GreaterR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t CR = 0; - if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && - (V1.vector4_f32[1] > V2.vector4_f32[1]) && - (V1.vector4_f32[2] > V2.vector4_f32[2])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && - (V1.vector4_f32[1] <= V2.vector4_f32[1]) && - (V1.vector4_f32[2] <= V2.vector4_f32[2])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgtq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; - - uint32_t CR = 0; - if (r == 0xFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - uint32_t CR = 0; - int iTest = _mm_movemask_ps(vTemp) & 7; - if (iTest == 7) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3GreaterOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgeq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector3GreaterOrEqualR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - uint32_t CR = 0; - if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && - (V1.vector4_f32[1] >= V2.vector4_f32[1]) && - (V1.vector4_f32[2] >= V2.vector4_f32[2])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && - (V1.vector4_f32[1] < V2.vector4_f32[1]) && - (V1.vector4_f32[2] < V2.vector4_f32[2])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgeq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; - - uint32_t CR = 0; - if (r == 0xFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - uint32_t CR = 0; - int iTest = _mm_movemask_ps(vTemp) & 7; - if (iTest == 7) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3Less -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcltq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3LessOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcleq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmple_ps(V1, V2); - return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3InBounds -( - FXMVECTOR V, - FXMVECTOR Bounds -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && - (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && - (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Test if less than or equal - uint32x4_t ivTemp1 = vcleq_f32(V, Bounds); - // Negate the bounds - float32x4_t vTemp2 = vnegq_f32(Bounds); - // Test if greater or equal (Reversed) - uint32x4_t ivTemp2 = vcleq_f32(vTemp2, V); - // Blend answers - ivTemp1 = vandq_u32(ivTemp1, ivTemp2); - // in bounds? - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(ivTemp1)), vget_high_u8(vreinterpretq_u8_u32(ivTemp1))); - uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - // Test if less than or equal - XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); - // Negate the bounds - XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); - // Test if greater or equal (Reversed) - vTemp2 = _mm_cmple_ps(vTemp2, V); - // Blend answers - vTemp1 = _mm_and_ps(vTemp1, vTemp2); - // x,y and z in bounds? (w is don't care) - return (((_mm_movemask_ps(vTemp1) & 0x7) == 0x7) != 0); -#else - return XMComparisonAllInBounds(XMVector3InBoundsR(V, Bounds)); -#endif -} - -//------------------------------------------------------------------------------ - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -inline bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - return (XMISNAN(V.vector4_f32[0]) || - XMISNAN(V.vector4_f32[1]) || - XMISNAN(V.vector4_f32[2])); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - return isnan(vgetq_lane_f32(V, 0)) || isnan(vgetq_lane_f32(V, 1)) || isnan(vgetq_lane_f32(V, 2)); -#else -// Test against itself. NaN is always not equal - uint32x4_t vTempNan = vceqq_f32(V, V); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempNan)), vget_high_u8(vreinterpretq_u8_u32(vTempNan))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - // If x or y or z are NaN, the mask is zero - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); -#endif -#elif defined(_XM_SSE_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - XM_ALIGNED_DATA(16) float tmp[4]; - _mm_store_ps(tmp, V); - return isnan(tmp[0]) || isnan(tmp[1]) || isnan(tmp[2]); -#else -// Test against itself. NaN is always not equal - XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); - // If x or y or z are NaN, the mask is non-zero - return ((_mm_movemask_ps(vTempNan) & 7) != 0); -#endif -#endif -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(pop) -#endif - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector3IsInfinite(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (XMISINF(V.vector4_f32[0]) || - XMISINF(V.vector4_f32[1]) || - XMISINF(V.vector4_f32[2])); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Mask off the sign bit - uint32x4_t vTempInf = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - // Compare to infinity - vTempInf = vceqq_f32(vreinterpretq_f32_u32(vTempInf), g_XMInfinity); - // If any are infinity, the signs are true. - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempInf)), vget_high_u8(vreinterpretq_u8_u32(vTempInf))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Mask off the sign bit - __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); - // Compare to infinity - vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); - // If x,y or z are infinity, the signs are true. - return ((_mm_movemask_ps(vTemp) & 7) != 0); -#endif -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Dot -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float fValue = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2]; - XMVECTORF32 vResult; - vResult.f[0] = - vResult.f[1] = - vResult.f[2] = - vResult.f[3] = fValue; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vTemp = vmulq_f32(V1, V2); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - return vcombine_f32(v1, v1); -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_dp_ps(V1, V2, 0x7f); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vTemp = _mm_mul_ps(V1, V2); - vTemp = _mm_and_ps(vTemp, g_XMMask3); - vTemp = _mm_hadd_ps(vTemp, vTemp); - return _mm_hadd_ps(vTemp, vTemp); -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product - XMVECTOR vDot = _mm_mul_ps(V1, V2); - // x=Dot.vector4_f32[1], y=Dot.vector4_f32[2] - XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); - // Result.vector4_f32[0] = x+y - vDot = _mm_add_ss(vDot, vTemp); - // x=Dot.vector4_f32[2] - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // Result.vector4_f32[0] = (x+y)+z - vDot = _mm_add_ss(vDot, vTemp); - // Splat x - return XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Cross -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - // [ V1.y*V2.z - V1.z*V2.y, V1.z*V2.x - V1.x*V2.z, V1.x*V2.y - V1.y*V2.x ] - -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - (V1.vector4_f32[1] * V2.vector4_f32[2]) - (V1.vector4_f32[2] * V2.vector4_f32[1]), - (V1.vector4_f32[2] * V2.vector4_f32[0]) - (V1.vector4_f32[0] * V2.vector4_f32[2]), - (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]), - 0.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t v1xy = vget_low_f32(V1); - float32x2_t v2xy = vget_low_f32(V2); - - float32x2_t v1yx = vrev64_f32(v1xy); - float32x2_t v2yx = vrev64_f32(v2xy); - - float32x2_t v1zz = vdup_lane_f32(vget_high_f32(V1), 0); - float32x2_t v2zz = vdup_lane_f32(vget_high_f32(V2), 0); - - XMVECTOR vResult = vmulq_f32(vcombine_f32(v1yx, v1xy), vcombine_f32(v2zz, v2yx)); - vResult = vmlsq_f32(vResult, vcombine_f32(v1zz, v1yx), vcombine_f32(v2yx, v2xy)); - vResult = vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(vResult), g_XMFlipY)); - return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vResult), g_XMMask3)); -#elif defined(_XM_SSE_INTRINSICS_) - // y1,z1,x1,w1 - XMVECTOR vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(3, 0, 2, 1)); - // z2,x2,y2,w2 - XMVECTOR vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(3, 1, 0, 2)); - // Perform the left operation - XMVECTOR vResult = _mm_mul_ps(vTemp1, vTemp2); - // z1,x1,y1,w1 - vTemp1 = XM_PERMUTE_PS(vTemp1, _MM_SHUFFLE(3, 0, 2, 1)); - // y2,z2,x2,w2 - vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(3, 1, 0, 2)); - // Perform the right operation - vResult = XM_FNMADD_PS(vTemp1, vTemp2, vResult); - // Set w to zero - return _mm_and_ps(vResult, g_XMMask3); -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3LengthSq(FXMVECTOR V) noexcept -{ - return XMVector3Dot(V, V); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3ReciprocalLengthEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector3LengthSq(V); - Result = XMVectorReciprocalSqrtEst(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot3 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - // Reciprocal sqrt (estimate) - v2 = vrsqrte_f32(v1); - return vcombine_f32(v2, v2); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); - return _mm_rsqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_rsqrt_ps(vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y and z - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and y - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); - // x+z, y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - // y,y,y,y - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // x+z+y,??,??,?? - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - // Splat the length squared - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - // Get the reciprocal - vLengthSq = _mm_rsqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3ReciprocalLength(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector3LengthSq(V); - Result = XMVectorReciprocalSqrt(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot3 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - // Reciprocal sqrt - float32x2_t S0 = vrsqrte_f32(v1); - float32x2_t P0 = vmul_f32(v1, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(v1, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t Result = vmul_f32(S1, R1); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); - XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); - return _mm_div_ps(g_XMOne, vLengthSq); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vDot = _mm_mul_ps(V, V); - vDot = _mm_and_ps(vDot, g_XMMask3); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_sqrt_ps(vDot); - vDot = _mm_div_ps(g_XMOne, vDot); - return vDot; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product - XMVECTOR vDot = _mm_mul_ps(V, V); - // x=Dot.y, y=Dot.z - XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); - // Result.x = x+y - vDot = _mm_add_ss(vDot, vTemp); - // x=Dot.z - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // Result.x = (x+y)+z - vDot = _mm_add_ss(vDot, vTemp); - // Splat x - vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); - // Get the reciprocal - vDot = _mm_sqrt_ps(vDot); - // Get the reciprocal - vDot = _mm_div_ps(g_XMOne, vDot); - return vDot; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3LengthEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector3LengthSq(V); - Result = XMVectorSqrtEst(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot3 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - const float32x2_t zero = vdup_n_f32(0); - uint32x2_t VEqualsZero = vceq_f32(v1, zero); - // Sqrt (estimate) - float32x2_t Result = vrsqrte_f32(v1); - Result = vmul_f32(v1, Result); - Result = vbsl_f32(VEqualsZero, zero, Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); - return _mm_sqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y and z - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and y - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); - // x+z, y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - // y,y,y,y - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // x+z+y,??,??,?? - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - // Splat the length squared - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - // Get the length - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Length(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector3LengthSq(V); - Result = XMVectorSqrt(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot3 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - const float32x2_t zero = vdup_n_f32(0); - uint32x2_t VEqualsZero = vceq_f32(v1, zero); - // Sqrt - float32x2_t S0 = vrsqrte_f32(v1); - float32x2_t P0 = vmul_f32(v1, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(v1, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t Result = vmul_f32(S1, R1); - Result = vmul_f32(v1, Result); - Result = vbsl_f32(VEqualsZero, zero, Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); - return _mm_sqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y and z - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and y - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); - // x+z, y - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - // y,y,y,y - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // x+z+y,??,??,?? - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - // Splat the length squared - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - // Get the length - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ -// XMVector3NormalizeEst uses a reciprocal estimate and -// returns QNaN on zero and infinite vectors. - -inline XMVECTOR XM_CALLCONV XMVector3NormalizeEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector3ReciprocalLength(V); - Result = XMVectorMultiply(V, Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot3 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - // Reciprocal sqrt (estimate) - v2 = vrsqrte_f32(v1); - // Normalize - return vmulq_f32(V, vcombine_f32(v2, v2)); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); - XMVECTOR vResult = _mm_rsqrt_ps(vTemp); - return _mm_mul_ps(vResult, V); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vDot = _mm_mul_ps(V, V); - vDot = _mm_and_ps(vDot, g_XMMask3); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_rsqrt_ps(vDot); - vDot = _mm_mul_ps(vDot, V); - return vDot; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product - XMVECTOR vDot = _mm_mul_ps(V, V); - // x=Dot.y, y=Dot.z - XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); - // Result.x = x+y - vDot = _mm_add_ss(vDot, vTemp); - // x=Dot.z - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - // Result.x = (x+y)+z - vDot = _mm_add_ss(vDot, vTemp); - // Splat x - vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); - // Get the reciprocal - vDot = _mm_rsqrt_ps(vDot); - // Perform the normalization - vDot = _mm_mul_ps(vDot, V); - return vDot; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Normalize(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float fLength; - XMVECTOR vResult; - - vResult = XMVector3Length(V); - fLength = vResult.vector4_f32[0]; - - // Prevent divide by zero - if (fLength > 0) - { - fLength = 1.0f / fLength; - } - - vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; - vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; - vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; - vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; - return vResult; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot3 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vpadd_f32(v1, v1); - v2 = vdup_lane_f32(v2, 0); - v1 = vadd_f32(v1, v2); - uint32x2_t VEqualsZero = vceq_f32(v1, vdup_n_f32(0)); - uint32x2_t VEqualsInf = vceq_f32(v1, vget_low_f32(g_XMInfinity)); - // Reciprocal sqrt (2 iterations of Newton-Raphson) - float32x2_t S0 = vrsqrte_f32(v1); - float32x2_t P0 = vmul_f32(v1, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(v1, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - v2 = vmul_f32(S1, R1); - // Normalize - XMVECTOR vResult = vmulq_f32(V, vcombine_f32(v2, v2)); - vResult = vbslq_f32(vcombine_u32(VEqualsZero, VEqualsZero), vdupq_n_f32(0), vResult); - return vbslq_f32(vcombine_u32(VEqualsInf, VEqualsInf), g_XMQNaN, vResult); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0x7f); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Divide to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#elif defined(_XM_SSE3_INTRINSICS_) - // Perform the dot product on x,y and z only - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Divide to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y and z only - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 1, 2, 1)); - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); - vLengthSq = _mm_add_ss(vLengthSq, vTemp); - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Divide to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3ClampLength -( - FXMVECTOR V, - float LengthMin, - float LengthMax -) noexcept -{ - XMVECTOR ClampMax = XMVectorReplicate(LengthMax); - XMVECTOR ClampMin = XMVectorReplicate(LengthMin); - - return XMVector3ClampLengthV(V, ClampMin, ClampMax); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3ClampLengthV -( - FXMVECTOR V, - FXMVECTOR LengthMin, - FXMVECTOR LengthMax -) noexcept -{ - assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin))); - assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax))); - assert(XMVector3GreaterOrEqual(LengthMin, XMVectorZero())); - assert(XMVector3GreaterOrEqual(LengthMax, XMVectorZero())); - assert(XMVector3GreaterOrEqual(LengthMax, LengthMin)); - - XMVECTOR LengthSq = XMVector3LengthSq(V); - - const XMVECTOR Zero = XMVectorZero(); - - XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); - - XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); - XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); - - XMVECTOR Normal = XMVectorMultiply(V, RcpLength); - - XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); - - XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); - Length = XMVectorSelect(LengthSq, Length, Select); - Normal = XMVectorSelect(LengthSq, Normal, Select); - - XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); - XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); - - XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); - ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); - - XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); - - // Preserve the original vector (with no precision loss) if the length falls within the given range - XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); - Result = XMVectorSelect(Result, V, Control); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Reflect -( - FXMVECTOR Incident, - FXMVECTOR Normal -) noexcept -{ - // Result = Incident - (2 * dot(Incident, Normal)) * Normal - - XMVECTOR Result = XMVector3Dot(Incident, Normal); - Result = XMVectorAdd(Result, Result); - Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Refract -( - FXMVECTOR Incident, - FXMVECTOR Normal, - float RefractionIndex -) noexcept -{ - XMVECTOR Index = XMVectorReplicate(RefractionIndex); - return XMVector3RefractV(Incident, Normal, Index); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3RefractV -( - FXMVECTOR Incident, - FXMVECTOR Normal, - FXMVECTOR RefractionIndex -) noexcept -{ - // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + - // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) - -#if defined(_XM_NO_INTRINSICS_) - - const XMVECTOR Zero = XMVectorZero(); - - XMVECTOR IDotN = XMVector3Dot(Incident, Normal); - - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - XMVECTOR R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); - R = XMVectorMultiply(R, RefractionIndex); - R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); - - if (XMVector4LessOrEqual(R, Zero)) - { - // Total internal reflection - return Zero; - } - else - { - // R = RefractionIndex * IDotN + sqrt(R) - R = XMVectorSqrt(R); - R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); - - // Result = RefractionIndex * Incident - Normal * R - XMVECTOR Result = XMVectorMultiply(RefractionIndex, Incident); - Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); - - return Result; - } - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR IDotN = XMVector3Dot(Incident, Normal); - - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - float32x4_t R = vmlsq_f32(g_XMOne, IDotN, IDotN); - R = vmulq_f32(R, RefractionIndex); - R = vmlsq_f32(g_XMOne, R, RefractionIndex); - - uint32x4_t isrzero = vcleq_f32(R, g_XMZero); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(isrzero)), vget_high_u8(vreinterpretq_u8_u32(isrzero))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - - float32x4_t vResult; - if (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU) - { - // Total internal reflection - vResult = g_XMZero; - } - else - { - // Sqrt(R) - float32x4_t S0 = vrsqrteq_f32(R); - float32x4_t P0 = vmulq_f32(R, S0); - float32x4_t R0 = vrsqrtsq_f32(P0, S0); - float32x4_t S1 = vmulq_f32(S0, R0); - float32x4_t P1 = vmulq_f32(R, S1); - float32x4_t R1 = vrsqrtsq_f32(P1, S1); - float32x4_t S2 = vmulq_f32(S1, R1); - R = vmulq_f32(R, S2); - // R = RefractionIndex * IDotN + sqrt(R) - R = vmlaq_f32(R, RefractionIndex, IDotN); - // Result = RefractionIndex * Incident - Normal * R - vResult = vmulq_f32(RefractionIndex, Incident); - vResult = vmlsq_f32(vResult, R, Normal); - } - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + - // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) - XMVECTOR IDotN = XMVector3Dot(Incident, Normal); - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - XMVECTOR R = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); - XMVECTOR R2 = _mm_mul_ps(RefractionIndex, RefractionIndex); - R = XM_FNMADD_PS(R, R2, g_XMOne); - - XMVECTOR vResult = _mm_cmple_ps(R, g_XMZero); - if (_mm_movemask_ps(vResult) == 0x0f) - { - // Total internal reflection - vResult = g_XMZero; - } - else - { - // R = RefractionIndex * IDotN + sqrt(R) - R = _mm_sqrt_ps(R); - R = XM_FMADD_PS(RefractionIndex, IDotN, R); - // Result = RefractionIndex * Incident - Normal * R - vResult = _mm_mul_ps(RefractionIndex, Incident); - vResult = XM_FNMADD_PS(R, Normal, vResult); - } - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Orthogonal(FXMVECTOR V) noexcept -{ - XMVECTOR Zero = XMVectorZero(); - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR YZYY = XMVectorSwizzle(V); - - XMVECTOR NegativeV = XMVectorSubtract(Zero, V); - - XMVECTOR ZIsNegative = XMVectorLess(Z, Zero); - XMVECTOR YZYYIsNegative = XMVectorLess(YZYY, Zero); - - XMVECTOR S = XMVectorAdd(YZYY, Z); - XMVECTOR D = XMVectorSubtract(YZYY, Z); - - XMVECTOR Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); - - XMVECTOR R0 = XMVectorPermute(NegativeV, S); - XMVECTOR R1 = XMVectorPermute(V, D); - - return XMVectorSelect(R1, R0, Select); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormalsEst -( - FXMVECTOR N1, - FXMVECTOR N2 -) noexcept -{ - XMVECTOR Result = XMVector3Dot(N1, N2); - Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); - Result = XMVectorACosEst(Result); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormals -( - FXMVECTOR N1, - FXMVECTOR N2 -) noexcept -{ - XMVECTOR Result = XMVector3Dot(N1, N2); - Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); - Result = XMVectorACos(Result); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenVectors -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - XMVECTOR L1 = XMVector3ReciprocalLength(V1); - XMVECTOR L2 = XMVector3ReciprocalLength(V2); - - XMVECTOR Dot = XMVector3Dot(V1, V2); - - L1 = XMVectorMultiply(L1, L2); - - XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); - CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); - - return XMVectorACos(CosAngle); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3LinePointDistance -( - FXMVECTOR LinePoint1, - FXMVECTOR LinePoint2, - FXMVECTOR Point -) noexcept -{ - // Given a vector PointVector from LinePoint1 to Point and a vector - // LineVector from LinePoint1 to LinePoint2, the scaled distance - // PointProjectionScale from LinePoint1 to the perpendicular projection - // of PointVector onto the line is defined as: - // - // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) - - XMVECTOR PointVector = XMVectorSubtract(Point, LinePoint1); - XMVECTOR LineVector = XMVectorSubtract(LinePoint2, LinePoint1); - - XMVECTOR LengthSq = XMVector3LengthSq(LineVector); - - XMVECTOR PointProjectionScale = XMVector3Dot(PointVector, LineVector); - PointProjectionScale = XMVectorDivide(PointProjectionScale, LengthSq); - - XMVECTOR DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); - DistanceVector = XMVectorSubtract(PointVector, DistanceVector); - - return XMVector3Length(DistanceVector); -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline void XM_CALLCONV XMVector3ComponentsFromNormal -( - XMVECTOR* pParallel, - XMVECTOR* pPerpendicular, - FXMVECTOR V, - FXMVECTOR Normal -) noexcept -{ - assert(pParallel != nullptr); - assert(pPerpendicular != nullptr); - - XMVECTOR Scale = XMVector3Dot(V, Normal); - - XMVECTOR Parallel = XMVectorMultiply(Normal, Scale); - - *pParallel = Parallel; - *pPerpendicular = XMVectorSubtract(V, Parallel); -} - -//------------------------------------------------------------------------------ -// Transform a vector using a rotation expressed as a unit quaternion - -inline XMVECTOR XM_CALLCONV XMVector3Rotate -( - FXMVECTOR V, - FXMVECTOR RotationQuaternion -) noexcept -{ - XMVECTOR A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); - XMVECTOR Q = XMQuaternionConjugate(RotationQuaternion); - XMVECTOR Result = XMQuaternionMultiply(Q, A); - return XMQuaternionMultiply(Result, RotationQuaternion); -} - -//------------------------------------------------------------------------------ -// Transform a vector using the inverse of a rotation expressed as a unit quaternion - -inline XMVECTOR XM_CALLCONV XMVector3InverseRotate -( - FXMVECTOR V, - FXMVECTOR RotationQuaternion -) noexcept -{ - XMVECTOR A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); - XMVECTOR Result = XMQuaternionMultiply(RotationQuaternion, A); - XMVECTOR Q = XMQuaternionConjugate(RotationQuaternion); - return XMQuaternionMultiply(Result, Q); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Transform -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); - Result = XMVectorMultiplyAdd(Y, M.r[1], Result); - Result = XMVectorMultiplyAdd(X, M.r[0], Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - XMVECTOR vResult = vmlaq_lane_f32(M.r[3], M.r[0], VL, 0); // X - vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y - return vmlaq_lane_f32(vResult, M.r[2], vget_high_f32(V), 0); // Z -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z - vResult = XM_FMADD_PS(vResult, M.r[2], M.r[3]); - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y - vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); - vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X - vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) -#endif - -_Use_decl_annotations_ -inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream -( - XMFLOAT4* pOutputStream, - size_t OutputStride, - const XMFLOAT3* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); - - assert(OutputStride >= sizeof(XMFLOAT4)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Z, row2, row3); - Result = XMVectorMultiplyAdd(Y, row1, Result); - Result = XMVectorMultiplyAdd(X, row0, Result); - - XMStoreFloat4(reinterpret_cast(pOutputVector), Result); - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT4))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT3) * 4; - - float32x2_t r3 = vget_low_f32(row3); - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M - XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N - - XM_PREFETCH(pInputVector); - - r3 = vget_high_f32(row3); - r = vget_high_f32(row0); - XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O - XMVECTOR vResult3 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(row1); - vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O - vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - r = vget_low_f32(row2); - vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); - - r = vget_high_f32(row2); - vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O - vResult3 = vmlaq_lane_f32(vResult3, V.val[2], r, 1); // Dx+Hy+Lz+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); - - float32x4x4_t R; - R.val[0] = vResult0; - R.val[1] = vResult1; - R.val[2] = vResult2; - R.val[3] = vResult3; - - vst4q_f32(reinterpret_cast(pOutputVector), R); - pOutputVector += sizeof(XMFLOAT4) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); - float32x2_t zero = vdup_n_f32(0); - float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); - pInputVector += InputStride; - - XMVECTOR vResult = vmlaq_lane_f32(row3, row0, VL, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y - vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z - - vst1q_f32(reinterpret_cast(pOutputVector), vResult); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(XMFLOAT3)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) - { - // Packed input, aligned output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 4; - } - } - else - { - // Packed input, unaligned output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) - { - // Aligned output - for (; i < VectorCount; ++i) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - } - else - { - // Unaligned output - for (; i < VectorCount; ++i) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3TransformCoord -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); - Result = XMVectorMultiplyAdd(Y, M.r[1], Result); - Result = XMVectorMultiplyAdd(X, M.r[0], Result); - - XMVECTOR W = XMVectorSplatW(Result); - return XMVectorDivide(Result, W); -} - -//------------------------------------------------------------------------------ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) -#endif - -_Use_decl_annotations_ -inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream -( - XMFLOAT3* pOutputStream, - size_t OutputStride, - const XMFLOAT3* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); - - assert(OutputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiplyAdd(Z, row2, row3); - Result = XMVectorMultiplyAdd(Y, row1, Result); - Result = XMVectorMultiplyAdd(X, row0, Result); - - XMVECTOR W = XMVectorSplatW(Result); - - Result = XMVectorDivide(Result, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), Result); - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT3) * 4; - - float32x2_t r3 = vget_low_f32(row3); - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M - XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N - - XM_PREFETCH(pInputVector); - - r3 = vget_high_f32(row3); - r = vget_high_f32(row0); - XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O - XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(row1); - vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O - W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - r = vget_low_f32(row2); - vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); - - r = vget_high_f32(row2); - vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O - W = vmlaq_lane_f32(W, V.val[2], r, 1); // Dx+Hy+Lz+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - V.val[0] = vdivq_f32(vResult0, W); - V.val[1] = vdivq_f32(vResult1, W); - V.val[2] = vdivq_f32(vResult2, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - V.val[0] = vmulq_f32(vResult0, Reciprocal); - V.val[1] = vmulq_f32(vResult1, Reciprocal); - V.val[2] = vmulq_f32(vResult2, Reciprocal); - #endif - - vst3q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT3) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); - float32x2_t zero = vdup_n_f32(0); - float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); - pInputVector += InputStride; - - XMVECTOR vResult = vmlaq_lane_f32(row3, row0, VL, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y - vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z - - VH = vget_high_f32(vResult); - XMVECTOR W = vdupq_lane_f32(VH, 1); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - vResult = vdivq_f32(vResult, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal for W - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - vResult = vmulq_f32(vResult, Reciprocal); - #endif - - VL = vget_low_f32(vResult); - vst1_f32(reinterpret_cast(pOutputVector), VL); - vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(XMFLOAT3)) - { - if (OutputStride == sizeof(XMFLOAT3)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V1 = _mm_div_ps(vTemp, W); - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V2 = _mm_div_ps(vTemp, W); - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V3 = _mm_div_ps(vTemp, W); - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V4 = _mm_div_ps(vTemp, W); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - else - { - // Packed input, unaligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V1 = _mm_div_ps(vTemp, W); - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V2 = _mm_div_ps(vTemp, W); - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V3 = _mm_div_ps(vTemp, W); - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - V4 = _mm_div_ps(vTemp, W); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, row2, row3); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - for (; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - - vTemp = _mm_div_ps(vTemp, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3TransformNormal -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiply(Z, M.r[2]); - Result = XMVectorMultiplyAdd(Y, M.r[1], Result); - Result = XMVectorMultiplyAdd(X, M.r[0], Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - XMVECTOR vResult = vmulq_lane_f32(M.r[0], VL, 0); // X - vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y - return vmlaq_lane_f32(vResult, M.r[2], vget_high_f32(V), 0); // Z -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z - vResult = _mm_mul_ps(vResult, M.r[2]); - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y - vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); - vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X - vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) -#endif - -_Use_decl_annotations_ -inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream -( - XMFLOAT3* pOutputStream, - size_t OutputStride, - const XMFLOAT3* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); - - assert(OutputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiply(Z, row2); - Result = XMVectorMultiplyAdd(Y, row1, Result); - Result = XMVectorMultiplyAdd(X, row0, Result); - - XMStoreFloat3(reinterpret_cast(pOutputVector), Result); - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT3) * 4; - - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax - XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx - - XM_PREFETCH(pInputVector); - - r = vget_high_f32(row0); - XMVECTOR vResult2 = vmulq_lane_f32(V.val[0], r, 0); // Cx - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(row1); - vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - r = vget_low_f32(row2); - vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz - vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); - - r = vget_high_f32(row2); - vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); - - V.val[0] = vResult0; - V.val[1] = vResult1; - V.val[2] = vResult2; - - vst3q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT3) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); - float32x2_t zero = vdup_n_f32(0); - float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); - pInputVector += InputStride; - - XMVECTOR vResult = vmulq_lane_f32(row0, VL, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y - vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z - - VL = vget_low_f32(vResult); - vst1_f32(reinterpret_cast(pOutputVector), VL); - vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(XMFLOAT3)) - { - if (OutputStride == sizeof(XMFLOAT3)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Z, row2); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V1 = _mm_add_ps(vTemp, vTemp3); - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V2 = _mm_add_ps(vTemp, vTemp3); - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V3 = _mm_add_ps(vTemp, vTemp3); - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V4 = _mm_add_ps(vTemp, vTemp3); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - else - { - // Packed input, unaligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Z, row2); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V1 = _mm_add_ps(vTemp, vTemp3); - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V2 = _mm_add_ps(vTemp, vTemp3); - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V3 = _mm_add_ps(vTemp, vTemp3); - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - V4 = _mm_add_ps(vTemp, vTemp3); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Z, row2); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = _mm_mul_ps(Z, row2); - vTemp2 = _mm_mul_ps(Y, row1); - vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - for (; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = _mm_mul_ps(Z, row2); - XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); - XMVECTOR vTemp3 = _mm_mul_ps(X, row0); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Project -( - FXMVECTOR V, - float ViewportX, - float ViewportY, - float ViewportWidth, - float ViewportHeight, - float ViewportMinZ, - float ViewportMaxZ, - FXMMATRIX Projection, - CXMMATRIX View, - CXMMATRIX World -) noexcept -{ - const float HalfViewportWidth = ViewportWidth * 0.5f; - const float HalfViewportHeight = ViewportHeight * 0.5f; - - XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 0.0f); - XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - - XMVECTOR Result = XMVector3TransformCoord(V, Transform); - - Result = XMVectorMultiplyAdd(Result, Scale, Offset); - - return Result; -} - -//------------------------------------------------------------------------------ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) -#endif - -_Use_decl_annotations_ -inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream -( - XMFLOAT3* pOutputStream, - size_t OutputStride, - const XMFLOAT3* pInputStream, - size_t InputStride, - size_t VectorCount, - float ViewportX, - float ViewportY, - float ViewportWidth, - float ViewportHeight, - float ViewportMinZ, - float ViewportMaxZ, - FXMMATRIX Projection, - CXMMATRIX View, - CXMMATRIX World -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); - - assert(OutputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); - -#if defined(_XM_NO_INTRINSICS_) - - const float HalfViewportWidth = ViewportWidth * 0.5f; - const float HalfViewportHeight = ViewportHeight * 0.5f; - - XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); - XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - - XMVECTOR Result = XMVector3TransformCoord(V, Transform); - Result = XMVectorMultiplyAdd(Result, Scale, Offset); - - XMStoreFloat3(reinterpret_cast(pOutputVector), Result); - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - const float HalfViewportWidth = ViewportWidth * 0.5f; - const float HalfViewportHeight = ViewportHeight * 0.5f; - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) - { - XMVECTOR ScaleX = vdupq_n_f32(HalfViewportWidth); - XMVECTOR ScaleY = vdupq_n_f32(-HalfViewportHeight); - XMVECTOR ScaleZ = vdupq_n_f32(ViewportMaxZ - ViewportMinZ); - - XMVECTOR OffsetX = vdupq_n_f32(ViewportX + HalfViewportWidth); - XMVECTOR OffsetY = vdupq_n_f32(ViewportY + HalfViewportHeight); - XMVECTOR OffsetZ = vdupq_n_f32(ViewportMinZ); - - for (size_t j = 0; j < four; ++j) - { - float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT3) * 4; - - float32x2_t r3 = vget_low_f32(Transform.r[3]); - float32x2_t r = vget_low_f32(Transform.r[0]); - XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M - XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N - - XM_PREFETCH(pInputVector); - - r3 = vget_high_f32(Transform.r[3]); - r = vget_high_f32(Transform.r[0]); - XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O - XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(Transform.r[1]); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(Transform.r[1]); - vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O - W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - r = vget_low_f32(Transform.r[2]); - vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M - vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); - - r = vget_high_f32(Transform.r[2]); - vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O - W = vmlaq_lane_f32(W, V.val[2], r, 1); // Dx+Hy+Lz+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - vResult0 = vdivq_f32(vResult0, W); - vResult1 = vdivq_f32(vResult1, W); - vResult2 = vdivq_f32(vResult2, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - vResult0 = vmulq_f32(vResult0, Reciprocal); - vResult1 = vmulq_f32(vResult1, Reciprocal); - vResult2 = vmulq_f32(vResult2, Reciprocal); - #endif - - V.val[0] = vmlaq_f32(OffsetX, vResult0, ScaleX); - V.val[1] = vmlaq_f32(OffsetY, vResult1, ScaleY); - V.val[2] = vmlaq_f32(OffsetZ, vResult2, ScaleZ); - - vst3q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT3) * 4; - - i += 4; - } - } - } - - if (i < VectorCount) - { - XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); - XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); - - for (; i < VectorCount; i++) - { - float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); - float32x2_t zero = vdup_n_f32(0); - float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); - pInputVector += InputStride; - - XMVECTOR vResult = vmlaq_lane_f32(Transform.r[3], Transform.r[0], VL, 0); // X - vResult = vmlaq_lane_f32(vResult, Transform.r[1], VL, 1); // Y - vResult = vmlaq_lane_f32(vResult, Transform.r[2], VH, 0); // Z - - VH = vget_high_f32(vResult); - XMVECTOR W = vdupq_lane_f32(VH, 1); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - vResult = vdivq_f32(vResult, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal for W - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - vResult = vmulq_f32(vResult, Reciprocal); - #endif - - vResult = vmlaq_f32(Offset, vResult, Scale); - - VL = vget_low_f32(vResult); - vst1_f32(reinterpret_cast(pOutputVector), VL); - vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); - pOutputVector += OutputStride; - } - } - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - const float HalfViewportWidth = ViewportWidth * 0.5f; - const float HalfViewportHeight = ViewportHeight * 0.5f; - - XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); - XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(XMFLOAT3)) - { - if (OutputStride == sizeof(XMFLOAT3)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V1 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V2 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V3 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V4 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - else - { - // Packed input, unaligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V1 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V2 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V3 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - V4 = XM_FMADD_PS(vTemp, Scale, Offset); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - vTemp = XM_FMADD_PS(vTemp, Scale, Offset); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 2 - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - vTemp = XM_FMADD_PS(vTemp, Scale, Offset); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 3 - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - vTemp = XM_FMADD_PS(vTemp, Scale, Offset); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 4 - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - vTemp = XM_FMADD_PS(vTemp, Scale, Offset); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - for (; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - vTemp = XM_FMADD_PS(vTemp, Scale, Offset); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector3Unproject -( - FXMVECTOR V, - float ViewportX, - float ViewportY, - float ViewportWidth, - float ViewportHeight, - float ViewportMinZ, - float ViewportMaxZ, - FXMMATRIX Projection, - CXMMATRIX View, - CXMMATRIX World -) noexcept -{ - static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; - - XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); - Scale = XMVectorReciprocal(Scale); - - XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); - Offset = XMVectorMultiplyAdd(Scale, Offset, D.v); - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - Transform = XMMatrixInverse(nullptr, Transform); - - XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); - - return XMVector3TransformCoord(Result, Transform); -} - -//------------------------------------------------------------------------------ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) -#endif - -_Use_decl_annotations_ -inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream -( - XMFLOAT3* pOutputStream, - size_t OutputStride, - const XMFLOAT3* pInputStream, - size_t InputStride, - size_t VectorCount, - float ViewportX, - float ViewportY, - float ViewportWidth, - float ViewportHeight, - float ViewportMinZ, - float ViewportMaxZ, - FXMMATRIX Projection, - CXMMATRIX View, - CXMMATRIX World -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); - - assert(OutputStride >= sizeof(XMFLOAT3)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); - -#if defined(_XM_NO_INTRINSICS_) - - static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; - - XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); - Scale = XMVectorReciprocal(Scale); - - XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); - Offset = XMVectorMultiplyAdd(Scale, Offset, D.v); - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - Transform = XMMatrixInverse(nullptr, Transform); - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - - XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); - - Result = XMVector3TransformCoord(Result, Transform); - - XMStoreFloat3(reinterpret_cast(pOutputVector), Result); - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - Transform = XMMatrixInverse(nullptr, Transform); - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - float sx = 1.f / (ViewportWidth * 0.5f); - float sy = 1.f / (-ViewportHeight * 0.5f); - float sz = 1.f / (ViewportMaxZ - ViewportMinZ); - - float ox = (-ViewportX * sx) - 1.f; - float oy = (-ViewportY * sy) + 1.f; - float oz = (-ViewportMinZ * sz); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT3) * 4; - - XMVECTOR ScaleX = vdupq_n_f32(sx); - XMVECTOR OffsetX = vdupq_n_f32(ox); - XMVECTOR VX = vmlaq_f32(OffsetX, ScaleX, V.val[0]); - - float32x2_t r3 = vget_low_f32(Transform.r[3]); - float32x2_t r = vget_low_f32(Transform.r[0]); - XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), VX, r, 0); // Ax+M - XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), VX, r, 1); // Bx+N - - XM_PREFETCH(pInputVector); - - r3 = vget_high_f32(Transform.r[3]); - r = vget_high_f32(Transform.r[0]); - XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), VX, r, 0); // Cx+O - XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), VX, r, 1); // Dx+P - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - XMVECTOR ScaleY = vdupq_n_f32(sy); - XMVECTOR OffsetY = vdupq_n_f32(oy); - XMVECTOR VY = vmlaq_f32(OffsetY, ScaleY, V.val[1]); - - r = vget_low_f32(Transform.r[1]); - vResult0 = vmlaq_lane_f32(vResult0, VY, r, 0); // Ax+Ey+M - vResult1 = vmlaq_lane_f32(vResult1, VY, r, 1); // Bx+Fy+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(Transform.r[1]); - vResult2 = vmlaq_lane_f32(vResult2, VY, r, 0); // Cx+Gy+O - W = vmlaq_lane_f32(W, VY, r, 1); // Dx+Hy+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - XMVECTOR ScaleZ = vdupq_n_f32(sz); - XMVECTOR OffsetZ = vdupq_n_f32(oz); - XMVECTOR VZ = vmlaq_f32(OffsetZ, ScaleZ, V.val[2]); - - r = vget_low_f32(Transform.r[2]); - vResult0 = vmlaq_lane_f32(vResult0, VZ, r, 0); // Ax+Ey+Iz+M - vResult1 = vmlaq_lane_f32(vResult1, VZ, r, 1); // Bx+Fy+Jz+N - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); - - r = vget_high_f32(Transform.r[2]); - vResult2 = vmlaq_lane_f32(vResult2, VZ, r, 0); // Cx+Gy+Kz+O - W = vmlaq_lane_f32(W, VZ, r, 1); // Dx+Hy+Lz+P - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - V.val[0] = vdivq_f32(vResult0, W); - V.val[1] = vdivq_f32(vResult1, W); - V.val[2] = vdivq_f32(vResult2, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - V.val[0] = vmulq_f32(vResult0, Reciprocal); - V.val[1] = vmulq_f32(vResult1, Reciprocal); - V.val[2] = vmulq_f32(vResult2, Reciprocal); - #endif - - vst3q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT3) * 4; - - i += 4; - } - } - } - - if (i < VectorCount) - { - float32x2_t ScaleL = vcreate_f32( - static_cast(*reinterpret_cast(&sx)) - | (static_cast(*reinterpret_cast(&sy)) << 32)); - float32x2_t ScaleH = vcreate_f32(static_cast(*reinterpret_cast(&sz))); - - float32x2_t OffsetL = vcreate_f32( - static_cast(*reinterpret_cast(&ox)) - | (static_cast(*reinterpret_cast(&oy)) << 32)); - float32x2_t OffsetH = vcreate_f32(static_cast(*reinterpret_cast(&oz))); - - for (; i < VectorCount; i++) - { - float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); - float32x2_t zero = vdup_n_f32(0); - float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); - pInputVector += InputStride; - - VL = vmla_f32(OffsetL, VL, ScaleL); - VH = vmla_f32(OffsetH, VH, ScaleH); - - XMVECTOR vResult = vmlaq_lane_f32(Transform.r[3], Transform.r[0], VL, 0); // X - vResult = vmlaq_lane_f32(vResult, Transform.r[1], VL, 1); // Y - vResult = vmlaq_lane_f32(vResult, Transform.r[2], VH, 0); // Z - - VH = vget_high_f32(vResult); - XMVECTOR W = vdupq_lane_f32(VH, 1); - - #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ - vResult = vdivq_f32(vResult, W); - #else - // 2 iterations of Newton-Raphson refinement of reciprocal for W - float32x4_t Reciprocal = vrecpeq_f32(W); - float32x4_t S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - S = vrecpsq_f32(Reciprocal, W); - Reciprocal = vmulq_f32(S, Reciprocal); - - vResult = vmulq_f32(vResult, Reciprocal); - #endif - - VL = vget_low_f32(vResult); - vst1_f32(reinterpret_cast(pOutputVector), VL); - vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); - pOutputVector += OutputStride; - } - } - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; - - XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); - Scale = XMVectorReciprocal(Scale); - - XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); - Offset = _mm_mul_ps(Scale, Offset); - Offset = _mm_add_ps(Offset, D); - - XMMATRIX Transform = XMMatrixMultiply(World, View); - Transform = XMMatrixMultiply(Transform, Projection); - Transform = XMMatrixInverse(nullptr, Transform); - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(XMFLOAT3)) - { - if (OutputStride == sizeof(XMFLOAT3)) - { - if (!(reinterpret_cast(pOutputStream) & 0xF)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - V1 = XM_FMADD_PS(V1, Scale, Offset); - - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V1 = _mm_div_ps(vTemp, W); - - // Result 2 - V2 = XM_FMADD_PS(V2, Scale, Offset); - - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V2 = _mm_div_ps(vTemp, W); - - // Result 3 - V3 = XM_FMADD_PS(V3, Scale, Offset); - - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V3 = _mm_div_ps(vTemp, W); - - // Result 4 - V4 = XM_FMADD_PS(V4, Scale, Offset); - - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V4 = _mm_div_ps(vTemp, W); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); - XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - else - { - // Packed input, unaligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - V1 = XM_FMADD_PS(V1, Scale, Offset); - - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V1 = _mm_div_ps(vTemp, W); - - // Result 2 - V2 = XM_FMADD_PS(V2, Scale, Offset); - - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V2 = _mm_div_ps(vTemp, W); - - // Result 3 - V3 = XM_FMADD_PS(V3, Scale, Offset); - - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V3 = _mm_div_ps(vTemp, W); - - // Result 4 - V4 = XM_FMADD_PS(V4, Scale, Offset); - - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - V4 = _mm_div_ps(vTemp, W); - - // Pack and store the vectors - XM3PACK4INTO3(vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); - _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); - pOutputVector += sizeof(XMFLOAT3) * 4; - i += 4; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < four; ++j) - { - __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); - __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); - __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); - pInputVector += sizeof(XMFLOAT3) * 4; - - // Unpack the 4 vectors (.w components are junk) - XM3UNPACK3INTO4(V1, L2, L3); - - // Result 1 - V1 = XM_FMADD_PS(V1, Scale, Offset); - - XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 2 - V2 = XM_FMADD_PS(V2, Scale, Offset); - - Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 3 - V3 = XM_FMADD_PS(V3, Scale, Offset); - - Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - // Result 4 - V4 = XM_FMADD_PS(V4, Scale, Offset); - - Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); - Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); - X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); - - vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - - i += 4; - } - } - } - } - - for (; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - V = _mm_mul_ps(V, Scale); - V = _mm_add_ps(V, Offset); - - XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - - XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); - XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); - XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); - vTemp = _mm_add_ps(vTemp, vTemp2); - vTemp = _mm_add_ps(vTemp, vTemp3); - - XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); - vTemp = _mm_div_ps(vTemp, W); - - XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); - pOutputVector += OutputStride; - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -/**************************************************************************** - * - * 4D Vector - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ -// Comparison operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4Equal -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2]) && (V1.vector4_f32[3] == V2.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); -#else - return XMComparisonAllTrue(XMVector4EqualR(V1, V2)); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector4EqualR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - uint32_t CR = 0; - - if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && - (V1.vector4_f32[1] == V2.vector4_f32[1]) && - (V1.vector4_f32[2] == V2.vector4_f32[2]) && - (V1.vector4_f32[3] == V2.vector4_f32[3])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && - (V1.vector4_f32[1] != V2.vector4_f32[1]) && - (V1.vector4_f32[2] != V2.vector4_f32[2]) && - (V1.vector4_f32[3] != V2.vector4_f32[3])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); - int iTest = _mm_movemask_ps(vTemp); - uint32_t CR = 0; - if (iTest == 0xf) // All equal? - { - CR = XM_CRMASK_CR6TRUE; - } - else if (iTest == 0) // All not equal? - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4EqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2]) && (V1.vector4_u32[3] == V2.vector4_u32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return ((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) == 0xf) != 0); -#else - return XMComparisonAllTrue(XMVector4EqualIntR(V1, V2)); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector4EqualIntR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t CR = 0; - if (V1.vector4_u32[0] == V2.vector4_u32[0] && - V1.vector4_u32[1] == V2.vector4_u32[1] && - V1.vector4_u32[2] == V2.vector4_u32[2] && - V1.vector4_u32[3] == V2.vector4_u32[3]) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (V1.vector4_u32[0] != V2.vector4_u32[0] && - V1.vector4_u32[1] != V2.vector4_u32[1] && - V1.vector4_u32[2] != V2.vector4_u32[2] && - V1.vector4_u32[3] != V2.vector4_u32[3]) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - int iTest = _mm_movemask_ps(_mm_castsi128_ps(vTemp)); - uint32_t CR = 0; - if (iTest == 0xf) // All equal? - { - CR = XM_CRMASK_CR6TRUE; - } - else if (iTest == 0) // All not equal? - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -inline bool XM_CALLCONV XMVector4NearEqual -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR Epsilon -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float dx, dy, dz, dw; - - dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); - dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); - dz = fabsf(V1.vector4_f32[2] - V2.vector4_f32[2]); - dw = fabsf(V1.vector4_f32[3] - V2.vector4_f32[3]); - return (((dx <= Epsilon.vector4_f32[0]) && - (dy <= Epsilon.vector4_f32[1]) && - (dz <= Epsilon.vector4_f32[2]) && - (dw <= Epsilon.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vDelta = vsubq_f32(V1, V2); -#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) - uint32x4_t vResult = vacleq_f32(vDelta, Epsilon); -#else - uint32x4_t vResult = vcleq_f32(vabsq_f32(vDelta), Epsilon); -#endif - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - // Get the difference - XMVECTOR vDelta = _mm_sub_ps(V1, V2); - // Get the absolute value of the difference - XMVECTOR vTemp = _mm_setzero_ps(); - vTemp = _mm_sub_ps(vTemp, vDelta); - vTemp = _mm_max_ps(vTemp, vDelta); - vTemp = _mm_cmple_ps(vTemp, Epsilon); - return ((_mm_movemask_ps(vTemp) == 0xf) != 0); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4NotEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2]) || (V1.vector4_f32[3] != V2.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpneq_ps(V1, V2); - return ((_mm_movemask_ps(vTemp)) != 0); -#else - return XMComparisonAnyFalse(XMVector4EqualR(V1, V2)); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4NotEqualInt -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2]) || (V1.vector4_u32[3] != V2.vector4_u32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); - return ((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) != 0xF) != 0); -#else - return XMComparisonAnyFalse(XMVector4EqualIntR(V1, V2)); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4Greater -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2]) && (V1.vector4_f32[3] > V2.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgtq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); -#else - return XMComparisonAllTrue(XMVector4GreaterR(V1, V2)); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector4GreaterR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t CR = 0; - if (V1.vector4_f32[0] > V2.vector4_f32[0] && - V1.vector4_f32[1] > V2.vector4_f32[1] && - V1.vector4_f32[2] > V2.vector4_f32[2] && - V1.vector4_f32[3] > V2.vector4_f32[3]) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (V1.vector4_f32[0] <= V2.vector4_f32[0] && - V1.vector4_f32[1] <= V2.vector4_f32[1] && - V1.vector4_f32[2] <= V2.vector4_f32[2] && - V1.vector4_f32[3] <= V2.vector4_f32[3]) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgtq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - uint32_t CR = 0; - XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); - int iTest = _mm_movemask_ps(vTemp); - if (iTest == 0xf) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4GreaterOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2]) && (V1.vector4_f32[3] >= V2.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgeq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); -#else - return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V1, V2)); -#endif -} - -//------------------------------------------------------------------------------ - -inline uint32_t XM_CALLCONV XMVector4GreaterOrEqualR -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - uint32_t CR = 0; - if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && - (V1.vector4_f32[1] >= V2.vector4_f32[1]) && - (V1.vector4_f32[2] >= V2.vector4_f32[2]) && - (V1.vector4_f32[3] >= V2.vector4_f32[3])) - { - CR = XM_CRMASK_CR6TRUE; - } - else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && - (V1.vector4_f32[1] < V2.vector4_f32[1]) && - (V1.vector4_f32[2] < V2.vector4_f32[2]) && - (V1.vector4_f32[3] < V2.vector4_f32[3])) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcgeq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); - - uint32_t CR = 0; - if (r == 0xFFFFFFFFU) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!r) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#elif defined(_XM_SSE_INTRINSICS_) - uint32_t CR = 0; - XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); - int iTest = _mm_movemask_ps(vTemp); - if (iTest == 0x0f) - { - CR = XM_CRMASK_CR6TRUE; - } - else if (!iTest) - { - CR = XM_CRMASK_CR6FALSE; - } - return CR; -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4Less -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2]) && (V1.vector4_f32[3] < V2.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcltq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); - return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); -#else - return XMComparisonAllTrue(XMVector4GreaterR(V2, V1)); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4LessOrEqual -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2]) && (V1.vector4_f32[3] <= V2.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vResult = vcleq_f32(V1, V2); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp = _mm_cmple_ps(V1, V2); - return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); -#else - return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V2, V1)); -#endif -} - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4InBounds -( - FXMVECTOR V, - FXMVECTOR Bounds -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && - (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && - (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && - (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) != 0); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Test if less than or equal - uint32x4_t ivTemp1 = vcleq_f32(V, Bounds); - // Negate the bounds - float32x4_t vTemp2 = vnegq_f32(Bounds); - // Test if greater or equal (Reversed) - uint32x4_t ivTemp2 = vcleq_f32(vTemp2, V); - // Blend answers - ivTemp1 = vandq_u32(ivTemp1, ivTemp2); - // in bounds? - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(ivTemp1)), vget_high_u8(vreinterpretq_u8_u32(ivTemp1))); - uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1) == 0xFFFFFFFFU); -#elif defined(_XM_SSE_INTRINSICS_) - // Test if less than or equal - XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); - // Negate the bounds - XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); - // Test if greater or equal (Reversed) - vTemp2 = _mm_cmple_ps(vTemp2, V); - // Blend answers - vTemp1 = _mm_and_ps(vTemp1, vTemp2); - // All in bounds? - return ((_mm_movemask_ps(vTemp1) == 0x0f) != 0); -#else - return XMComparisonAllInBounds(XMVector4InBoundsR(V, Bounds)); -#endif -} - -//------------------------------------------------------------------------------ - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(push) -#pragma float_control(precise, on) -#endif - -inline bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - return (XMISNAN(V.vector4_f32[0]) || - XMISNAN(V.vector4_f32[1]) || - XMISNAN(V.vector4_f32[2]) || - XMISNAN(V.vector4_f32[3])); -#elif defined(_XM_ARM_NEON_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - return isnan(vgetq_lane_f32(V, 0)) || isnan(vgetq_lane_f32(V, 1)) || isnan(vgetq_lane_f32(V, 2)) || isnan(vgetq_lane_f32(V, 3)); -#else -// Test against itself. NaN is always not equal - uint32x4_t vTempNan = vceqq_f32(V, V); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempNan)), vget_high_u8(vreinterpretq_u8_u32(vTempNan))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - // If any are NaN, the mask is zero - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); -#endif -#elif defined(_XM_SSE_INTRINSICS_) -#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) - XM_ALIGNED_DATA(16) float tmp[4]; - _mm_store_ps(tmp, V); - return isnan(tmp[0]) || isnan(tmp[1]) || isnan(tmp[2]) || isnan(tmp[3]); -#else -// Test against itself. NaN is always not equal - XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); - // If any are NaN, the mask is non-zero - return (_mm_movemask_ps(vTempNan) != 0); -#endif -#endif -} - -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) -#pragma float_control(pop) -#endif - -//------------------------------------------------------------------------------ - -inline bool XM_CALLCONV XMVector4IsInfinite(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - return (XMISINF(V.vector4_f32[0]) || - XMISINF(V.vector4_f32[1]) || - XMISINF(V.vector4_f32[2]) || - XMISINF(V.vector4_f32[3])); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Mask off the sign bit - uint32x4_t vTempInf = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); - // Compare to infinity - vTempInf = vceqq_f32(vreinterpretq_f32_u32(vTempInf), g_XMInfinity); - // If any are infinity, the signs are true. - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempInf)), vget_high_u8(vreinterpretq_u8_u32(vTempInf))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Mask off the sign bit - XMVECTOR vTemp = _mm_and_ps(V, g_XMAbsMask); - // Compare to infinity - vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); - // If any are infinity, the signs are true. - return (_mm_movemask_ps(vTemp) != 0); -#endif -} - -//------------------------------------------------------------------------------ -// Computation operations -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Dot -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result; - Result.f[0] = - Result.f[1] = - Result.f[2] = - Result.f[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2] + V1.vector4_f32[3] * V2.vector4_f32[3]; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vTemp = vmulq_f32(V1, V2); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - return vcombine_f32(v1, v1); -#elif defined(_XM_SSE4_INTRINSICS_) - return _mm_dp_ps(V1, V2, 0xff); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vTemp = _mm_mul_ps(V1, V2); - vTemp = _mm_hadd_ps(vTemp, vTemp); - return _mm_hadd_ps(vTemp, vTemp); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vTemp2 = V2; - XMVECTOR vTemp = _mm_mul_ps(V1, vTemp2); - vTemp2 = _mm_shuffle_ps(vTemp2, vTemp, _MM_SHUFFLE(1, 0, 0, 0)); // Copy X to the Z position and Y to the W position - vTemp2 = _mm_add_ps(vTemp2, vTemp); // Add Z = X+Z; W = Y+W; - vTemp = _mm_shuffle_ps(vTemp, vTemp2, _MM_SHUFFLE(0, 3, 0, 0)); // Copy W to the Z position - vTemp = _mm_add_ps(vTemp, vTemp2); // Add Z and W together - return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(2, 2, 2, 2)); // Splat Z and return -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Cross -( - FXMVECTOR V1, - FXMVECTOR V2, - FXMVECTOR V3 -) noexcept -{ - // [ ((v2.z*v3.w-v2.w*v3.z)*v1.y)-((v2.y*v3.w-v2.w*v3.y)*v1.z)+((v2.y*v3.z-v2.z*v3.y)*v1.w), - // ((v2.w*v3.z-v2.z*v3.w)*v1.x)-((v2.w*v3.x-v2.x*v3.w)*v1.z)+((v2.z*v3.x-v2.x*v3.z)*v1.w), - // ((v2.y*v3.w-v2.w*v3.y)*v1.x)-((v2.x*v3.w-v2.w*v3.x)*v1.y)+((v2.x*v3.y-v2.y*v3.x)*v1.w), - // ((v2.z*v3.y-v2.y*v3.z)*v1.x)-((v2.z*v3.x-v2.x*v3.z)*v1.y)+((v2.y*v3.x-v2.x*v3.y)*v1.z) ] - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - (((V2.vector4_f32[2] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[2])) * V1.vector4_f32[1]) - (((V2.vector4_f32[1] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[1])) * V1.vector4_f32[2]) + (((V2.vector4_f32[1] * V3.vector4_f32[2]) - (V2.vector4_f32[2] * V3.vector4_f32[1])) * V1.vector4_f32[3]), - (((V2.vector4_f32[3] * V3.vector4_f32[2]) - (V2.vector4_f32[2] * V3.vector4_f32[3])) * V1.vector4_f32[0]) - (((V2.vector4_f32[3] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[3])) * V1.vector4_f32[2]) + (((V2.vector4_f32[2] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[2])) * V1.vector4_f32[3]), - (((V2.vector4_f32[1] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[1])) * V1.vector4_f32[0]) - (((V2.vector4_f32[0] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[0])) * V1.vector4_f32[1]) + (((V2.vector4_f32[0] * V3.vector4_f32[1]) - (V2.vector4_f32[1] * V3.vector4_f32[0])) * V1.vector4_f32[3]), - (((V2.vector4_f32[2] * V3.vector4_f32[1]) - (V2.vector4_f32[1] * V3.vector4_f32[2])) * V1.vector4_f32[0]) - (((V2.vector4_f32[2] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[2])) * V1.vector4_f32[1]) + (((V2.vector4_f32[1] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[1])) * V1.vector4_f32[2]), - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - const uint32x2_t select = vget_low_u32(g_XMMaskX); - - // Term1: V2zwyz * V3wzwy - const float32x2_t v2xy = vget_low_f32(V2); - const float32x2_t v2zw = vget_high_f32(V2); - const float32x2_t v2yx = vrev64_f32(v2xy); - const float32x2_t v2wz = vrev64_f32(v2zw); - const float32x2_t v2yz = vbsl_f32(select, v2yx, v2wz); - - const float32x2_t v3zw = vget_high_f32(V3); - const float32x2_t v3wz = vrev64_f32(v3zw); - const float32x2_t v3xy = vget_low_f32(V3); - const float32x2_t v3wy = vbsl_f32(select, v3wz, v3xy); - - float32x4_t vTemp1 = vcombine_f32(v2zw, v2yz); - float32x4_t vTemp2 = vcombine_f32(v3wz, v3wy); - XMVECTOR vResult = vmulq_f32(vTemp1, vTemp2); - - // - V2wzwy * V3zwyz - const float32x2_t v2wy = vbsl_f32(select, v2wz, v2xy); - - const float32x2_t v3yx = vrev64_f32(v3xy); - const float32x2_t v3yz = vbsl_f32(select, v3yx, v3wz); - - vTemp1 = vcombine_f32(v2wz, v2wy); - vTemp2 = vcombine_f32(v3zw, v3yz); - vResult = vmlsq_f32(vResult, vTemp1, vTemp2); - - // term1 * V1yxxx - const float32x2_t v1xy = vget_low_f32(V1); - const float32x2_t v1yx = vrev64_f32(v1xy); - - vTemp1 = vcombine_f32(v1yx, vdup_lane_f32(v1yx, 1)); - vResult = vmulq_f32(vResult, vTemp1); - - // Term2: V2ywxz * V3wxwx - const float32x2_t v2yw = vrev64_f32(v2wy); - const float32x2_t v2xz = vbsl_f32(select, v2xy, v2wz); - - const float32x2_t v3wx = vbsl_f32(select, v3wz, v3yx); - - vTemp1 = vcombine_f32(v2yw, v2xz); - vTemp2 = vcombine_f32(v3wx, v3wx); - float32x4_t vTerm = vmulq_f32(vTemp1, vTemp2); - - // - V2wxwx * V3ywxz - const float32x2_t v2wx = vbsl_f32(select, v2wz, v2yx); - - const float32x2_t v3yw = vrev64_f32(v3wy); - const float32x2_t v3xz = vbsl_f32(select, v3xy, v3wz); - - vTemp1 = vcombine_f32(v2wx, v2wx); - vTemp2 = vcombine_f32(v3yw, v3xz); - vTerm = vmlsq_f32(vTerm, vTemp1, vTemp2); - - // vResult - term2 * V1zzyy - const float32x2_t v1zw = vget_high_f32(V1); - - vTemp1 = vcombine_f32(vdup_lane_f32(v1zw, 0), vdup_lane_f32(v1yx, 0)); - vResult = vmlsq_f32(vResult, vTerm, vTemp1); - - // Term3: V2yzxy * V3zxyx - const float32x2_t v3zx = vrev64_f32(v3xz); - - vTemp1 = vcombine_f32(v2yz, v2xy); - vTemp2 = vcombine_f32(v3zx, v3yx); - vTerm = vmulq_f32(vTemp1, vTemp2); - - // - V2zxyx * V3yzxy - const float32x2_t v2zx = vrev64_f32(v2xz); - - vTemp1 = vcombine_f32(v2zx, v2yx); - vTemp2 = vcombine_f32(v3yz, v3xy); - vTerm = vmlsq_f32(vTerm, vTemp1, vTemp2); - - // vResult + term3 * V1wwwz - const float32x2_t v1wz = vrev64_f32(v1zw); - - vTemp1 = vcombine_f32(vdup_lane_f32(v1wz, 0), v1wz); - return vmlaq_f32(vResult, vTerm, vTemp1); -#elif defined(_XM_SSE_INTRINSICS_) - // V2zwyz * V3wzwy - XMVECTOR vResult = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 1, 3, 2)); - XMVECTOR vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 3, 2, 3)); - vResult = _mm_mul_ps(vResult, vTemp3); - // - V2wzwy * V3zwyz - XMVECTOR vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 3, 2, 3)); - vTemp3 = XM_PERMUTE_PS(vTemp3, _MM_SHUFFLE(1, 3, 0, 1)); - vResult = XM_FNMADD_PS(vTemp2, vTemp3, vResult); - // term1 * V1yxxx - XMVECTOR vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 1)); - vResult = _mm_mul_ps(vResult, vTemp1); - - // V2ywxz * V3wxwx - vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 0, 3, 1)); - vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 3, 0, 3)); - vTemp3 = _mm_mul_ps(vTemp3, vTemp2); - // - V2wxwx * V3ywxz - vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(2, 1, 2, 1)); - vTemp1 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 0, 3, 1)); - vTemp3 = XM_FNMADD_PS(vTemp2, vTemp1, vTemp3); - // vResult - temp * V1zzyy - vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 2, 2)); - vResult = XM_FNMADD_PS(vTemp1, vTemp3, vResult); - - // V2yzxy * V3zxyx - vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 0, 2, 1)); - vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 1, 0, 2)); - vTemp3 = _mm_mul_ps(vTemp3, vTemp2); - // - V2zxyx * V3yzxy - vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(2, 0, 2, 1)); - vTemp1 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 0, 2, 1)); - vTemp3 = XM_FNMADD_PS(vTemp1, vTemp2, vTemp3); - // vResult + term * V1wwwz - vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 3, 3, 3)); - vResult = XM_FMADD_PS(vTemp3, vTemp1, vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4LengthSq(FXMVECTOR V) noexcept -{ - return XMVector4Dot(V, V); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4ReciprocalLengthEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector4LengthSq(V); - Result = XMVectorReciprocalSqrtEst(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot4 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - // Reciprocal sqrt (estimate) - v2 = vrsqrte_f32(v1); - return vcombine_f32(v2, v2); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); - return _mm_rsqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_rsqrt_ps(vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and w - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); - // x+z, y+w - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // x+z,x+z,x+z,y+w - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); - // ??,??,y+w,y+w - vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); - // ??,??,x+z+y+w,?? - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // Splat the length - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); - // Get the reciprocal - vLengthSq = _mm_rsqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4ReciprocalLength(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector4LengthSq(V); - Result = XMVectorReciprocalSqrt(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot4 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - // Reciprocal sqrt - float32x2_t S0 = vrsqrte_f32(v1); - float32x2_t P0 = vmul_f32(v1, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(v1, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t Result = vmul_f32(S1, R1); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); - XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); - return _mm_div_ps(g_XMOne, vLengthSq); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ps(vLengthSq); - vLengthSq = _mm_div_ps(g_XMOne, vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and w - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); - // x+z, y+w - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // x+z,x+z,x+z,y+w - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); - // ??,??,y+w,y+w - vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); - // ??,??,x+z+y+w,?? - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // Splat the length - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); - // Get the reciprocal - vLengthSq = _mm_sqrt_ps(vLengthSq); - // Accurate! - vLengthSq = _mm_div_ps(g_XMOne, vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4LengthEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector4LengthSq(V); - Result = XMVectorSqrtEst(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot4 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - const float32x2_t zero = vdup_n_f32(0); - uint32x2_t VEqualsZero = vceq_f32(v1, zero); - // Sqrt (estimate) - float32x2_t Result = vrsqrte_f32(v1); - Result = vmul_f32(v1, Result); - Result = vbsl_f32(VEqualsZero, zero, Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); - return _mm_sqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and w - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); - // x+z, y+w - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // x+z,x+z,x+z,y+w - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); - // ??,??,y+w,y+w - vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); - // ??,??,x+z+y+w,?? - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // Splat the length - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); - // Get the length - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Length(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - - Result = XMVector4LengthSq(V); - Result = XMVectorSqrt(Result); - - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot4 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - const float32x2_t zero = vdup_n_f32(0); - uint32x2_t VEqualsZero = vceq_f32(v1, zero); - // Sqrt - float32x2_t S0 = vrsqrte_f32(v1); - float32x2_t P0 = vmul_f32(v1, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(v1, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - float32x2_t Result = vmul_f32(S1, R1); - Result = vmul_f32(v1, Result); - Result = vbsl_f32(VEqualsZero, zero, Result); - return vcombine_f32(Result, Result); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); - return _mm_sqrt_ps(vTemp); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and w - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); - // x+z, y+w - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // x+z,x+z,x+z,y+w - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); - // ??,??,y+w,y+w - vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); - // ??,??,x+z+y+w,?? - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // Splat the length - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); - // Get the length - vLengthSq = _mm_sqrt_ps(vLengthSq); - return vLengthSq; -#endif -} - -//------------------------------------------------------------------------------ -// XMVector4NormalizeEst uses a reciprocal estimate and -// returns QNaN on zero and infinite vectors. - -inline XMVECTOR XM_CALLCONV XMVector4NormalizeEst(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR Result; - Result = XMVector4ReciprocalLength(V); - Result = XMVectorMultiply(V, Result); - return Result; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot4 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - // Reciprocal sqrt (estimate) - v2 = vrsqrte_f32(v1); - // Normalize - return vmulq_f32(V, vcombine_f32(v2, v2)); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); - XMVECTOR vResult = _mm_rsqrt_ps(vTemp); - return _mm_mul_ps(vResult, V); -#elif defined(_XM_SSE3_INTRINSICS_) - XMVECTOR vDot = _mm_mul_ps(V, V); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_hadd_ps(vDot, vDot); - vDot = _mm_rsqrt_ps(vDot); - vDot = _mm_mul_ps(vDot, V); - return vDot; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and w - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); - // x+z, y+w - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // x+z,x+z,x+z,y+w - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); - // ??,??,y+w,y+w - vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); - // ??,??,x+z+y+w,?? - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // Splat the length - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); - // Get the reciprocal - XMVECTOR vResult = _mm_rsqrt_ps(vLengthSq); - // Reciprocal mul to perform the normalization - vResult = _mm_mul_ps(vResult, V); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Normalize(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - float fLength; - XMVECTOR vResult; - - vResult = XMVector4Length(V); - fLength = vResult.vector4_f32[0]; - - // Prevent divide by zero - if (fLength > 0) - { - fLength = 1.0f / fLength; - } - - vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; - vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; - vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; - vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; - return vResult; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - // Dot4 - float32x4_t vTemp = vmulq_f32(V, V); - float32x2_t v1 = vget_low_f32(vTemp); - float32x2_t v2 = vget_high_f32(vTemp); - v1 = vadd_f32(v1, v2); - v1 = vpadd_f32(v1, v1); - uint32x2_t VEqualsZero = vceq_f32(v1, vdup_n_f32(0)); - uint32x2_t VEqualsInf = vceq_f32(v1, vget_low_f32(g_XMInfinity)); - // Reciprocal sqrt (2 iterations of Newton-Raphson) - float32x2_t S0 = vrsqrte_f32(v1); - float32x2_t P0 = vmul_f32(v1, S0); - float32x2_t R0 = vrsqrts_f32(P0, S0); - float32x2_t S1 = vmul_f32(S0, R0); - float32x2_t P1 = vmul_f32(v1, S1); - float32x2_t R1 = vrsqrts_f32(P1, S1); - v2 = vmul_f32(S1, R1); - // Normalize - XMVECTOR vResult = vmulq_f32(V, vcombine_f32(v2, v2)); - vResult = vbslq_f32(vcombine_u32(VEqualsZero, VEqualsZero), vdupq_n_f32(0), vResult); - return vbslq_f32(vcombine_u32(VEqualsInf, VEqualsInf), g_XMQNaN, vResult); -#elif defined(_XM_SSE4_INTRINSICS_) - XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0xff); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Divide to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#elif defined(_XM_SSE3_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Divide to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - // Perform the dot product on x,y,z and w - XMVECTOR vLengthSq = _mm_mul_ps(V, V); - // vTemp has z and w - XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); - // x+z, y+w - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // x+z,x+z,x+z,y+w - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); - // ??,??,y+w,y+w - vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); - // ??,??,x+z+y+w,?? - vLengthSq = _mm_add_ps(vLengthSq, vTemp); - // Splat the length - vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); - // Prepare for the division - XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); - // Create zero with a single instruction - XMVECTOR vZeroMask = _mm_setzero_ps(); - // Test for a divide by zero (Must be FP to detect -0.0) - vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); - // Failsafe on zero (Or epsilon) length planes - // If the length is infinity, set the elements to zero - vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); - // Divide to perform the normalization - vResult = _mm_div_ps(V, vResult); - // Any that are infinity, set to zero - vResult = _mm_and_ps(vResult, vZeroMask); - // Select qnan or result based on infinite length - XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); - XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); - vResult = _mm_or_ps(vTemp1, vTemp2); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4ClampLength -( - FXMVECTOR V, - float LengthMin, - float LengthMax -) noexcept -{ - XMVECTOR ClampMax = XMVectorReplicate(LengthMax); - XMVECTOR ClampMin = XMVectorReplicate(LengthMin); - - return XMVector4ClampLengthV(V, ClampMin, ClampMax); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4ClampLengthV -( - FXMVECTOR V, - FXMVECTOR LengthMin, - FXMVECTOR LengthMax -) noexcept -{ - assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetW(LengthMin) == XMVectorGetX(LengthMin))); - assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetW(LengthMax) == XMVectorGetX(LengthMax))); - assert(XMVector4GreaterOrEqual(LengthMin, XMVectorZero())); - assert(XMVector4GreaterOrEqual(LengthMax, XMVectorZero())); - assert(XMVector4GreaterOrEqual(LengthMax, LengthMin)); - - XMVECTOR LengthSq = XMVector4LengthSq(V); - - const XMVECTOR Zero = XMVectorZero(); - - XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); - - XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); - XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); - - XMVECTOR Normal = XMVectorMultiply(V, RcpLength); - - XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); - - XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); - Length = XMVectorSelect(LengthSq, Length, Select); - Normal = XMVectorSelect(LengthSq, Normal, Select); - - XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); - XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); - - XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); - ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); - - XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); - - // Preserve the original vector (with no precision loss) if the length falls within the given range - XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); - Result = XMVectorSelect(Result, V, Control); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Reflect -( - FXMVECTOR Incident, - FXMVECTOR Normal -) noexcept -{ - // Result = Incident - (2 * dot(Incident, Normal)) * Normal - - XMVECTOR Result = XMVector4Dot(Incident, Normal); - Result = XMVectorAdd(Result, Result); - Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); - - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Refract -( - FXMVECTOR Incident, - FXMVECTOR Normal, - float RefractionIndex -) noexcept -{ - XMVECTOR Index = XMVectorReplicate(RefractionIndex); - return XMVector4RefractV(Incident, Normal, Index); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4RefractV -( - FXMVECTOR Incident, - FXMVECTOR Normal, - FXMVECTOR RefractionIndex -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR IDotN; - XMVECTOR R; - const XMVECTOR Zero = XMVectorZero(); - - // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + - // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) - - IDotN = XMVector4Dot(Incident, Normal); - - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); - R = XMVectorMultiply(R, RefractionIndex); - R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); - - if (XMVector4LessOrEqual(R, Zero)) - { - // Total internal reflection - return Zero; - } - else - { - XMVECTOR Result; - - // R = RefractionIndex * IDotN + sqrt(R) - R = XMVectorSqrt(R); - R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); - - // Result = RefractionIndex * Incident - Normal * R - Result = XMVectorMultiply(RefractionIndex, Incident); - Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); - - return Result; - } - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - XMVECTOR IDotN = XMVector4Dot(Incident, Normal); - - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - float32x4_t R = vmlsq_f32(g_XMOne, IDotN, IDotN); - R = vmulq_f32(R, RefractionIndex); - R = vmlsq_f32(g_XMOne, R, RefractionIndex); - - uint32x4_t isrzero = vcleq_f32(R, g_XMZero); - uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(isrzero)), vget_high_u8(vreinterpretq_u8_u32(isrzero))); - uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); - - float32x4_t vResult; - if (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU) - { - // Total internal reflection - vResult = g_XMZero; - } - else - { - // Sqrt(R) - float32x4_t S0 = vrsqrteq_f32(R); - float32x4_t P0 = vmulq_f32(R, S0); - float32x4_t R0 = vrsqrtsq_f32(P0, S0); - float32x4_t S1 = vmulq_f32(S0, R0); - float32x4_t P1 = vmulq_f32(R, S1); - float32x4_t R1 = vrsqrtsq_f32(P1, S1); - float32x4_t S2 = vmulq_f32(S1, R1); - R = vmulq_f32(R, S2); - // R = RefractionIndex * IDotN + sqrt(R) - R = vmlaq_f32(R, RefractionIndex, IDotN); - // Result = RefractionIndex * Incident - Normal * R - vResult = vmulq_f32(RefractionIndex, Incident); - vResult = vmlsq_f32(vResult, R, Normal); - } - return vResult; -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR IDotN = XMVector4Dot(Incident, Normal); - - // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) - XMVECTOR R = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); - XMVECTOR R2 = _mm_mul_ps(RefractionIndex, RefractionIndex); - R = XM_FNMADD_PS(R, R2, g_XMOne); - - XMVECTOR vResult = _mm_cmple_ps(R, g_XMZero); - if (_mm_movemask_ps(vResult) == 0x0f) - { - // Total internal reflection - vResult = g_XMZero; - } - else - { - // R = RefractionIndex * IDotN + sqrt(R) - R = _mm_sqrt_ps(R); - R = XM_FMADD_PS(RefractionIndex, IDotN, R); - // Result = RefractionIndex * Incident - Normal * R - vResult = _mm_mul_ps(RefractionIndex, Incident); - vResult = XM_FNMADD_PS(R, Normal, vResult); - } - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Orthogonal(FXMVECTOR V) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - XMVECTORF32 Result = { { { - V.vector4_f32[2], - V.vector4_f32[3], - -V.vector4_f32[0], - -V.vector4_f32[1] - } } }; - return Result.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Negate = { { { 1.f, 1.f, -1.f, -1.f } } }; - - float32x4_t Result = vcombine_f32(vget_high_f32(V), vget_low_f32(V)); - return vmulq_f32(Result, Negate); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 FlipZW = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 0, 3, 2)); - vResult = _mm_mul_ps(vResult, FlipZW); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormalsEst -( - FXMVECTOR N1, - FXMVECTOR N2 -) noexcept -{ - XMVECTOR Result = XMVector4Dot(N1, N2); - Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); - Result = XMVectorACosEst(Result); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormals -( - FXMVECTOR N1, - FXMVECTOR N2 -) noexcept -{ - XMVECTOR Result = XMVector4Dot(N1, N2); - Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); - Result = XMVectorACos(Result); - return Result; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenVectors -( - FXMVECTOR V1, - FXMVECTOR V2 -) noexcept -{ - XMVECTOR L1 = XMVector4ReciprocalLength(V1); - XMVECTOR L2 = XMVector4ReciprocalLength(V2); - - XMVECTOR Dot = XMVector4Dot(V1, V2); - - L1 = XMVectorMultiply(L1, L2); - - XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); - CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); - - return XMVectorACos(CosAngle); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV XMVector4Transform -( - FXMVECTOR V, - FXMMATRIX M -) noexcept -{ -#if defined(_XM_NO_INTRINSICS_) - - float fX = (M.m[0][0] * V.vector4_f32[0]) + (M.m[1][0] * V.vector4_f32[1]) + (M.m[2][0] * V.vector4_f32[2]) + (M.m[3][0] * V.vector4_f32[3]); - float fY = (M.m[0][1] * V.vector4_f32[0]) + (M.m[1][1] * V.vector4_f32[1]) + (M.m[2][1] * V.vector4_f32[2]) + (M.m[3][1] * V.vector4_f32[3]); - float fZ = (M.m[0][2] * V.vector4_f32[0]) + (M.m[1][2] * V.vector4_f32[1]) + (M.m[2][2] * V.vector4_f32[2]) + (M.m[3][2] * V.vector4_f32[3]); - float fW = (M.m[0][3] * V.vector4_f32[0]) + (M.m[1][3] * V.vector4_f32[1]) + (M.m[2][3] * V.vector4_f32[2]) + (M.m[3][3] * V.vector4_f32[3]); - XMVECTORF32 vResult = { { { fX, fY, fZ, fW } } }; - return vResult.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x2_t VL = vget_low_f32(V); - XMVECTOR vResult = vmulq_lane_f32(M.r[0], VL, 0); // X - vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y - float32x2_t VH = vget_high_f32(V); - vResult = vmlaq_lane_f32(vResult, M.r[2], VH, 0); // Z - return vmlaq_lane_f32(vResult, M.r[3], VH, 1); // W -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); // W - vResult = _mm_mul_ps(vResult, M.r[3]); - XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z - vResult = XM_FMADD_PS(vTemp, M.r[2], vResult); - vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y - vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); - vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X - vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream -( - XMFLOAT4* pOutputStream, - size_t OutputStride, - const XMFLOAT4* pInputStream, - size_t InputStride, - size_t VectorCount, - FXMMATRIX M -) noexcept -{ - assert(pOutputStream != nullptr); - assert(pInputStream != nullptr); - - assert(InputStride >= sizeof(XMFLOAT4)); - _Analysis_assume_(InputStride >= sizeof(XMFLOAT4)); - - assert(OutputStride >= sizeof(XMFLOAT4)); - _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); - -#if defined(_XM_NO_INTRINSICS_) - - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - for (size_t i = 0; i < VectorCount; i++) - { - XMVECTOR V = XMLoadFloat4(reinterpret_cast(pInputVector)); - XMVECTOR W = XMVectorSplatW(V); - XMVECTOR Z = XMVectorSplatZ(V); - XMVECTOR Y = XMVectorSplatY(V); - XMVECTOR X = XMVectorSplatX(V); - - XMVECTOR Result = XMVectorMultiply(W, row3); - Result = XMVectorMultiplyAdd(Z, row2, Result); - Result = XMVectorMultiplyAdd(Y, row1, Result); - Result = XMVectorMultiplyAdd(X, row0, Result); - - #ifdef _PREFAST_ - #pragma prefast(push) - #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) - #endif - - XMStoreFloat4(reinterpret_cast(pOutputVector), Result); - - #ifdef _PREFAST_ - #pragma prefast(pop) - #endif - - pInputVector += InputStride; - pOutputVector += OutputStride; - } - - return pOutputStream; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - size_t i = 0; - size_t four = VectorCount >> 2; - if (four > 0) - { - if ((InputStride == sizeof(XMFLOAT4)) && (OutputStride == sizeof(XMFLOAT4))) - { - for (size_t j = 0; j < four; ++j) - { - float32x4x4_t V = vld4q_f32(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT4) * 4; - - float32x2_t r = vget_low_f32(row0); - XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax - XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx - - XM_PREFETCH(pInputVector); - - r = vget_high_f32(row0); - XMVECTOR vResult2 = vmulq_lane_f32(V.val[0], r, 0); // Cx - XMVECTOR vResult3 = vmulq_lane_f32(V.val[0], r, 1); // Dx - - XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); - - r = vget_low_f32(row1); - vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey - vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); - - r = vget_high_f32(row1); - vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy - vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); - - r = vget_low_f32(row2); - vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz - vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); - - r = vget_high_f32(row2); - vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz - vResult3 = vmlaq_lane_f32(vResult3, V.val[2], r, 1); // Dx+Hy+Lz - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); - - r = vget_low_f32(row3); - vResult0 = vmlaq_lane_f32(vResult0, V.val[3], r, 0); // Ax+Ey+Iz+Mw - vResult1 = vmlaq_lane_f32(vResult1, V.val[3], r, 1); // Bx+Fy+Jz+Nw - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 6)); - - r = vget_high_f32(row3); - vResult2 = vmlaq_lane_f32(vResult2, V.val[3], r, 0); // Cx+Gy+Kz+Ow - vResult3 = vmlaq_lane_f32(vResult3, V.val[3], r, 1); // Dx+Hy+Lz+Pw - - XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 7)); - - V.val[0] = vResult0; - V.val[1] = vResult1; - V.val[2] = vResult2; - V.val[3] = vResult3; - - vst4q_f32(reinterpret_cast(pOutputVector), V); - pOutputVector += sizeof(XMFLOAT4) * 4; - - i += 4; - } - } - } - - for (; i < VectorCount; i++) - { - XMVECTOR V = vld1q_f32(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - float32x2_t VL = vget_low_f32(V); - XMVECTOR vResult = vmulq_lane_f32(row0, VL, 0); // X - vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y - float32x2_t VH = vget_high_f32(V); - vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z - vResult = vmlaq_lane_f32(vResult, row3, VH, 1); // W - - vst1q_f32(reinterpret_cast(pOutputVector), vResult); - pOutputVector += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_AVX2_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t two = VectorCount >> 1; - if (two > 0) - { - __m256 row0 = _mm256_broadcast_ps(&M.r[0]); - __m256 row1 = _mm256_broadcast_ps(&M.r[1]); - __m256 row2 = _mm256_broadcast_ps(&M.r[2]); - __m256 row3 = _mm256_broadcast_ps(&M.r[3]); - - if (InputStride == sizeof(XMFLOAT4)) - { - if (OutputStride == sizeof(XMFLOAT4)) - { - if (!(reinterpret_cast(pOutputStream) & 0x1F)) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < two; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT4) * 2; - - __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm256_mul_ps(vTempX, row0); - vTempY = _mm256_mul_ps(vTempY, row1); - vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); - vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); - vTempX = _mm256_add_ps(vTempZ, vTempW); - - XM256_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += sizeof(XMFLOAT4) * 2; - - i += 2; - } - } - else - { - // Packed input, packed output - for (size_t j = 0; j < two; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT4) * 2; - - __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm256_mul_ps(vTempX, row0); - vTempY = _mm256_mul_ps(vTempY, row1); - vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); - vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); - vTempX = _mm256_add_ps(vTempZ, vTempW); - - _mm256_storeu_ps(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += sizeof(XMFLOAT4) * 2; - - i += 2; - } - } - } - else - { - // Packed input, unpacked output - for (size_t j = 0; j < two; ++j) - { - __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += sizeof(XMFLOAT4) * 2; - - __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); - __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); - __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); - __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm256_mul_ps(vTempX, row0); - vTempY = _mm256_mul_ps(vTempY, row1); - vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); - vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); - vTempX = _mm256_add_ps(vTempZ, vTempW); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempX)); - pOutputVector += OutputStride; - - _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempX, 1)); - pOutputVector += OutputStride; - i += 2; - } - } - } - } - - if (i < VectorCount) - { - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - for (; i < VectorCount; i++) - { - __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm_mul_ps(vTempX, row0); - vTempY = _mm_mul_ps(vTempY, row1); - vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); - vTempW = XM_FMADD_PS(vTempW, row3, vTempY); - vTempX = _mm_add_ps(vTempZ, vTempW); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += OutputStride; - } - } - - XM_SFENCE(); - - return pOutputStream; -#elif defined(_XM_SSE_INTRINSICS_) - auto pInputVector = reinterpret_cast(pInputStream); - auto pOutputVector = reinterpret_cast(pOutputStream); - - const XMVECTOR row0 = M.r[0]; - const XMVECTOR row1 = M.r[1]; - const XMVECTOR row2 = M.r[2]; - const XMVECTOR row3 = M.r[3]; - - if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) - { - if (!(reinterpret_cast(pInputStream) & 0xF) && !(InputStride & 0xF)) - { - // Aligned input, aligned output - for (size_t i = 0; i < VectorCount; i++) - { - __m128 V = _mm_load_ps(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm_mul_ps(vTempX, row0); - vTempY = _mm_mul_ps(vTempY, row1); - vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); - vTempW = XM_FMADD_PS(vTempW, row3, vTempY); - vTempX = _mm_add_ps(vTempZ, vTempW); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += OutputStride; - } - } - else - { - // Unaligned input, aligned output - for (size_t i = 0; i < VectorCount; i++) - { - __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm_mul_ps(vTempX, row0); - vTempY = _mm_mul_ps(vTempY, row1); - vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); - vTempW = XM_FMADD_PS(vTempW, row3, vTempY); - vTempX = _mm_add_ps(vTempZ, vTempW); - - XM_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += OutputStride; - } - } - } - else - { - if (!(reinterpret_cast(pInputStream) & 0xF) && !(InputStride & 0xF)) - { - // Aligned input, unaligned output - for (size_t i = 0; i < VectorCount; i++) - { - __m128 V = _mm_load_ps(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm_mul_ps(vTempX, row0); - vTempY = _mm_mul_ps(vTempY, row1); - vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); - vTempW = XM_FMADD_PS(vTempW, row3, vTempY); - vTempX = _mm_add_ps(vTempZ, vTempW); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += OutputStride; - } - } - else - { - // Unaligned input, unaligned output - for (size_t i = 0; i < VectorCount; i++) - { - __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); - pInputVector += InputStride; - - XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); - XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); - XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); - XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); - - vTempX = _mm_mul_ps(vTempX, row0); - vTempY = _mm_mul_ps(vTempY, row1); - vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); - vTempW = XM_FMADD_PS(vTempW, row3, vTempY); - vTempX = _mm_add_ps(vTempZ, vTempW); - - _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); - pOutputVector += OutputStride; - } - } - } - - XM_SFENCE(); - - return pOutputStream; -#endif -} - -/**************************************************************************** - * - * XMVECTOR operators - * - ****************************************************************************/ - -#ifndef _XM_NO_XMVECTOR_OVERLOADS_ - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator+ (FXMVECTOR V) noexcept -{ - return V; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator- (FXMVECTOR V) noexcept -{ - return XMVectorNegate(V); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR& XM_CALLCONV operator+= -( - XMVECTOR& V1, - FXMVECTOR V2 - ) noexcept -{ - V1 = XMVectorAdd(V1, V2); - return V1; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR& XM_CALLCONV operator-= -( - XMVECTOR& V1, - FXMVECTOR V2 - ) noexcept -{ - V1 = XMVectorSubtract(V1, V2); - return V1; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR& XM_CALLCONV operator*= -( - XMVECTOR& V1, - FXMVECTOR V2 - ) noexcept -{ - V1 = XMVectorMultiply(V1, V2); - return V1; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR& XM_CALLCONV operator/= -( - XMVECTOR& V1, - FXMVECTOR V2 - ) noexcept -{ - V1 = XMVectorDivide(V1, V2); - return V1; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR& operator*= -( - XMVECTOR& V, - const float S - ) noexcept -{ - V = XMVectorScale(V, S); - return V; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR& operator/= -( - XMVECTOR& V, - const float S - ) noexcept -{ - XMVECTOR vS = XMVectorReplicate(S); - V = XMVectorDivide(V, vS); - return V; -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator+ -( - FXMVECTOR V1, - FXMVECTOR V2 - ) noexcept -{ - return XMVectorAdd(V1, V2); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator- -( - FXMVECTOR V1, - FXMVECTOR V2 - ) noexcept -{ - return XMVectorSubtract(V1, V2); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator* -( - FXMVECTOR V1, - FXMVECTOR V2 - ) noexcept -{ - return XMVectorMultiply(V1, V2); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator/ -( - FXMVECTOR V1, - FXMVECTOR V2 - ) noexcept -{ - return XMVectorDivide(V1, V2); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator* -( - FXMVECTOR V, - const float S - ) noexcept -{ - return XMVectorScale(V, S); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator/ -( - FXMVECTOR V, - const float S - ) noexcept -{ - XMVECTOR vS = XMVectorReplicate(S); - return XMVectorDivide(V, vS); -} - -//------------------------------------------------------------------------------ - -inline XMVECTOR XM_CALLCONV operator* -( - float S, - FXMVECTOR V - ) noexcept -{ - return XMVectorScale(V, S); -} - -#endif /* !_XM_NO_XMVECTOR_OVERLOADS_ */ - -#if defined(_XM_NO_INTRINSICS_) -#undef XMISNAN -#undef XMISINF -#endif - -#if defined(_XM_SSE_INTRINSICS_) -#undef XM3UNPACK3INTO4 -#undef XM3PACK4INTO3 -#endif - +//------------------------------------------------------------------------------------- +// DirectXMathVector.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#if defined(_XM_NO_INTRINSICS_) +#define XMISNAN(x) isnan(x) +#define XMISINF(x) isinf(x) +#endif + +#if defined(_XM_SSE_INTRINSICS_) + +#define XM3UNPACK3INTO4(l1, l2, l3) \ + XMVECTOR V3 = _mm_shuffle_ps(l2, l3, _MM_SHUFFLE(0, 0, 3, 2));\ + XMVECTOR V2 = _mm_shuffle_ps(l2, l1, _MM_SHUFFLE(3, 3, 1, 0));\ + V2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 0, 2));\ + XMVECTOR V4 = _mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(L3), 32 / 8)) + +#define XM3PACK4INTO3(v2x) \ + v2x = _mm_shuffle_ps(V2, V3, _MM_SHUFFLE(1, 0, 2, 1));\ + V2 = _mm_shuffle_ps(V2, V1, _MM_SHUFFLE(2, 2, 0, 0));\ + V1 = _mm_shuffle_ps(V1, V2, _MM_SHUFFLE(0, 2, 1, 0));\ + V3 = _mm_shuffle_ps(V3, V4, _MM_SHUFFLE(0, 0, 2, 2));\ + V3 = _mm_shuffle_ps(V3, V4, _MM_SHUFFLE(2, 1, 2, 0)) + +#endif + +/**************************************************************************** + * + * General Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Assignment operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Return a vector with all elements equaling zero +inline XMVECTOR XM_CALLCONV XMVectorZero() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_n_f32(0); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four floating point values +inline XMVECTOR XM_CALLCONV XMVectorSet +( + float x, + float y, + float z, + float w +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { x, y, z, w } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t V0 = vcreate_f32( + static_cast(*reinterpret_cast(&x)) + | (static_cast(*reinterpret_cast(&y)) << 32)); + float32x2_t V1 = vcreate_f32( + static_cast(*reinterpret_cast(&z)) + | (static_cast(*reinterpret_cast(&w)) << 32)); + return vcombine_f32(V0, V1); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps(w, z, y, x); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four integer values +inline XMVECTOR XM_CALLCONV XMVectorSetInt +( + uint32_t x, + uint32_t y, + uint32_t z, + uint32_t w +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = { { { x, y, z, w } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t V0 = vcreate_u32(static_cast(x) | (static_cast(y) << 32)); + uint32x2_t V1 = vcreate_u32(static_cast(z) | (static_cast(w) << 32)); + return vreinterpretq_f32_u32(vcombine_u32(V0, V1)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set_epi32(static_cast(w), static_cast(z), static_cast(y), static_cast(x)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value +inline XMVECTOR XM_CALLCONV XMVectorReplicate(float Value) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_n_f32(Value); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps1(Value); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorReplicatePtr(const float* pValue) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float Value = pValue[0]; + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_dup_f32(pValue); +#elif defined(_XM_AVX_INTRINSICS_) + return _mm_broadcast_ss(pValue); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1(pValue); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value +inline XMVECTOR XM_CALLCONV XMVectorReplicateInt(uint32_t Value) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(Value)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_set1_epi32(static_cast(Value)); + return _mm_castsi128_ps(vTemp); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorReplicateIntPtr(const uint32_t* pValue) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t Value = pValue[0]; + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = Value; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_dup_u32(pValue)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1(reinterpret_cast(pValue)); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits set (true mask) +inline XMVECTOR XM_CALLCONV XMVectorTrueInt() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = { { { 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_s32(vdupq_n_s32(-1)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32(-1); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits clear (false mask) +inline XMVECTOR XM_CALLCONV XMVectorFalseInt() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { 0.0f, 0.0f, 0.0f, 0.0f } } }; + return vResult; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the x component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[0]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_low_f32(V), 0); +#elif defined(_XM_AVX2_INTRINSICS_) && defined(_XM_FAVOR_INTEL_) + return _mm_broadcastss_ps(V); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the y component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatY(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[1]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_low_f32(V), 1); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the z component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatZ(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[2]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_high_f32(V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); +#endif +} + +//------------------------------------------------------------------------------ +// Replicate the w component of the vector +inline XMVECTOR XM_CALLCONV XMVectorSplatW(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = V.vector4_f32[3]; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_lane_f32(vget_high_f32(V), 1); +#elif defined(_XM_SSE_INTRINSICS_) + return XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.0f,1.0f,1.0f,1.0f +inline XMVECTOR XM_CALLCONV XMVectorSplatOne() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = 1.0f; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vdupq_n_f32(1.0f); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMOne; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of INF,INF,INF,INF +inline XMVECTOR XM_CALLCONV XMVectorSplatInfinity() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x7F800000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x7F800000)); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMInfinity; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of Q_NAN,Q_NAN,Q_NAN,Q_NAN +inline XMVECTOR XM_CALLCONV XMVectorSplatQNaN() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x7FC00000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x7FC00000)); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMQNaN; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.192092896e-7f,1.192092896e-7f,1.192092896e-7f,1.192092896e-7f +inline XMVECTOR XM_CALLCONV XMVectorSplatEpsilon() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x34000000; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x34000000)); +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMEpsilon; +#endif +} + +//------------------------------------------------------------------------------ +// Return a vector of -0.0f (0x80000000),-0.0f,-0.0f,-0.0f +inline XMVECTOR XM_CALLCONV XMVectorSplatSignMask() noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = + vResult.u[1] = + vResult.u[2] = + vResult.u[3] = 0x80000000U; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vdupq_n_u32(0x80000000U)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32(static_cast(0x80000000)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Return a floating point value via an index. This is not a recommended +// function to use due to performance loss. +inline float XM_CALLCONV XMVectorGetByIndex(FXMVECTOR V, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[i]; +#else + XMVECTORF32 U; + U.v = V; + return U.f[i]; +#endif +} + +//------------------------------------------------------------------------------ +// Return the X component in an FPU register. +inline float XM_CALLCONV XMVectorGetX(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cvtss_f32(V); +#endif +} + +// Return the Y component in an FPU register. +inline float XM_CALLCONV XMVectorGetY(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + return _mm_cvtss_f32(vTemp); +#endif +} + +// Return the Z component in an FPU register. +inline float XM_CALLCONV XMVectorGetZ(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + return _mm_cvtss_f32(vTemp); +#endif +} + +// Return the W component in an FPU register. +inline float XM_CALLCONV XMVectorGetW(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_f32(V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + return _mm_cvtss_f32(vTemp); +#endif +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetByIndexPtr(float* f, FXMVECTOR V, size_t i) noexcept +{ + assert(f != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + *f = V.vector4_f32[i]; +#else + XMVECTORF32 U; + U.v = V; + *f = U.f[i]; +#endif +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetXPtr(float* x, FXMVECTOR V) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_f32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(x, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(x, V); +#endif +} + +// Store the Y component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetYPtr(float* y, FXMVECTOR V) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_f32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(y, V, 1); +#elif defined(_XM_SSE4_INTRINSICS_) + * (reinterpret_cast(y)) = _mm_extract_ps(V, 1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + _mm_store_ss(y, vResult); +#endif +} + +// Store the Z component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetZPtr(float* z, FXMVECTOR V) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_f32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(z, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + * (reinterpret_cast(z)) = _mm_extract_ps(V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(z, vResult); +#endif +} + +// Store the W component into a 32 bit float location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetWPtr(float* w, FXMVECTOR V) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_f32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_f32(w, V, 3); +#elif defined(_XM_SSE4_INTRINSICS_) + * (reinterpret_cast(w)) = _mm_extract_ps(V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + _mm_store_ss(w, vResult); +#endif +} + +//------------------------------------------------------------------------------ + +// Return an integer value via an index. This is not a recommended +// function to use due to performance loss. +inline uint32_t XM_CALLCONV XMVectorGetIntByIndex(FXMVECTOR V, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[i]; +#else + XMVECTORU32 U; + U.v = V; + return U.u[i]; +#endif +} + +//------------------------------------------------------------------------------ + +// Return the X component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntX(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + return static_cast(_mm_cvtsi128_si32(_mm_castps_si128(V))); +#endif +} + +// Return the Y component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntY(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 1); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + return static_cast(_mm_extract_epi32(V1, 1)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(1, 1, 1, 1)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#endif +} + +// Return the Z component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntZ(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 2); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + return static_cast(_mm_extract_epi32(V1, 2)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(2, 2, 2, 2)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#endif +} + +// Return the W component in an integer register. +inline uint32_t XM_CALLCONV XMVectorGetIntW(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vgetq_lane_u32(vreinterpretq_u32_f32(V), 3); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + return static_cast(_mm_extract_epi32(V1, 3)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(_mm_castps_si128(V), _MM_SHUFFLE(3, 3, 3, 3)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntByIndexPtr(uint32_t* x, FXMVECTOR V, size_t i) noexcept +{ + assert(x != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[i]; +#else + XMVECTORU32 U; + U.v = V; + *x = U.u[i]; +#endif +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntXPtr(uint32_t* x, FXMVECTOR V) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[0]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(x, *reinterpret_cast(&V), 0); +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(reinterpret_cast(x), V); +#endif +} + +// Store the Y component into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntYPtr(uint32_t* y, FXMVECTOR V) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_u32[1]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(y, *reinterpret_cast(&V), 1); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + *y = static_cast(_mm_extract_epi32(V1, 1)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + _mm_store_ss(reinterpret_cast(y), vResult); +#endif +} + +// Store the Z component into a 32 bit integer locaCantion in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntZPtr(uint32_t* z, FXMVECTOR V) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_u32[2]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(z, *reinterpret_cast(&V), 2); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + *z = static_cast(_mm_extract_epi32(V1, 2)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(z), vResult); +#endif +} + +// Store the W component into a 32 bit integer location in memory. +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorGetIntWPtr(uint32_t* w, FXMVECTOR V) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_u32[3]; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + vst1q_lane_u32(w, *reinterpret_cast(&V), 3); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i V1 = _mm_castps_si128(V); + *w = static_cast(_mm_extract_epi32(V1, 3)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + _mm_store_ss(reinterpret_cast(w), vResult); +#endif +} + +//------------------------------------------------------------------------------ + +// Set a single indexed floating point component +inline XMVECTOR XM_CALLCONV XMVectorSetByIndex(FXMVECTOR V, float f, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORF32 U; + U.v = V; + U.f[i] = f; + return U.v; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetX(FXMVECTOR V, float x) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + x, + V.vector4_f32[1], + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(x, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(x); + vResult = _mm_move_ss(V, vResult); + return vResult; +#endif +} + +// Sets the Y component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetY(FXMVECTOR V, float y) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + y, + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(y, V, 1); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(y); + vResult = _mm_insert_ps(V, vResult, 0x10); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} +// Sets the Z component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetZ(FXMVECTOR V, float z) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + z, + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(z, V, 2); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(z); + vResult = _mm_insert_ps(V, vResult, 0x20); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to a passed floating point value +inline XMVECTOR XM_CALLCONV XMVectorSetW(FXMVECTOR V, float w) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + V.vector4_f32[2], + w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsetq_lane_f32(w, V, 3); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vResult = _mm_set_ss(w); + vResult = _mm_insert_ps(V, vResult, 0x30); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetByIndexPtr(FXMVECTOR V, const float* f, size_t i) noexcept +{ + assert(f != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORF32 U; + U.v = V; + U.f[i] = *f; + return U.v; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetXPtr(FXMVECTOR V, const float* x) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + *x, + V.vector4_f32[1], + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(x, V, 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_load_ss(x); + vResult = _mm_move_ss(V, vResult); + return vResult; +#endif +} + +// Sets the Y component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetYPtr(FXMVECTOR V, const float* y) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + *y, + V.vector4_f32[2], + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(y, V, 1); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} + +// Sets the Z component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetZPtr(FXMVECTOR V, const float* z) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + *z, + V.vector4_f32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(z, V, 2); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to a floating point value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetWPtr(FXMVECTOR V, const float* w) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 U = { { { + V.vector4_f32[0], + V.vector4_f32[1], + V.vector4_f32[2], + *w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vld1q_lane_f32(w, V, 3); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntByIndex(FXMVECTOR V, uint32_t x, size_t i) noexcept +{ + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = x; + return tmp; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + x, + V.vector4_u32[1], + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(x, vreinterpretq_u32_f32(V), 0)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cvtsi32_si128(static_cast(x)); + XMVECTOR vResult = _mm_move_ss(V, _mm_castsi128_ps(vTemp)); + return vResult; +#endif +} + +// Sets the Y component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + y, + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(y, vreinterpretq_u32_f32(V), 1)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i vResult = _mm_castps_si128(V); + vResult = _mm_insert_epi32(vResult, static_cast(y), 1); + return _mm_castsi128_ps(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(static_cast(y)); + // Replace the x component + vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} + +// Sets the Z component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + z, + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(z, vreinterpretq_u32_f32(V), 2)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i vResult = _mm_castps_si128(V); + vResult = _mm_insert_epi32(vResult, static_cast(z), 2); + return _mm_castsi128_ps(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(static_cast(z)); + // Replace the x component + vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to an integer passed by value +inline XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + V.vector4_u32[2], + w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vsetq_lane_u32(w, vreinterpretq_u32_f32(V), 3)); +#elif defined(_XM_SSE4_INTRINSICS_) + __m128i vResult = _mm_castps_si128(V); + vResult = _mm_insert_epi32(vResult, static_cast(w), 3); + return _mm_castsi128_ps(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(static_cast(w)); + // Replace the x component + vResult = _mm_move_ss(vResult, _mm_castsi128_ps(vTemp)); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntByIndexPtr(FXMVECTOR V, const uint32_t* x, size_t i) noexcept +{ + assert(x != nullptr); + assert(i < 4); + _Analysis_assume_(i < 4); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = *x; + return tmp; +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntXPtr(FXMVECTOR V, const uint32_t* x) noexcept +{ + assert(x != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + *x, + V.vector4_u32[1], + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(x, *reinterpret_cast(&V), 0)); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(x)); + XMVECTOR vResult = _mm_move_ss(V, vTemp); + return vResult; +#endif +} + +// Sets the Y component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntYPtr(FXMVECTOR V, const uint32_t* y) noexcept +{ + assert(y != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + *y, + V.vector4_u32[2], + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(y, *reinterpret_cast(&V), 1)); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap y and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(y)); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap y and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 2, 0, 1)); + return vResult; +#endif +} + +// Sets the Z component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntZPtr(FXMVECTOR V, const uint32_t* z) noexcept +{ + assert(z != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + *z, + V.vector4_u32[3] + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(z, *reinterpret_cast(&V), 2)); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap z and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(z)); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap z and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + return vResult; +#endif +} + +// Sets the W component of a vector to an integer value passed by pointer +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorSetIntWPtr(FXMVECTOR V, const uint32_t* w) noexcept +{ + assert(w != nullptr); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 U = { { { + V.vector4_u32[0], + V.vector4_u32[1], + V.vector4_u32[2], + *w + } } }; + return U.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vld1q_lane_u32(w, *reinterpret_cast(&V), 3)); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap w and x + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 2, 1, 3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(w)); + // Replace the x component + vResult = _mm_move_ss(vResult, vTemp); + // Swap w and x again + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 2, 1, 3)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSwizzle +( + FXMVECTOR V, + uint32_t E0, + uint32_t E1, + uint32_t E2, + uint32_t E3 +) noexcept +{ + assert((E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4)); + _Analysis_assume_((E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4)); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V.vector4_f32[E0], + V.vector4_f32[E1], + V.vector4_f32[E2], + V.vector4_f32[E3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const uint32_t ControlElement[4] = + { + 0x03020100, // XM_SWIZZLE_X + 0x07060504, // XM_SWIZZLE_Y + 0x0B0A0908, // XM_SWIZZLE_Z + 0x0F0E0D0C, // XM_SWIZZLE_W + }; + + uint8x8x2_t tbl; + tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V)); + tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V)); + + uint32x2_t idx = vcreate_u32(static_cast(ControlElement[E0]) | (static_cast(ControlElement[E1]) << 32)); + const uint8x8_t rL = vtbl2_u8(tbl, vreinterpret_u8_u32(idx)); + + idx = vcreate_u32(static_cast(ControlElement[E2]) | (static_cast(ControlElement[E3]) << 32)); + const uint8x8_t rH = vtbl2_u8(tbl, vreinterpret_u8_u32(idx)); + + return vcombine_f32(vreinterpret_f32_u8(rL), vreinterpret_f32_u8(rH)); +#elif defined(_XM_AVX_INTRINSICS_) + unsigned int elem[4] = { E0, E1, E2, E3 }; + __m128i vControl = _mm_loadu_si128(reinterpret_cast(&elem[0])); + return _mm_permutevar_ps(V, vControl); +#else + auto aPtr = reinterpret_cast(&V); + + XMVECTOR Result; + auto pWork = reinterpret_cast(&Result); + + pWork[0] = aPtr[E0]; + pWork[1] = aPtr[E1]; + pWork[2] = aPtr[E2]; + pWork[3] = aPtr[E3]; + + return Result; +#endif +} + +//------------------------------------------------------------------------------ +inline XMVECTOR XM_CALLCONV XMVectorPermute +( + FXMVECTOR V1, + FXMVECTOR V2, + uint32_t PermuteX, + uint32_t PermuteY, + uint32_t PermuteZ, + uint32_t PermuteW +) noexcept +{ + assert(PermuteX <= 7 && PermuteY <= 7 && PermuteZ <= 7 && PermuteW <= 7); + _Analysis_assume_(PermuteX <= 7 && PermuteY <= 7 && PermuteZ <= 7 && PermuteW <= 7); + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const uint32_t ControlElement[8] = + { + 0x03020100, // XM_PERMUTE_0X + 0x07060504, // XM_PERMUTE_0Y + 0x0B0A0908, // XM_PERMUTE_0Z + 0x0F0E0D0C, // XM_PERMUTE_0W + 0x13121110, // XM_PERMUTE_1X + 0x17161514, // XM_PERMUTE_1Y + 0x1B1A1918, // XM_PERMUTE_1Z + 0x1F1E1D1C, // XM_PERMUTE_1W + }; + + uint8x8x4_t tbl; + tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V1)); + tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V1)); + tbl.val[2] = vreinterpret_u8_f32(vget_low_f32(V2)); + tbl.val[3] = vreinterpret_u8_f32(vget_high_f32(V2)); + + uint32x2_t idx = vcreate_u32(static_cast(ControlElement[PermuteX]) | (static_cast(ControlElement[PermuteY]) << 32)); + const uint8x8_t rL = vtbl4_u8(tbl, vreinterpret_u8_u32(idx)); + + idx = vcreate_u32(static_cast(ControlElement[PermuteZ]) | (static_cast(ControlElement[PermuteW]) << 32)); + const uint8x8_t rH = vtbl4_u8(tbl, vreinterpret_u8_u32(idx)); + + return vcombine_f32(vreinterpret_f32_u8(rL), vreinterpret_f32_u8(rH)); +#elif defined(_XM_AVX_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORU32 three = { { { 3, 3, 3, 3 } } }; + + XM_ALIGNED_DATA(16) unsigned int elem[4] = { PermuteX, PermuteY, PermuteZ, PermuteW }; + __m128i vControl = _mm_load_si128(reinterpret_cast(&elem[0])); + + __m128i vSelect = _mm_cmpgt_epi32(vControl, three); + vControl = _mm_castps_si128(_mm_and_ps(_mm_castsi128_ps(vControl), three)); + + __m128 shuffled1 = _mm_permutevar_ps(V1, vControl); + __m128 shuffled2 = _mm_permutevar_ps(V2, vControl); + + __m128 masked1 = _mm_andnot_ps(_mm_castsi128_ps(vSelect), shuffled1); + __m128 masked2 = _mm_and_ps(_mm_castsi128_ps(vSelect), shuffled2); + + return _mm_or_ps(masked1, masked2); +#else + + const uint32_t* aPtr[2]; + aPtr[0] = reinterpret_cast(&V1); + aPtr[1] = reinterpret_cast(&V2); + + XMVECTOR Result; + auto pWork = reinterpret_cast(&Result); + + const uint32_t i0 = PermuteX & 3; + const uint32_t vi0 = PermuteX >> 2; + pWork[0] = aPtr[vi0][i0]; + + const uint32_t i1 = PermuteY & 3; + const uint32_t vi1 = PermuteY >> 2; + pWork[1] = aPtr[vi1][i1]; + + const uint32_t i2 = PermuteZ & 3; + const uint32_t vi2 = PermuteZ >> 2; + pWork[2] = aPtr[vi2][i2]; + + const uint32_t i3 = PermuteW & 3; + const uint32_t vi3 = PermuteW >> 2; + pWork[3] = aPtr[vi3][i3]; + + return Result; +#endif +} + +//------------------------------------------------------------------------------ +// Define a control vector to be used in XMVectorSelect +// operations. The four integers specified in XMVectorSelectControl +// serve as indices to select between components in two vectors. +// The first index controls selection for the first component of +// the vectors involved in a select operation, the second index +// controls selection for the second component etc. A value of +// zero for an index causes the corresponding component from the first +// vector to be selected whereas a one causes the component from the +// second vector to be selected instead. + +inline XMVECTOR XM_CALLCONV XMVectorSelectControl +( + uint32_t VectorIndex0, + uint32_t VectorIndex1, + uint32_t VectorIndex2, + uint32_t VectorIndex3 +) noexcept +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + // x=Index0,y=Index1,z=Index2,w=Index3 + __m128i vTemp = _mm_set_epi32(static_cast(VectorIndex3), static_cast(VectorIndex2), static_cast(VectorIndex1), static_cast(VectorIndex0)); + // Any non-zero entries become 0xFFFFFFFF else 0 + vTemp = _mm_cmpgt_epi32(vTemp, g_XMZero); + return _mm_castsi128_ps(vTemp); +#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + int32x2_t V0 = vcreate_s32(static_cast(VectorIndex0) | (static_cast(VectorIndex1) << 32)); + int32x2_t V1 = vcreate_s32(static_cast(VectorIndex2) | (static_cast(VectorIndex3) << 32)); + int32x4_t vTemp = vcombine_s32(V0, V1); + // Any non-zero entries become 0xFFFFFFFF else 0 + return vreinterpretq_f32_u32(vcgtq_s32(vTemp, g_XMZero)); +#else + XMVECTOR ControlVector; + const uint32_t ControlElement[] = + { + XM_SELECT_0, + XM_SELECT_1 + }; + + assert(VectorIndex0 < 2); + assert(VectorIndex1 < 2); + assert(VectorIndex2 < 2); + assert(VectorIndex3 < 2); + _Analysis_assume_(VectorIndex0 < 2); + _Analysis_assume_(VectorIndex1 < 2); + _Analysis_assume_(VectorIndex2 < 2); + _Analysis_assume_(VectorIndex3 < 2); + + ControlVector.vector4_u32[0] = ControlElement[VectorIndex0]; + ControlVector.vector4_u32[1] = ControlElement[VectorIndex1]; + ControlVector.vector4_u32[2] = ControlElement[VectorIndex2]; + ControlVector.vector4_u32[3] = ControlElement[VectorIndex3]; + + return ControlVector; + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSelect +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Control +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + (V1.vector4_u32[0] & ~Control.vector4_u32[0]) | (V2.vector4_u32[0] & Control.vector4_u32[0]), + (V1.vector4_u32[1] & ~Control.vector4_u32[1]) | (V2.vector4_u32[1] & Control.vector4_u32[1]), + (V1.vector4_u32[2] & ~Control.vector4_u32[2]) | (V2.vector4_u32[2] & Control.vector4_u32[2]), + (V1.vector4_u32[3] & ~Control.vector4_u32[3]) | (V2.vector4_u32[3] & Control.vector4_u32[3]), + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vbslq_f32(vreinterpretq_u32_f32(Control), V2, V1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_andnot_ps(Control, V1); + XMVECTOR vTemp2 = _mm_and_ps(V2, Control); + return _mm_or_ps(vTemp1, vTemp2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMergeXY +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0], + V2.vector4_u32[0], + V1.vector4_u32[1], + V2.vector4_u32[1], + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vzipq_f32(V1, V2).val[0]; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpacklo_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMergeZW +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[2], + V2.vector4_u32[2], + V1.vector4_u32[3], + V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vzipq_f32(V1, V2).val[1]; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpackhi_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, uint32_t Elements) noexcept +{ + assert(Elements < 4); + _Analysis_assume_(Elements < 4); + return XMVectorPermute(V1, V2, Elements, ((Elements)+1), ((Elements)+2), ((Elements)+3)); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorRotateLeft(FXMVECTOR V, uint32_t Elements) noexcept +{ + assert(Elements < 4); + _Analysis_assume_(Elements < 4); + return XMVectorSwizzle(V, Elements & 3, (Elements + 1) & 3, (Elements + 2) & 3, (Elements + 3) & 3); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, uint32_t Elements) noexcept +{ + assert(Elements < 4); + _Analysis_assume_(Elements < 4); + return XMVectorSwizzle(V, (4 - (Elements)) & 3, (5 - (Elements)) & 3, (6 - (Elements)) & 3, (7 - (Elements)) & 3); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorInsert( + FXMVECTOR VD, FXMVECTOR VS, + uint32_t VSLeftRotateElements, + uint32_t Select0, uint32_t Select1, uint32_t Select2, uint32_t Select3) noexcept +{ + XMVECTOR Control = XMVectorSelectControl(Select0 & 1, Select1 & 1, Select2 & 1, Select3 & 1); + return XMVectorSelect(VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control); +} + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFF : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vceqq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpeq_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorEqualR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + uint32_t ux = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux | uy | uz | uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vreinterpret_u8_u32(vget_low_u32(vResult)), vreinterpret_u8_u32(vget_high_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are equal + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not equal + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +// Treat the components of the vectors as unsigned integers and +// compare individual bits between the two. This is useful for +// comparing control vectors and result vectors returned from +// other comparison operations. + +inline XMVECTOR XM_CALLCONV XMVectorEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_u32[0] == V2.vector4_u32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_u32[1] == V2.vector4_u32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_u32[2] == V2.vector4_u32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_u32[3] == V2.vector4_u32[3]) ? 0xFFFFFFFF : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vceqq_s32(vreinterpretq_s32_f32(V1), vreinterpretq_s32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorEqualIntR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control = XMVectorEqualInt(V1, V2); + + *pCR = 0; + if (XMVector4EqualInt(Control, XMVectorTrueInt())) + { + // All elements are equal + *pCR |= XM_CRMASK_CR6TRUE; + } + else if (XMVector4EqualInt(Control, XMVectorFalseInt())) + { + // All elements are not equal + *pCR |= XM_CRMASK_CR6FALSE; + } + return Control; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are equal + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not equal + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTemp = _mm_movemask_ps(_mm_castsi128_ps(V)); + uint32_t CR = 0; + if (iTemp == 0x0F) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fDeltax = V1.vector4_f32[0] - V2.vector4_f32[0]; + float fDeltay = V1.vector4_f32[1] - V2.vector4_f32[1]; + float fDeltaz = V1.vector4_f32[2] - V2.vector4_f32[2]; + float fDeltaw = V1.vector4_f32[3] - V2.vector4_f32[3]; + + fDeltax = fabsf(fDeltax); + fDeltay = fabsf(fDeltay); + fDeltaz = fabsf(fDeltaz); + fDeltaw = fabsf(fDeltaw); + + XMVECTORU32 Control = { { { + (fDeltax <= Epsilon.vector4_f32[0]) ? 0xFFFFFFFFU : 0, + (fDeltay <= Epsilon.vector4_f32[1]) ? 0xFFFFFFFFU : 0, + (fDeltaz <= Epsilon.vector4_f32[2]) ? 0xFFFFFFFFU : 0, + (fDeltaw <= Epsilon.vector4_f32[3]) ? 0xFFFFFFFFU : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vDelta = vsubq_f32(V1, V2); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + return vacleq_f32(vDelta, Epsilon); +#else + return vreinterpretq_f32_u32(vcleq_f32(vabsq_f32(vDelta), Epsilon)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] != V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] != V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] != V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] != V2.vector4_f32[3]) ? 0xFFFFFFFF : 0, + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vmvnq_u32(vceqq_f32(V1, V2))); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpneq_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_u32[0] != V2.vector4_u32[0]) ? 0xFFFFFFFFU : 0, + (V1.vector4_u32[1] != V2.vector4_u32[1]) ? 0xFFFFFFFFU : 0, + (V1.vector4_u32[2] != V2.vector4_u32[2]) ? 0xFFFFFFFFU : 0, + (V1.vector4_u32[3] != V2.vector4_u32[3]) ? 0xFFFFFFFFU : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vmvnq_u32( + vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_xor_ps(_mm_castsi128_ps(V), g_XMNegOneMask); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorGreater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcgtq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpgt_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorGreaterR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ux = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux | uy | uz | uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorGreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcgeq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpge_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorGreaterOrEqualR +( + uint32_t* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ux = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux | uy | uz | uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are greater or equal + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + // All elements are not greater or equal + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vreinterpretq_f32_u32(vResult); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLess +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] < V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] < V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] < V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] < V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcltq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmplt_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V1.vector4_f32[0] <= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[1] <= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[2] <= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V1.vector4_f32[3] <= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vcleq_f32(V1, V2)); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmple_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorInBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFF : 0, + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFF : 0, + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFF : 0, + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFF : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t vTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + uint32x4_t vTemp2 = vreinterpretq_u32_f32(vnegq_f32(Bounds)); + // Test if greater or equal (Reversed) + vTemp2 = vcleq_f32(vreinterpretq_f32_u32(vTemp2), V); + // Blend answers + vTemp1 = vandq_u32(vTemp1, vTemp2); + return vreinterpretq_f32_u32(vTemp1); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + return vTemp1; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMVectorInBoundsR +( + uint32_t* pCR, + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ + assert(pCR != nullptr); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ux = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uint32_t uy = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uint32_t uz = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uint32_t uw = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + + uint32_t CR = 0; + if (ux & uy & uz & uw) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + + XMVECTORU32 Control = { { { ux, uy, uz, uw } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t vTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + uint32x4_t vTemp2 = vreinterpretq_u32_f32(vnegq_f32(Bounds)); + // Test if greater or equal (Reversed) + vTemp2 = vcleq_f32(vreinterpretq_f32_u32(vTemp2), V); + // Blend answers + vTemp1 = vandq_u32(vTemp1, vTemp2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTemp1)), vget_high_u8(vreinterpretq_u8_u32(vTemp1))); + uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1); + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + return vreinterpretq_f32_u32(vTemp1); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + + uint32_t CR = 0; + if (_mm_movemask_ps(vTemp1) == 0xf) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + return vTemp1; +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + XMISNAN(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0, + XMISNAN(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0, + XMISNAN(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0, + XMISNAN(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + XMVECTORU32 vResult = { { { + isnan(vgetq_lane_f32(V, 0)) ? 0xFFFFFFFFU : 0, + isnan(vgetq_lane_f32(V, 1)) ? 0xFFFFFFFFU : 0, + isnan(vgetq_lane_f32(V, 2)) ? 0xFFFFFFFFU : 0, + isnan(vgetq_lane_f32(V, 3)) ? 0xFFFFFFFFU : 0 } } }; + return vResult.v; +#else +// Test against itself. NaN is always not equal + uint32x4_t vTempNan = vceqq_f32(V, V); + // Flip results + return vreinterpretq_f32_u32(vmvnq_u32(vTempNan)); +#endif +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + XM_ALIGNED_DATA(16) float tmp[4]; + _mm_store_ps(tmp, V); + XMVECTORU32 vResult = { { { + isnan(tmp[0]) ? 0xFFFFFFFFU : 0, + isnan(tmp[1]) ? 0xFFFFFFFFU : 0, + isnan(tmp[2]) ? 0xFFFFFFFFU : 0, + isnan(tmp[3]) ? 0xFFFFFFFFU : 0 } } }; + return vResult.v; +#else +// Test against itself. NaN is always not equal + return _mm_cmpneq_ps(V, V); +#endif +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorIsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Control = { { { + XMISINF(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0, + XMISINF(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0, + XMISINF(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0, + XMISINF(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0 + } } }; + return Control.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x4_t vTemp = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + // Compare to infinity + vTemp = vceqq_f32(vreinterpretq_f32_u32(vTemp), g_XMInfinity); + // If any are infinity, the signs are true. + return vreinterpretq_f32_u32(vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If any are infinity, the signs are true. + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +// Rounding and clamping operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMin +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + (V1.vector4_f32[0] < V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0], + (V1.vector4_f32[1] < V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1], + (V1.vector4_f32[2] < V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2], + (V1.vector4_f32[3] < V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vminq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_min_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMax +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + (V1.vector4_f32[0] > V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0], + (V1.vector4_f32[1] > V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1], + (V1.vector4_f32[2] > V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2], + (V1.vector4_f32[3] > V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vmaxq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_max_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +namespace MathInternal +{ + // Round to nearest (even) a.k.a. banker's rounding + inline float round_to_nearest(float x) noexcept + { + float i = floorf(x); + x -= i; + if (x < 0.5f) + return i; + if (x > 0.5f) + return i + 1.f; + + float int_part; + (void)modff(i / 2.f, &int_part); + if ((2.f * int_part) == i) + { + return i; + } + + return i + 1.f; + } +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + MathInternal::round_to_nearest(V.vector4_f32[0]), + MathInternal::round_to_nearest(V.vector4_f32[1]), + MathInternal::round_to_nearest(V.vector4_f32[2]), + MathInternal::round_to_nearest(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndnq_f32(V); +#else + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(V), g_XMNegativeZero); + float32x4_t sMagic = vreinterpretq_f32_u32(vorrq_u32(g_XMNoFraction, sign)); + float32x4_t R1 = vaddq_f32(V, sMagic); + R1 = vsubq_f32(R1, sMagic); + float32x4_t R2 = vabsq_f32(V); + uint32x4_t mask = vcleq_f32(R2, g_XMNoFraction); + return vbslq_f32(mask, R1, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_round_ps(V, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); +#elif defined(_XM_SSE_INTRINSICS_) + __m128 sign = _mm_and_ps(V, g_XMNegativeZero); + __m128 sMagic = _mm_or_ps(g_XMNoFraction, sign); + __m128 R1 = _mm_add_ps(V, sMagic); + R1 = _mm_sub_ps(R1, sMagic); + __m128 R2 = _mm_and_ps(V, g_XMAbsMask); + __m128 mask = _mm_cmple_ps(R2, g_XMNoFraction); + R2 = _mm_andnot_ps(mask, V); + R1 = _mm_and_ps(R1, mask); + XMVECTOR vResult = _mm_xor_ps(R1, R2); + return vResult; +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTruncate(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + uint32_t i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (XMISNAN(V.vector4_f32[i])) + { + Result.vector4_u32[i] = 0x7FC00000; + } + else if (fabsf(V.vector4_f32[i]) < 8388608.0f) + { + Result.vector4_f32[i] = static_cast(static_cast(V.vector4_f32[i])); + } + else + { + Result.vector4_f32[i] = V.vector4_f32[i]; + } + } + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndq_f32(V); +#else + float32x4_t vTest = vabsq_f32(V); + vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); + + int32x4_t vInt = vcvtq_s32_f32(V); + float32x4_t vResult = vcvtq_f32_s32(vInt); + + // All numbers less than 8388608 will use the round to int + // All others, use the ORIGINAL value + return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_round_ps(V, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + // Get the abs value + __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF + vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); + // Convert to int and back to float for rounding with truncation + __m128i vInt = _mm_cvttps_epi32(V); + // Convert back to floats + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); + vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorFloor(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + floorf(V.vector4_f32[0]), + floorf(V.vector4_f32[1]), + floorf(V.vector4_f32[2]), + floorf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndmq_f32(V); +#else + float32x4_t vTest = vabsq_f32(V); + vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); + // Truncate + int32x4_t vInt = vcvtq_s32_f32(V); + float32x4_t vResult = vcvtq_f32_s32(vInt); + uint32x4_t vLargerMask = vcgtq_f32(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + float32x4_t vLarger = vcvtq_f32_s32(vreinterpretq_s32_u32(vLargerMask)); + vResult = vaddq_f32(vResult, vLarger); + // All numbers less than 8388608 will use the round to int + // All others, use the ORIGINAL value + return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_floor_ps(V); +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); + // Truncate + __m128i vInt = _mm_cvttps_epi32(V); + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + __m128 vLarger = _mm_cmpgt_ps(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + vLarger = _mm_cvtepi32_ps(_mm_castps_si128(vLarger)); + vResult = _mm_add_ps(vResult, vLarger); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); + vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCeiling(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + ceilf(V.vector4_f32[0]), + ceilf(V.vector4_f32[1]), + ceilf(V.vector4_f32[2]), + ceilf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vrndpq_f32(V); +#else + float32x4_t vTest = vabsq_f32(V); + vTest = vreinterpretq_f32_u32(vcltq_f32(vTest, g_XMNoFraction)); + // Truncate + int32x4_t vInt = vcvtq_s32_f32(V); + float32x4_t vResult = vcvtq_f32_s32(vInt); + uint32x4_t vSmallerMask = vcltq_f32(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + float32x4_t vSmaller = vcvtq_f32_s32(vreinterpretq_s32_u32(vSmallerMask)); + vResult = vsubq_f32(vResult, vSmaller); + // All numbers less than 8388608 will use the round to int + // All others, use the ORIGINAL value + return vbslq_f32(vreinterpretq_u32_f32(vTest), vResult, V); +#endif +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_ceil_ps(V); +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + __m128i vTest = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + vTest = _mm_cmplt_epi32(vTest, g_XMNoFraction); + // Truncate + __m128i vInt = _mm_cvttps_epi32(V); + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + __m128 vSmaller = _mm_cmplt_ps(vResult, V); + // 0 -> 0, 0xffffffff -> -1.0f + vSmaller = _mm_cvtepi32_ps(_mm_castps_si128(vSmaller)); + vResult = _mm_sub_ps(vResult, vSmaller); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult, _mm_castsi128_ps(vTest)); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest, _mm_castps_si128(V)); + vResult = _mm_or_ps(vResult, _mm_castsi128_ps(vTest)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorClamp +( + FXMVECTOR V, + FXMVECTOR Min, + FXMVECTOR Max +) noexcept +{ + assert(XMVector4LessOrEqual(Min, Max)); + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVectorMax(Min, V); + Result = XMVectorMin(Max, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(Min, V); + vResult = vminq_f32(Max, vResult); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult; + vResult = _mm_max_ps(Min, V); + vResult = _mm_min_ps(Max, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSaturate(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + return XMVectorClamp(V, Zero, g_XMOne.v); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Set <0 to 0 + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + // Set>1 to 1 + return vminq_f32(vResult, vdupq_n_f32(1.0f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Set>1 to 1 + return _mm_min_ps(vResult, g_XMOne); +#endif +} + +//------------------------------------------------------------------------------ +// Bitwise logical operations +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAndInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] & V2.vector4_u32[0], + V1.vector4_u32[1] & V2.vector4_u32[1], + V1.vector4_u32[2] & V2.vector4_u32[2], + V1.vector4_u32[3] & V2.vector4_u32[3] + } } }; + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_and_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAndCInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] & ~V2.vector4_u32[0], + V1.vector4_u32[1] & ~V2.vector4_u32[1], + V1.vector4_u32[2] & ~V2.vector4_u32[2], + V1.vector4_u32[3] & ~V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_andnot_si128(_mm_castps_si128(V2), _mm_castps_si128(V1)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorOrInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] | V2.vector4_u32[0], + V1.vector4_u32[1] | V2.vector4_u32[1], + V1.vector4_u32[2] | V2.vector4_u32[2], + V1.vector4_u32[3] | V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_or_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + ~(V1.vector4_u32[0] | V2.vector4_u32[0]), + ~(V1.vector4_u32[1] | V2.vector4_u32[1]), + ~(V1.vector4_u32[2] | V2.vector4_u32[2]), + ~(V1.vector4_u32[3] | V2.vector4_u32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t Result = vorrq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + return vreinterpretq_f32_u32(vbicq_u32(g_XMNegOneMask, Result)); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i Result; + Result = _mm_or_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); + Result = _mm_andnot_si128(Result, g_XMNegOneMask); + return _mm_castsi128_ps(Result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorXorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORU32 Result = { { { + V1.vector4_u32[0] ^ V2.vector4_u32[0], + V1.vector4_u32[1] ^ V2.vector4_u32[1], + V1.vector4_u32[2] ^ V2.vector4_u32[2], + V1.vector4_u32[3] ^ V2.vector4_u32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2))); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_xor_si128(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return _mm_castsi128_ps(V); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNegate(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + -V.vector4_f32[0], + -V.vector4_f32[1], + -V.vector4_f32[2], + -V.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vnegq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Z; + + Z = _mm_setzero_ps(); + + return _mm_sub_ps(Z, V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAdd +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V1.vector4_f32[0] + V2.vector4_f32[0], + V1.vector4_f32[1] + V2.vector4_f32[1], + V1.vector4_f32[2] + V2.vector4_f32[2], + V1.vector4_f32[3] + V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vaddq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_add_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSum(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result; + Result.f[0] = + Result.f[1] = + Result.f[2] = + Result.f[3] = V.vector4_f32[0] + V.vector4_f32[1] + V.vector4_f32[2] + V.vector4_f32[3]; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t vTemp = vpaddq_f32(V, V); + return vpaddq_f32(vTemp, vTemp); +#else + float32x2_t v1 = vget_low_f32(V); + float32x2_t v2 = vget_high_f32(V); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + return vcombine_f32(v1, v1); +#endif +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vTemp = _mm_hadd_ps(V, V); + return _mm_hadd_ps(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 3, 0, 1)); + XMVECTOR vTemp2 = _mm_add_ps(V, vTemp); + vTemp = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(1, 0, 3, 2)); + return _mm_add_ps(vTemp, vTemp2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAddAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + // Add the given angles together. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + XMVECTOR Result = XMVectorAdd(V1, V2); + + XMVECTOR Mask = XMVectorLess(Result, g_XMNegativePi.v); + XMVECTOR Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Adjust the angles + float32x4_t vResult = vaddq_f32(V1, V2); + // Less than Pi? + uint32x4_t vOffset = vcltq_f32(vResult, g_XMNegativePi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = vaddq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + // Greater than or equal to Pi? + vOffset = vcgeq_f32(vResult, g_XMPi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = vsubq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_add_ps(V1, V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult, g_XMNegativePi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult, vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult, g_XMPi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult, vOffset); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSubtract +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V1.vector4_f32[0] - V2.vector4_f32[0], + V1.vector4_f32[1] - V2.vector4_f32[1], + V1.vector4_f32[2] - V2.vector4_f32[2], + V1.vector4_f32[3] - V2.vector4_f32[3] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vsubq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sub_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSubtractAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + // Subtract the given angles. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + XMVECTOR Result = XMVectorSubtract(V1, V2); + + XMVECTOR Mask = XMVectorLess(Result, g_XMNegativePi.v); + XMVECTOR Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = vsubq_f32(V1, V2); + // Less than Pi? + uint32x4_t vOffset = vcltq_f32(vResult, g_XMNegativePi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = vaddq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + // Greater than or equal to Pi? + vOffset = vcgeq_f32(vResult, g_XMPi); + vOffset = vandq_u32(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = vsubq_f32(vResult, vreinterpretq_f32_u32(vOffset)); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_sub_ps(V1, V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult, g_XMNegativePi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult, vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult, g_XMPi); + vOffset = _mm_and_ps(vOffset, g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult, vOffset); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMultiply +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V1.vector4_f32[0] * V2.vector4_f32[0], + V1.vector4_f32[1] * V2.vector4_f32[1], + V1.vector4_f32[2] * V2.vector4_f32[2], + V1.vector4_f32[3] * V2.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vmulq_f32(V1, V2); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_mul_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMultiplyAdd +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V1.vector4_f32[0] * V2.vector4_f32[0] + V3.vector4_f32[0], + V1.vector4_f32[1] * V2.vector4_f32[1] + V3.vector4_f32[1], + V1.vector4_f32[2] * V2.vector4_f32[2] + V3.vector4_f32[2], + V1.vector4_f32[3] * V2.vector4_f32[3] + V3.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vfmaq_f32(V3, V1, V2); +#else + return vmlaq_f32(V3, V1, V2); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return XM_FMADD_PS(V1, V2, V3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorDivide +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V1.vector4_f32[0] / V2.vector4_f32[0], + V1.vector4_f32[1] / V2.vector4_f32[1], + V1.vector4_f32[2] / V2.vector4_f32[2], + V1.vector4_f32[3] / V2.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vdivq_f32(V1, V2); +#else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(V2); + float32x4_t S = vrecpsq_f32(Reciprocal, V2); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, V2); + Reciprocal = vmulq_f32(S, Reciprocal); + return vmulq_f32(V1, Reciprocal); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps(V1, V2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorNegativeMultiplySubtract +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V3.vector4_f32[0] - (V1.vector4_f32[0] * V2.vector4_f32[0]), + V3.vector4_f32[1] - (V1.vector4_f32[1] * V2.vector4_f32[1]), + V3.vector4_f32[2] - (V1.vector4_f32[2] * V2.vector4_f32[2]), + V3.vector4_f32[3] - (V1.vector4_f32[3] * V2.vector4_f32[3]) + } } }; + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + return vfmsq_f32(V3, V1, V2); +#else + return vmlsq_f32(V3, V1, V2); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return XM_FNMADD_PS(V1, V2, V3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorScale +( + FXMVECTOR V, + float ScaleFactor +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + V.vector4_f32[0] * ScaleFactor, + V.vector4_f32[1] * ScaleFactor, + V.vector4_f32[2] * ScaleFactor, + V.vector4_f32[3] * ScaleFactor + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vmulq_n_f32(V, ScaleFactor); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_set_ps1(ScaleFactor); + return _mm_mul_ps(vResult, V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocalEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / V.vector4_f32[0], + 1.f / V.vector4_f32[1], + 1.f / V.vector4_f32[2], + 1.f / V.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vrecpeq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rcp_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocal(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / V.vector4_f32[0], + 1.f / V.vector4_f32[1], + 1.f / V.vector4_f32[2], + 1.f / V.vector4_f32[3] + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + float32x4_t one = vdupq_n_f32(1.0f); + return vdivq_f32(one, V); +#else + // 2 iterations of Newton-Raphson refinement + float32x4_t Reciprocal = vrecpeq_f32(V); + float32x4_t S = vrecpsq_f32(Reciprocal, V); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, V); + return vmulq_f32(S, Reciprocal); +#endif +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps(g_XMOne, V); +#endif +} + +//------------------------------------------------------------------------------ +// Return an estimated square root +inline XMVECTOR XM_CALLCONV XMVectorSqrtEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sqrtf(V.vector4_f32[0]), + sqrtf(V.vector4_f32[1]), + sqrtf(V.vector4_f32[2]), + sqrtf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // 1 iteration of Newton-Raphson refinment of sqrt + float32x4_t S0 = vrsqrteq_f32(V); + float32x4_t P0 = vmulq_f32(V, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + + XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + XMVECTOR VEqualsZero = XMVectorEqual(V, vdupq_n_f32(0)); + XMVECTOR Result = vmulq_f32(V, S1); + XMVECTOR Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + return XMVectorSelect(V, Result, Select); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSqrt(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sqrtf(V.vector4_f32[0]), + sqrtf(V.vector4_f32[1]), + sqrtf(V.vector4_f32[2]), + sqrtf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // 3 iterations of Newton-Raphson refinment of sqrt + float32x4_t S0 = vrsqrteq_f32(V); + float32x4_t P0 = vmulq_f32(V, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(V, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + float32x4_t S2 = vmulq_f32(S1, R1); + float32x4_t P2 = vmulq_f32(V, S2); + float32x4_t R2 = vrsqrtsq_f32(P2, S2); + float32x4_t S3 = vmulq_f32(S2, R2); + + XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + XMVECTOR VEqualsZero = XMVectorEqual(V, vdupq_n_f32(0)); + XMVECTOR Result = vmulq_f32(V, S3); + XMVECTOR Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + return XMVectorSelect(V, Result, Select); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrtEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / sqrtf(V.vector4_f32[0]), + 1.f / sqrtf(V.vector4_f32[1]), + 1.f / sqrtf(V.vector4_f32[2]), + 1.f / sqrtf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vrsqrteq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rsqrt_ps(V); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + 1.f / sqrtf(V.vector4_f32[0]), + 1.f / sqrtf(V.vector4_f32[1]), + 1.f / sqrtf(V.vector4_f32[2]), + 1.f / sqrtf(V.vector4_f32[3]) + } } }; + return Result; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t S0 = vrsqrteq_f32(V); + + float32x4_t P0 = vmulq_f32(V, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(V, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + + return vmulq_f32(S1, R1); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_sqrt_ps(V); + vResult = _mm_div_ps(g_XMOne, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + exp2f(V.vector4_f32[0]), + exp2f(V.vector4_f32[1]), + exp2f(V.vector4_f32[2]), + exp2f(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t itrunc = vcvtq_s32_f32(V); + float32x4_t ftrunc = vcvtq_f32_s32(itrunc); + float32x4_t y = vsubq_f32(V, ftrunc); + + float32x4_t poly = vmlaq_f32(g_XMExpEst6, g_XMExpEst7, y); + poly = vmlaq_f32(g_XMExpEst5, poly, y); + poly = vmlaq_f32(g_XMExpEst4, poly, y); + poly = vmlaq_f32(g_XMExpEst3, poly, y); + poly = vmlaq_f32(g_XMExpEst2, poly, y); + poly = vmlaq_f32(g_XMExpEst1, poly, y); + poly = vmlaq_f32(g_XMOne, poly, y); + + int32x4_t biased = vaddq_s32(itrunc, g_XMExponentBias); + biased = vshlq_n_s32(biased, 23); + float32x4_t result0 = XMVectorDivide(vreinterpretq_f32_s32(biased), poly); + + biased = vaddq_s32(itrunc, g_XM253); + biased = vshlq_n_s32(biased, 23); + float32x4_t result1 = XMVectorDivide(vreinterpretq_f32_s32(biased), poly); + result1 = vmulq_f32(g_XMMinNormal.v, result1); + + // Use selection to handle the cases + // if (V is NaN) -> QNaN; + // else if (V sign bit set) + // if (V > -150) + // if (V.exponent < -126) -> result1 + // else -> result0 + // else -> +0 + // else + // if (V < 128) -> result0 + // else -> +inf + + uint32x4_t comp = vcltq_s32(vreinterpretq_s32_f32(V), g_XMBin128); + float32x4_t result2 = vbslq_f32(comp, result0, g_XMInfinity); + + comp = vcltq_s32(itrunc, g_XMSubnormalExponent); + float32x4_t result3 = vbslq_f32(comp, result1, result0); + + comp = vcltq_s32(vreinterpretq_s32_f32(V), g_XMBinNeg150); + float32x4_t result4 = vbslq_f32(comp, result3, g_XMZero); + + int32x4_t sign = vandq_s32(vreinterpretq_s32_f32(V), g_XMNegativeZero); + comp = vceqq_s32(sign, g_XMNegativeZero); + float32x4_t result5 = vbslq_f32(comp, result4, result2); + + int32x4_t t0 = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + int32x4_t t1 = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + t0 = vreinterpretq_s32_u32(vceqq_s32(t0, g_XMZero)); + t1 = vreinterpretq_s32_u32(vceqq_s32(t1, g_XMInfinity)); + int32x4_t isNaN = vbicq_s32(t1, t0); + + float32x4_t vResult = vbslq_f32(vreinterpretq_u32_s32(isNaN), g_XMQNaN, result5); + return vResult; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_exp2_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i itrunc = _mm_cvttps_epi32(V); + __m128 ftrunc = _mm_cvtepi32_ps(itrunc); + __m128 y = _mm_sub_ps(V, ftrunc); + + __m128 poly = XM_FMADD_PS(g_XMExpEst7, y, g_XMExpEst6); + poly = XM_FMADD_PS(poly, y, g_XMExpEst5); + poly = XM_FMADD_PS(poly, y, g_XMExpEst4); + poly = XM_FMADD_PS(poly, y, g_XMExpEst3); + poly = XM_FMADD_PS(poly, y, g_XMExpEst2); + poly = XM_FMADD_PS(poly, y, g_XMExpEst1); + poly = XM_FMADD_PS(poly, y, g_XMOne); + + __m128i biased = _mm_add_epi32(itrunc, g_XMExponentBias); + biased = _mm_slli_epi32(biased, 23); + __m128 result0 = _mm_div_ps(_mm_castsi128_ps(biased), poly); + + biased = _mm_add_epi32(itrunc, g_XM253); + biased = _mm_slli_epi32(biased, 23); + __m128 result1 = _mm_div_ps(_mm_castsi128_ps(biased), poly); + result1 = _mm_mul_ps(g_XMMinNormal.v, result1); + + // Use selection to handle the cases + // if (V is NaN) -> QNaN; + // else if (V sign bit set) + // if (V > -150) + // if (V.exponent < -126) -> result1 + // else -> result0 + // else -> +0 + // else + // if (V < 128) -> result0 + // else -> +inf + + __m128i comp = _mm_cmplt_epi32(_mm_castps_si128(V), g_XMBin128); + __m128i select0 = _mm_and_si128(comp, _mm_castps_si128(result0)); + __m128i select1 = _mm_andnot_si128(comp, g_XMInfinity); + __m128i result2 = _mm_or_si128(select0, select1); + + comp = _mm_cmplt_epi32(itrunc, g_XMSubnormalExponent); + select1 = _mm_and_si128(comp, _mm_castps_si128(result1)); + select0 = _mm_andnot_si128(comp, _mm_castps_si128(result0)); + __m128i result3 = _mm_or_si128(select0, select1); + + comp = _mm_cmplt_epi32(_mm_castps_si128(V), g_XMBinNeg150); + select0 = _mm_and_si128(comp, result3); + select1 = _mm_andnot_si128(comp, g_XMZero); + __m128i result4 = _mm_or_si128(select0, select1); + + __m128i sign = _mm_and_si128(_mm_castps_si128(V), g_XMNegativeZero); + comp = _mm_cmpeq_epi32(sign, g_XMNegativeZero); + select0 = _mm_and_si128(comp, result4); + select1 = _mm_andnot_si128(comp, result2); + __m128i result5 = _mm_or_si128(select0, select1); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result5); + __m128i vResult = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(vResult); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExp10(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + powf(10.0f, V.vector4_f32[0]), + powf(10.0f, V.vector4_f32[1]), + powf(10.0f, V.vector4_f32[2]), + powf(10.0f, V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_exp10_ps(V); + return Result; +#else + // exp10(V) = exp2(vin*log2(10)) + XMVECTOR Vten = XMVectorMultiply(g_XMLg10, V); + return XMVectorExp2(Vten); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExpE(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + expf(V.vector4_f32[0]), + expf(V.vector4_f32[1]), + expf(V.vector4_f32[2]), + expf(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_exp_ps(V); + return Result; +#else + // expE(V) = exp2(vin*log2(e)) + XMVECTOR Ve = XMVectorMultiply(g_XMLgE, V); + return XMVectorExp2(Ve); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept +{ + return XMVectorExp2(V); +} + +//------------------------------------------------------------------------------ + +#if defined(_XM_SSE_INTRINSICS_) + +namespace MathInternal +{ + inline __m128i multi_sll_epi32(__m128i value, __m128i count) noexcept + { + __m128i v = _mm_shuffle_epi32(value, _MM_SHUFFLE(0, 0, 0, 0)); + __m128i c = _mm_shuffle_epi32(count, _MM_SHUFFLE(0, 0, 0, 0)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r0 = _mm_sll_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r1 = _mm_sll_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r2 = _mm_sll_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r3 = _mm_sll_epi32(v, c); + + // (r0,r0,r1,r1) + __m128 r01 = _mm_shuffle_ps(_mm_castsi128_ps(r0), _mm_castsi128_ps(r1), _MM_SHUFFLE(0, 0, 0, 0)); + // (r2,r2,r3,r3) + __m128 r23 = _mm_shuffle_ps(_mm_castsi128_ps(r2), _mm_castsi128_ps(r3), _MM_SHUFFLE(0, 0, 0, 0)); + // (r0,r1,r2,r3) + __m128 result = _mm_shuffle_ps(r01, r23, _MM_SHUFFLE(2, 0, 2, 0)); + return _mm_castps_si128(result); + } + + inline __m128i multi_srl_epi32(__m128i value, __m128i count) noexcept + { + __m128i v = _mm_shuffle_epi32(value, _MM_SHUFFLE(0, 0, 0, 0)); + __m128i c = _mm_shuffle_epi32(count, _MM_SHUFFLE(0, 0, 0, 0)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r0 = _mm_srl_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(1, 1, 1, 1)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r1 = _mm_srl_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(2, 2, 2, 2)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r2 = _mm_srl_epi32(v, c); + + v = _mm_shuffle_epi32(value, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_shuffle_epi32(count, _MM_SHUFFLE(3, 3, 3, 3)); + c = _mm_and_si128(c, g_XMMaskX); + __m128i r3 = _mm_srl_epi32(v, c); + + // (r0,r0,r1,r1) + __m128 r01 = _mm_shuffle_ps(_mm_castsi128_ps(r0), _mm_castsi128_ps(r1), _MM_SHUFFLE(0, 0, 0, 0)); + // (r2,r2,r3,r3) + __m128 r23 = _mm_shuffle_ps(_mm_castsi128_ps(r2), _mm_castsi128_ps(r3), _MM_SHUFFLE(0, 0, 0, 0)); + // (r0,r1,r2,r3) + __m128 result = _mm_shuffle_ps(r01, r23, _MM_SHUFFLE(2, 0, 2, 0)); + return _mm_castps_si128(result); + } + + inline __m128i GetLeadingBit(const __m128i value) noexcept + { + static const XMVECTORI32 g_XM0000FFFF = { { { 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF } } }; + static const XMVECTORI32 g_XM000000FF = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; + static const XMVECTORI32 g_XM0000000F = { { { 0x0000000F, 0x0000000F, 0x0000000F, 0x0000000F } } }; + static const XMVECTORI32 g_XM00000003 = { { { 0x00000003, 0x00000003, 0x00000003, 0x00000003 } } }; + + __m128i v = value, r, c, b, s; + + c = _mm_cmpgt_epi32(v, g_XM0000FFFF); // c = (v > 0xFFFF) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + r = _mm_slli_epi32(b, 4); // r = (b << 4) + v = multi_srl_epi32(v, r); // v = (v >> r) + + c = _mm_cmpgt_epi32(v, g_XM000000FF); // c = (v > 0xFF) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + s = _mm_slli_epi32(b, 3); // s = (b << 3) + v = multi_srl_epi32(v, s); // v = (v >> s) + r = _mm_or_si128(r, s); // r = (r | s) + + c = _mm_cmpgt_epi32(v, g_XM0000000F); // c = (v > 0xF) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + s = _mm_slli_epi32(b, 2); // s = (b << 2) + v = multi_srl_epi32(v, s); // v = (v >> s) + r = _mm_or_si128(r, s); // r = (r | s) + + c = _mm_cmpgt_epi32(v, g_XM00000003); // c = (v > 0x3) + b = _mm_srli_epi32(c, 31); // b = (c ? 1 : 0) + s = _mm_slli_epi32(b, 1); // s = (b << 1) + v = multi_srl_epi32(v, s); // v = (v >> s) + r = _mm_or_si128(r, s); // r = (r | s) + + s = _mm_srli_epi32(v, 1); + r = _mm_or_si128(r, s); + return r; + } +} // namespace MathInternal + +#endif // _XM_SSE_INTRINSICS_ + +#if defined(_XM_ARM_NEON_INTRINSICS_) + +namespace MathInternal +{ + inline int32x4_t GetLeadingBit(const int32x4_t value) noexcept + { + static const XMVECTORI32 g_XM0000FFFF = { { { 0x0000FFFF, 0x0000FFFF, 0x0000FFFF, 0x0000FFFF } } }; + static const XMVECTORI32 g_XM000000FF = { { { 0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF } } }; + static const XMVECTORI32 g_XM0000000F = { { { 0x0000000F, 0x0000000F, 0x0000000F, 0x0000000F } } }; + static const XMVECTORI32 g_XM00000003 = { { { 0x00000003, 0x00000003, 0x00000003, 0x00000003 } } }; + + uint32x4_t c = vcgtq_s32(value, g_XM0000FFFF); // c = (v > 0xFFFF) + int32x4_t b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + int32x4_t r = vshlq_n_s32(b, 4); // r = (b << 4) + r = vnegq_s32(r); + int32x4_t v = vshlq_s32(value, r); // v = (v >> r) + + c = vcgtq_s32(v, g_XM000000FF); // c = (v > 0xFF) + b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + int32x4_t s = vshlq_n_s32(b, 3); // s = (b << 3) + s = vnegq_s32(s); + v = vshlq_s32(v, s); // v = (v >> s) + r = vorrq_s32(r, s); // r = (r | s) + + c = vcgtq_s32(v, g_XM0000000F); // c = (v > 0xF) + b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + s = vshlq_n_s32(b, 2); // s = (b << 2) + s = vnegq_s32(s); + v = vshlq_s32(v, s); // v = (v >> s) + r = vorrq_s32(r, s); // r = (r | s) + + c = vcgtq_s32(v, g_XM00000003); // c = (v > 0x3) + b = vshrq_n_s32(vreinterpretq_s32_u32(c), 31); // b = (c ? 1 : 0) + s = vshlq_n_s32(b, 1); // s = (b << 1) + s = vnegq_s32(s); + v = vshlq_s32(v, s); // v = (v >> s) + r = vorrq_s32(r, s); // r = (r | s) + + s = vshrq_n_s32(v, 1); + r = vorrq_s32(r, s); + return r; + } + +} // namespace MathInternal + +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + log2f(V.vector4_f32[0]), + log2f(V.vector4_f32[1]), + log2f(V.vector4_f32[2]), + log2f(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + uint32x4_t isExponentZero = vceqq_s32(vreinterpretq_s32_f32(g_XMZero), rawBiased); + + // Compute exponent and significand for normals. + int32x4_t biased = vshrq_n_s32(rawBiased, 23); + int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); + int32x4_t trailingNor = trailing; + + // Compute exponent and significand for subnormals. + int32x4_t leading = MathInternal::GetLeadingBit(trailing); + int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); + int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); + int32x4_t trailingSub = vshlq_s32(trailing, shift); + trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); + int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); + int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); + + // Compute the approximation. + int32x4_t tmp = vorrq_s32(vreinterpretq_s32_f32(g_XMOne), t); + float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); + + float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); + log2 = vmlaq_f32(g_XMLogEst5, log2, y); + log2 = vmlaq_f32(g_XMLogEst4, log2, y); + log2 = vmlaq_f32(g_XMLogEst3, log2, y); + log2 = vmlaq_f32(g_XMLogEst2, log2, y); + log2 = vmlaq_f32(g_XMLogEst1, log2, y); + log2 = vmlaq_f32(g_XMLogEst0, log2, y); + log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isInfinite = vceqq_u32(isInfinite, g_XMInfinity); + + uint32x4_t isGreaterZero = vcgtq_f32(V, g_XMZero); + uint32x4_t isNotFinite = vcgtq_f32(V, g_XMInfinity); + uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); + + uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isZero = vceqq_u32(isZero, g_XMZero); + + uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); + uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); + t0 = vceqq_u32(t0, g_XMZero); + t1 = vceqq_u32(t1, g_XMInfinity); + uint32x4_t isNaN = vbicq_u32(t1, t0); + + float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); + float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); + result = vbslq_f32(isPositive, result, tmp2); + result = vbslq_f32(isNaN, g_XMQNaN, result); + return result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_log2_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + __m128i biased = _mm_srli_epi32(rawBiased, 23); + __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); + __m128i trailingNor = trailing; + + // Compute exponent and significand for subnormals. + __m128i leading = MathInternal::GetLeadingBit(trailing); + __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); + __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); + __m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift); + trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); + + __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); + __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); + __m128i e = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isExponentZero, trailingSub); + select1 = _mm_andnot_si128(isExponentZero, trailingNor); + __m128i t = _mm_or_si128(select0, select1); + + // Compute the approximation. + __m128i tmp = _mm_or_si128(g_XMOne, t); + __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); + + __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); + log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); + + __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); + __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); + __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); + + __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isZero = _mm_cmpeq_epi32(isZero, g_XMZero); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isInfinite, g_XMInfinity); + select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); + __m128i result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isZero, g_XMNegInfinity); + select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); + tmp = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isPositive, result); + select1 = _mm_andnot_si128(isPositive, tmp); + result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result); + result = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + log10f(V.vector4_f32[0]), + log10f(V.vector4_f32[1]), + log10f(V.vector4_f32[2]), + log10f(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + uint32x4_t isExponentZero = vceqq_s32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + int32x4_t biased = vshrq_n_s32(rawBiased, 23); + int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); + int32x4_t trailingNor = trailing; + + // Compute exponent and significand for subnormals. + int32x4_t leading = MathInternal::GetLeadingBit(trailing); + int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); + int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); + int32x4_t trailingSub = vshlq_s32(trailing, shift); + trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); + int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); + int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); + + // Compute the approximation. + int32x4_t tmp = vorrq_s32(g_XMOne, t); + float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); + + float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); + log2 = vmlaq_f32(g_XMLogEst5, log2, y); + log2 = vmlaq_f32(g_XMLogEst4, log2, y); + log2 = vmlaq_f32(g_XMLogEst3, log2, y); + log2 = vmlaq_f32(g_XMLogEst2, log2, y); + log2 = vmlaq_f32(g_XMLogEst1, log2, y); + log2 = vmlaq_f32(g_XMLogEst0, log2, y); + log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); + + log2 = vmulq_f32(g_XMInvLg10, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isInfinite = vceqq_u32(isInfinite, g_XMInfinity); + + uint32x4_t isGreaterZero = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMZero); + uint32x4_t isNotFinite = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); + + uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isZero = vceqq_u32(isZero, g_XMZero); + + uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); + uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); + t0 = vceqq_u32(t0, g_XMZero); + t1 = vceqq_u32(t1, g_XMInfinity); + uint32x4_t isNaN = vbicq_u32(t1, t0); + + float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); + float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); + result = vbslq_f32(isPositive, result, tmp2); + result = vbslq_f32(isNaN, g_XMQNaN, result); + return result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_log10_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + __m128i biased = _mm_srli_epi32(rawBiased, 23); + __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); + __m128i trailingNor = trailing; + + // Compute exponent and significand for subnormals. + __m128i leading = MathInternal::GetLeadingBit(trailing); + __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); + __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); + __m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift); + trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); + + __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); + __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); + __m128i e = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isExponentZero, trailingSub); + select1 = _mm_andnot_si128(isExponentZero, trailingNor); + __m128i t = _mm_or_si128(select0, select1); + + // Compute the approximation. + __m128i tmp = _mm_or_si128(g_XMOne, t); + __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); + + __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); + log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); + + log2 = _mm_mul_ps(g_XMInvLg10, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); + + __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); + __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); + __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); + + __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isZero = _mm_cmpeq_epi32(isZero, g_XMZero); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isInfinite, g_XMInfinity); + select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); + __m128i result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isZero, g_XMNegInfinity); + select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); + tmp = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isPositive, result); + select1 = _mm_andnot_si128(isPositive, tmp); + result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result); + result = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + logf(V.vector4_f32[0]), + logf(V.vector4_f32[1]), + logf(V.vector4_f32[2]), + logf(V.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int32x4_t rawBiased = vandq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + int32x4_t trailing = vandq_s32(vreinterpretq_s32_f32(V), g_XMQNaNTest); + uint32x4_t isExponentZero = vceqq_s32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + int32x4_t biased = vshrq_n_s32(rawBiased, 23); + int32x4_t exponentNor = vsubq_s32(biased, g_XMExponentBias); + int32x4_t trailingNor = trailing; + + // Compute exponent and significand for subnormals. + int32x4_t leading = MathInternal::GetLeadingBit(trailing); + int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading); + int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift); + int32x4_t trailingSub = vshlq_s32(trailing, shift); + trailingSub = vandq_s32(trailingSub, g_XMQNaNTest); + int32x4_t e = vbslq_s32(isExponentZero, exponentSub, exponentNor); + int32x4_t t = vbslq_s32(isExponentZero, trailingSub, trailingNor); + + // Compute the approximation. + int32x4_t tmp = vorrq_s32(g_XMOne, t); + float32x4_t y = vsubq_f32(vreinterpretq_f32_s32(tmp), g_XMOne); + + float32x4_t log2 = vmlaq_f32(g_XMLogEst6, g_XMLogEst7, y); + log2 = vmlaq_f32(g_XMLogEst5, log2, y); + log2 = vmlaq_f32(g_XMLogEst4, log2, y); + log2 = vmlaq_f32(g_XMLogEst3, log2, y); + log2 = vmlaq_f32(g_XMLogEst2, log2, y); + log2 = vmlaq_f32(g_XMLogEst1, log2, y); + log2 = vmlaq_f32(g_XMLogEst0, log2, y); + log2 = vmlaq_f32(vcvtq_f32_s32(e), log2, y); + + log2 = vmulq_f32(g_XMInvLgE, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + uint32x4_t isInfinite = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isInfinite = vceqq_u32(isInfinite, g_XMInfinity); + + uint32x4_t isGreaterZero = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMZero); + uint32x4_t isNotFinite = vcgtq_s32(vreinterpretq_s32_f32(V), g_XMInfinity); + uint32x4_t isPositive = vbicq_u32(isGreaterZero, isNotFinite); + + uint32x4_t isZero = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + isZero = vceqq_u32(isZero, g_XMZero); + + uint32x4_t t0 = vandq_u32(vreinterpretq_u32_f32(V), g_XMQNaNTest); + uint32x4_t t1 = vandq_u32(vreinterpretq_u32_f32(V), g_XMInfinity); + t0 = vceqq_u32(t0, g_XMZero); + t1 = vceqq_u32(t1, g_XMInfinity); + uint32x4_t isNaN = vbicq_u32(t1, t0); + + float32x4_t result = vbslq_f32(isInfinite, g_XMInfinity, log2); + float32x4_t tmp2 = vbslq_f32(isZero, g_XMNegInfinity, g_XMNegQNaN); + result = vbslq_f32(isPositive, result, tmp2); + result = vbslq_f32(isNaN, g_XMQNaN, result); + return result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_log_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i rawBiased = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + __m128i trailing = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i isExponentZero = _mm_cmpeq_epi32(g_XMZero, rawBiased); + + // Compute exponent and significand for normals. + __m128i biased = _mm_srli_epi32(rawBiased, 23); + __m128i exponentNor = _mm_sub_epi32(biased, g_XMExponentBias); + __m128i trailingNor = trailing; + + // Compute exponent and significand for subnormals. + __m128i leading = MathInternal::GetLeadingBit(trailing); + __m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading); + __m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift); + __m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift); + trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest); + + __m128i select0 = _mm_and_si128(isExponentZero, exponentSub); + __m128i select1 = _mm_andnot_si128(isExponentZero, exponentNor); + __m128i e = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isExponentZero, trailingSub); + select1 = _mm_andnot_si128(isExponentZero, trailingNor); + __m128i t = _mm_or_si128(select0, select1); + + // Compute the approximation. + __m128i tmp = _mm_or_si128(g_XMOne, t); + __m128 y = _mm_sub_ps(_mm_castsi128_ps(tmp), g_XMOne); + + __m128 log2 = XM_FMADD_PS(g_XMLogEst7, y, g_XMLogEst6); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst5); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst4); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst3); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst2); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst1); + log2 = XM_FMADD_PS(log2, y, g_XMLogEst0); + log2 = XM_FMADD_PS(log2, y, _mm_cvtepi32_ps(e)); + + log2 = _mm_mul_ps(g_XMInvLgE, log2); + + // if (x is NaN) -> QNaN + // else if (V is positive) + // if (V is infinite) -> +inf + // else -> log2(V) + // else + // if (V is zero) -> -inf + // else -> -QNaN + + __m128i isInfinite = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isInfinite = _mm_cmpeq_epi32(isInfinite, g_XMInfinity); + + __m128i isGreaterZero = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMZero); + __m128i isNotFinite = _mm_cmpgt_epi32(_mm_castps_si128(V), g_XMInfinity); + __m128i isPositive = _mm_andnot_si128(isNotFinite, isGreaterZero); + + __m128i isZero = _mm_and_si128(_mm_castps_si128(V), g_XMAbsMask); + isZero = _mm_cmpeq_epi32(isZero, g_XMZero); + + __m128i t0 = _mm_and_si128(_mm_castps_si128(V), g_XMQNaNTest); + __m128i t1 = _mm_and_si128(_mm_castps_si128(V), g_XMInfinity); + t0 = _mm_cmpeq_epi32(t0, g_XMZero); + t1 = _mm_cmpeq_epi32(t1, g_XMInfinity); + __m128i isNaN = _mm_andnot_si128(t0, t1); + + select0 = _mm_and_si128(isInfinite, g_XMInfinity); + select1 = _mm_andnot_si128(isInfinite, _mm_castps_si128(log2)); + __m128i result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isZero, g_XMNegInfinity); + select1 = _mm_andnot_si128(isZero, g_XMNegQNaN); + tmp = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isPositive, result); + select1 = _mm_andnot_si128(isPositive, tmp); + result = _mm_or_si128(select0, select1); + + select0 = _mm_and_si128(isNaN, g_XMQNaN); + select1 = _mm_andnot_si128(isNaN, result); + result = _mm_or_si128(select0, select1); + + return _mm_castsi128_ps(result); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLog(FXMVECTOR V) noexcept +{ + return XMVectorLog2(V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorPow +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + powf(V1.vector4_f32[0], V2.vector4_f32[0]), + powf(V1.vector4_f32[1], V2.vector4_f32[1]), + powf(V1.vector4_f32[2], V2.vector4_f32[2]), + powf(V1.vector4_f32[3], V2.vector4_f32[3]) + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTORF32 vResult = { { { + powf(vgetq_lane_f32(V1, 0), vgetq_lane_f32(V2, 0)), + powf(vgetq_lane_f32(V1, 1), vgetq_lane_f32(V2, 1)), + powf(vgetq_lane_f32(V1, 2), vgetq_lane_f32(V2, 2)), + powf(vgetq_lane_f32(V1, 3), vgetq_lane_f32(V2, 3)) + } } }; + return vResult.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_pow_ps(V1, V2); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + XM_ALIGNED_DATA(16) float a[4]; + XM_ALIGNED_DATA(16) float b[4]; + _mm_store_ps(a, V1); + _mm_store_ps(b, V2); + XMVECTOR vResult = _mm_setr_ps( + powf(a[0], b[0]), + powf(a[1], b[1]), + powf(a[2], b[2]), + powf(a[3], b[3])); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorAbs(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + fabsf(V.vector4_f32[0]), + fabsf(V.vector4_f32[1]), + fabsf(V.vector4_f32[2]), + fabsf(V.vector4_f32[3]) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + return vabsq_f32(V); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setzero_ps(); + vResult = _mm_sub_ps(vResult, V); + vResult = _mm_max_ps(vResult, V); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorMod +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + // V1 % V2 = V1 - V2 * truncate(V1 / V2) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Quotient = XMVectorDivide(V1, V2); + Quotient = XMVectorTruncate(Quotient); + XMVECTOR Result = XMVectorNegativeMultiplySubtract(V2, Quotient, V1); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR vResult = XMVectorDivide(V1, V2); + vResult = XMVectorTruncate(vResult); + return vmlsq_f32(V1, vResult, V2); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_div_ps(V1, V2); + vResult = XMVectorTruncate(vResult); + return XM_FNMADD_PS(vResult, V2, V1); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorModAngles(FXMVECTOR Angles) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR Result; + + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + V = XMVectorMultiply(Angles, g_XMReciprocalTwoPi.v); + V = XMVectorRound(V); + Result = XMVectorNegativeMultiplySubtract(g_XMTwoPi.v, V, Angles); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + XMVECTOR vResult = vmulq_f32(Angles, g_XMReciprocalTwoPi); + // Use the inline function due to complexity for rounding + vResult = XMVectorRound(vResult); + return vmlsq_f32(Angles, vResult, g_XMTwoPi); +#elif defined(_XM_SSE_INTRINSICS_) + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + XMVECTOR vResult = _mm_mul_ps(Angles, g_XMReciprocalTwoPi); + // Use the inline function due to complexity for rounding + vResult = XMVectorRound(vResult); + return XM_FNMADD_PS(vResult, g_XMTwoPi, Angles); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSin(FXMVECTOR V) noexcept +{ + // 11-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR SC1 = g_XMSinCoefficients1; + const XMVECTOR SC0 = g_XMSinCoefficients0; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SC0), 1); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(SC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, x); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_sin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + __m128 sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR SC1 = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR SC0 = g_XMSinCoefficients0; + __m128 vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCos(FXMVECTOR V) noexcept +{ + // 10-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR CC1 = g_XMCosCoefficients1; + const XMVECTOR CC0 = g_XMCosCoefficients0; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(CC0), 1); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(CC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, fsign); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_cos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR CC1 = g_XMCosCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(CC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR CC0 = g_XMCosCoefficients0; + __m128 vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorSinCos +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) noexcept +{ + assert(pSin != nullptr); + assert(pCos != nullptr); + + // 11/10-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Sin = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + + XMVECTORF32 Cos = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + + *pSin = Sin.v; + *pCos = Cos.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation for sine + const XMVECTOR SC1 = g_XMSinCoefficients1; + const XMVECTOR SC0 = g_XMSinCoefficients0; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SC0), 1); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(SC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(SC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pSin = vmulq_f32(Result, x); + + // Compute polynomial approximation for cosine + const XMVECTOR CC1 = g_XMCosCoefficients1; + const XMVECTOR CC0 = g_XMCosCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(CC0), 1); + Result = vmlaq_lane_f32(vConstants, x2, vget_low_f32(CC1), 0); + + vConstants = vdupq_lane_f32(vget_high_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(CC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pCos = vmulq_f32(Result, fsign); +#elif defined(_XM_SVML_INTRINSICS_) + *pSin = _mm_sincos_ps(pCos, V); +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x), cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation of sine + const XMVECTOR SC1 = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR SC0 = g_XMSinCoefficients0; + __m128 vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + *pSin = Result; + + // Compute polynomial approximation of cosine + const XMVECTOR CC1 = g_XMCosCoefficients1; + vConstantsB = XM_PERMUTE_PS(CC1, _MM_SHUFFLE(0, 0, 0, 0)); + const XMVECTOR CC0 = g_XMCosCoefficients0; + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(3, 3, 3, 3)); + Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + *pCos = Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTan(FXMVECTOR V) noexcept +{ + // Cody and Waite algorithm to compute tangent. + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + tanf(V.vector4_f32[0]), + tanf(V.vector4_f32[1]), + tanf(V.vector4_f32[2]), + tanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_tan_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + static const XMVECTORF32 TanCoefficients0 = { { { 1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f } } }; + static const XMVECTORF32 TanCoefficients1 = { { { 4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f } } }; + static const XMVECTORF32 TanConstants = { { { 1.570796371f, 6.077100628e-11f, 0.000244140625f, 0.63661977228f /*2 / Pi*/ } } }; + static const XMVECTORU32 Mask = { { { 0x1, 0x1, 0x1, 0x1 } } }; + + XMVECTOR TwoDivPi = XMVectorSplatW(TanConstants.v); + + XMVECTOR Zero = XMVectorZero(); + + XMVECTOR C0 = XMVectorSplatX(TanConstants.v); + XMVECTOR C1 = XMVectorSplatY(TanConstants.v); + XMVECTOR Epsilon = XMVectorSplatZ(TanConstants.v); + + XMVECTOR VA = XMVectorMultiply(V, TwoDivPi); + + VA = XMVectorRound(VA); + + XMVECTOR VC = XMVectorNegativeMultiplySubtract(VA, C0, V); + + XMVECTOR VB = XMVectorAbs(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); + +#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + VB = vreinterpretq_f32_u32(vcvtq_u32_f32(VB)); +#elif defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + reinterpret_cast<__m128i*>(&VB)[0] = _mm_cvttps_epi32(VB); +#else + for (size_t i = 0; i < 4; i++) + { + VB.vector4_u32[i] = static_cast(VB.vector4_f32[i]); + } +#endif + + XMVECTOR VC2 = XMVectorMultiply(VC, VC); + + XMVECTOR T7 = XMVectorSplatW(TanCoefficients1.v); + XMVECTOR T6 = XMVectorSplatZ(TanCoefficients1.v); + XMVECTOR T4 = XMVectorSplatX(TanCoefficients1.v); + XMVECTOR T3 = XMVectorSplatW(TanCoefficients0.v); + XMVECTOR T5 = XMVectorSplatY(TanCoefficients1.v); + XMVECTOR T2 = XMVectorSplatZ(TanCoefficients0.v); + XMVECTOR T1 = XMVectorSplatY(TanCoefficients0.v); + XMVECTOR T0 = XMVectorSplatX(TanCoefficients0.v); + + XMVECTOR VBIsEven = XMVectorAndInt(VB, Mask.v); + VBIsEven = XMVectorEqualInt(VBIsEven, Zero); + + XMVECTOR N = XMVectorMultiplyAdd(VC2, T7, T6); + XMVECTOR D = XMVectorMultiplyAdd(VC2, T4, T3); + N = XMVectorMultiplyAdd(VC2, N, T5); + D = XMVectorMultiplyAdd(VC2, D, T2); + N = XMVectorMultiply(VC2, N); + D = XMVectorMultiplyAdd(VC2, D, T1); + N = XMVectorMultiplyAdd(VC, N, VC); + XMVECTOR VCNearZero = XMVectorInBounds(VC, Epsilon); + D = XMVectorMultiplyAdd(VC2, D, T0); + + N = XMVectorSelect(N, VC, VCNearZero); + D = XMVectorSelect(D, g_XMOne.v, VCNearZero); + + XMVECTOR R0 = XMVectorNegate(N); + XMVECTOR R1 = XMVectorDivide(N, D); + R0 = XMVectorDivide(D, R0); + + XMVECTOR VIsZero = XMVectorEqual(V, Zero); + + XMVECTOR Result = XMVectorSelect(R0, R1, VBIsEven); + + Result = XMVectorSelect(Result, Zero, VIsZero); + + return Result; + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSinH(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sinhf(V.vector4_f32[0]), + sinhf(V.vector4_f32[1]), + sinhf(V.vector4_f32[2]), + sinhf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = vmlaq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR V2 = vmlsq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + + return vsubq_f32(E1, E2); +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_sinh_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = XM_FMADD_PS(V, Scale, g_XMNegativeOne); + XMVECTOR V2 = XM_FNMADD_PS(V, Scale, g_XMNegativeOne); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + + return _mm_sub_ps(E1, E2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCosH(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + coshf(V.vector4_f32[0]), + coshf(V.vector4_f32[1]), + coshf(V.vector4_f32[2]), + coshf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = vmlaq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR V2 = vmlsq_f32(g_XMNegativeOne.v, V, Scale.v); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + return vaddq_f32(E1, E2); +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_cosh_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f } } }; // 1.0f / ln(2.0f) + + XMVECTOR V1 = XM_FMADD_PS(V, Scale.v, g_XMNegativeOne.v); + XMVECTOR V2 = XM_FNMADD_PS(V, Scale.v, g_XMNegativeOne.v); + XMVECTOR E1 = XMVectorExp(V1); + XMVECTOR E2 = XMVectorExp(V2); + return _mm_add_ps(E1, E2); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTanH(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + tanhf(V.vector4_f32[0]), + tanhf(V.vector4_f32[1]), + tanhf(V.vector4_f32[2]), + tanhf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f } } }; // 2.0f / ln(2.0f) + + XMVECTOR E = vmulq_f32(V, Scale.v); + E = XMVectorExp(E); + E = vmlaq_f32(g_XMOneHalf.v, E, g_XMOneHalf.v); + E = XMVectorReciprocal(E); + return vsubq_f32(g_XMOne.v, E); +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_tanh_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f } } }; // 2.0f / ln(2.0f) + + XMVECTOR E = _mm_mul_ps(V, Scale.v); + E = XMVectorExp(E); + E = XM_FMADD_PS(E, g_XMOneHalf.v, g_XMOneHalf.v); + E = _mm_div_ps(g_XMOne.v, E); + return _mm_sub_ps(g_XMOne.v, E); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorASin(FXMVECTOR V) noexcept +{ + // 7-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + asinf(V.vector4_f32[0]), + asinf(V.vector4_f32[1]), + asinf(V.vector4_f32[2]), + asinf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AC1), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AC1), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + t0 = vsubq_f32(g_XMHalfPi, t0); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_asin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(3, 3, 3, 3)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(2, 2, 2, 2)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + t0 = _mm_sub_ps(g_XMHalfPi, t0); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorACos(FXMVECTOR V) noexcept +{ + // 7-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + acosf(V.vector4_f32[0]), + acosf(V.vector4_f32[1]), + acosf(V.vector4_f32[2]), + acosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AC1), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AC1), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC1), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_high_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AC0), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_acos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AC1 = g_XMArcCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC1, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + const XMVECTOR AC0 = g_XMArcCoefficients0; + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(3, 3, 3, 3)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(2, 2, 2, 2)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AC0, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATan(FXMVECTOR V) noexcept +{ + // 17-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atanf(V.vector4_f32[0]), + atanf(V.vector4_f32[1]), + atanf(V.vector4_f32[2]), + atanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t absV = vabsq_f32(V); + float32x4_t invV = XMVectorReciprocal(V); + uint32x4_t comp = vcgtq_f32(V, g_XMOne); + float32x4_t sign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + comp = vcleq_f32(absV, g_XMOne); + sign = vbslq_f32(comp, g_XMZero, sign); + float32x4_t x = vbslq_f32(comp, V, invV); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR TC1 = g_XMATanCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(TC1), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(TC1), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(TC1), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(TC1), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + const XMVECTOR TC0 = g_XMATanCoefficients0; + vConstants = vdupq_lane_f32(vget_high_f32(TC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_high_f32(TC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(TC0), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(TC0), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, x); + + float32x4_t result1 = vmulq_f32(sign, g_XMHalfPi); + result1 = vsubq_f32(result1, Result); + + comp = vceqq_f32(sign, g_XMZero); + Result = vbslq_f32(comp, Result, result1); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 absV = XMVectorAbs(V); + __m128 invV = _mm_div_ps(g_XMOne, V); + __m128 comp = _mm_cmpgt_ps(V, g_XMOne); + __m128 select0 = _mm_and_ps(comp, g_XMOne); + __m128 select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + __m128 sign = _mm_or_ps(select0, select1); + comp = _mm_cmple_ps(absV, g_XMOne); + select0 = _mm_and_ps(comp, g_XMZero); + select1 = _mm_andnot_ps(comp, sign); + sign = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, V); + select1 = _mm_andnot_ps(comp, invV); + __m128 x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR TC1 = g_XMATanCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC1, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + const XMVECTOR TC0 = g_XMATanCoefficients0; + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(3, 3, 3, 3)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(TC0, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + Result = XM_FMADD_PS(Result, x2, g_XMOne); + + Result = _mm_mul_ps(Result, x); + __m128 result1 = _mm_mul_ps(sign, g_XMHalfPi); + result1 = _mm_sub_ps(result1, Result); + + comp = _mm_cmpeq_ps(sign, g_XMZero); + select0 = _mm_and_ps(comp, Result); + select1 = _mm_andnot_ps(comp, result1); + Result = _mm_or_ps(select0, select1); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATan2 +( + FXMVECTOR Y, + FXMVECTOR X +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atan2f(Y.vector4_f32[0], X.vector4_f32[0]), + atan2f(Y.vector4_f32[1], X.vector4_f32[1]), + atan2f(Y.vector4_f32[2], X.vector4_f32[2]), + atan2f(Y.vector4_f32[3], X.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan2_ps(Y, X); + return Result; +#else + + // Return the inverse tangent of Y / X in the range of -Pi to Pi with the following exceptions: + + // Y == 0 and X is Negative -> Pi with the sign of Y + // y == 0 and x is positive -> 0 with the sign of y + // Y != 0 and X == 0 -> Pi / 2 with the sign of Y + // Y != 0 and X is Negative -> atan(y/x) + (PI with the sign of Y) + // X == -Infinity and Finite Y -> Pi with the sign of Y + // X == +Infinity and Finite Y -> 0 with the sign of Y + // Y == Infinity and X is Finite -> Pi / 2 with the sign of Y + // Y == Infinity and X == -Infinity -> 3Pi / 4 with the sign of Y + // Y == Infinity and X == +Infinity -> Pi / 4 with the sign of Y + + static const XMVECTORF32 ATan2Constants = { { { XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f } } }; + + XMVECTOR Zero = XMVectorZero(); + XMVECTOR ATanResultValid = XMVectorTrueInt(); + + XMVECTOR Pi = XMVectorSplatX(ATan2Constants); + XMVECTOR PiOverTwo = XMVectorSplatY(ATan2Constants); + XMVECTOR PiOverFour = XMVectorSplatZ(ATan2Constants); + XMVECTOR ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + XMVECTOR YEqualsZero = XMVectorEqual(Y, Zero); + XMVECTOR XEqualsZero = XMVectorEqual(X, Zero); + XMVECTOR XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + + XMVECTOR YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + XMVECTOR R1 = XMVectorSelect(Pi, YSign, XIsPositive); + XMVECTOR R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + XMVECTOR R3 = XMVectorSelect(R2, R1, YEqualsZero); + XMVECTOR R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + XMVECTOR Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + XMVECTOR V = XMVectorDivide(Y, X); + + XMVECTOR R0 = XMVectorATan(V); + + R1 = XMVectorSelect(Pi, g_XMNegativeZero, XIsPositive); + R2 = XMVectorAdd(R0, R1); + + return XMVectorSelect(Result, R2, ATanResultValid); + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorSinEst(FXMVECTOR V) noexcept +{ + // 7-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR SEC = g_XMSinCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(SEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(SEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, x); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_sin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x). + __m128 sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR SEC = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCosEst(FXMVECTOR V) noexcept +{ + // 6-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR CEC = g_XMCosCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(CEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(CEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(CEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + Result = vmulq_f32(Result, fsign); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_cos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Map V to x in [-pi,pi]. + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR CEC = g_XMCosCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XM_CALLCONV XMVectorSinCosEst +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) noexcept +{ + assert(pSin != nullptr); + assert(pCos != nullptr); + + // 7/6-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Sin = { { { + sinf(V.vector4_f32[0]), + sinf(V.vector4_f32[1]), + sinf(V.vector4_f32[2]), + sinf(V.vector4_f32[3]) + } } }; + + XMVECTORF32 Cos = { { { + cosf(V.vector4_f32[0]), + cosf(V.vector4_f32[1]), + cosf(V.vector4_f32[2]), + cosf(V.vector4_f32[3]) + } } }; + + *pSin = Sin.v; + *pCos = Cos.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with cos(y) = sign*cos(x). + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x), g_XMNegativeZero); + uint32x4_t c = vorrq_u32(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + float32x4_t absx = vabsq_f32(x); + float32x4_t rflx = vsubq_f32(vreinterpretq_f32_u32(c), x); + uint32x4_t comp = vcleq_f32(absx, g_XMHalfPi); + x = vbslq_f32(comp, x, rflx); + float32x4_t fsign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation for sine + const XMVECTOR SEC = g_XMSinCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(SEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(SEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(SEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pSin = vmulq_f32(Result, x); + + // Compute polynomial approximation + const XMVECTOR CEC = g_XMCosCoefficients1; + vConstants = vdupq_lane_f32(vget_high_f32(CEC), 0); + Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(CEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(CEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + Result = vmlaq_f32(g_XMOne, Result, x2); + *pCos = vmulq_f32(Result, fsign); +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR x = XMVectorModAngles(V); + + // Map in [-pi/2,pi/2] with sin(y) = sin(x), cos(y) = sign*cos(x). + XMVECTOR sign = _mm_and_ps(x, g_XMNegativeZero); + __m128 c = _mm_or_ps(g_XMPi, sign); // pi when x >= 0, -pi when x < 0 + __m128 absx = _mm_andnot_ps(sign, x); // |x| + __m128 rflx = _mm_sub_ps(c, x); + __m128 comp = _mm_cmple_ps(absx, g_XMHalfPi); + __m128 select0 = _mm_and_ps(comp, x); + __m128 select1 = _mm_andnot_ps(comp, rflx); + x = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, g_XMOne); + select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + sign = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation for sine + const XMVECTOR SEC = g_XMSinCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(SEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, x); + *pSin = Result; + + // Compute polynomial approximation for cosine + const XMVECTOR CEC = g_XMCosCoefficients1; + vConstantsB = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(3, 3, 3, 3)); + vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(2, 2, 2, 2)); + Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(CEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + Result = XM_FMADD_PS(Result, x2, g_XMOne); + Result = _mm_mul_ps(Result, sign); + *pCos = Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorTanEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + tanf(V.vector4_f32[0]), + tanf(V.vector4_f32[1]), + tanf(V.vector4_f32[2]), + tanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_tan_ps(V); + return Result; +#else + + XMVECTOR OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients.v); + + XMVECTOR V1 = XMVectorMultiply(V, OneOverPi); + V1 = XMVectorRound(V1); + + V1 = XMVectorNegativeMultiplySubtract(g_XMPi.v, V1, V); + + XMVECTOR T0 = XMVectorSplatX(g_XMTanEstCoefficients.v); + XMVECTOR T1 = XMVectorSplatY(g_XMTanEstCoefficients.v); + XMVECTOR T2 = XMVectorSplatZ(g_XMTanEstCoefficients.v); + + XMVECTOR V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); + XMVECTOR V2 = XMVectorMultiply(V1, V1); + XMVECTOR V1T0 = XMVectorMultiply(V1, T0); + XMVECTOR V1T1 = XMVectorMultiply(V1, T1); + + XMVECTOR D = XMVectorReciprocalEst(V2T2); + XMVECTOR N = XMVectorMultiplyAdd(V2, V1T1, V1T0); + + return XMVectorMultiply(N, D); + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorASinEst(FXMVECTOR V) noexcept +{ + // 3-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result; + Result.f[0] = asinf(V.vector4_f32[0]); + Result.f[1] = asinf(V.vector4_f32[1]); + Result.f[2] = asinf(V.vector4_f32[2]); + Result.f[3] = asinf(V.vector4_f32[3]); + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + t0 = vsubq_f32(g_XMHalfPi, t0); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_asin_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + t0 = _mm_sub_ps(g_XMHalfPi, t0); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorACosEst(FXMVECTOR V) noexcept +{ + // 3-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + acosf(V.vector4_f32[0]), + acosf(V.vector4_f32[1]), + acosf(V.vector4_f32[2]), + acosf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t nonnegative = vcgeq_f32(V, g_XMZero); + float32x4_t x = vabsq_f32(V); + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + float32x4_t oneMValue = vsubq_f32(g_XMOne, x); + float32x4_t clampOneMValue = vmaxq_f32(g_XMZero, oneMValue); + float32x4_t root = XMVectorSqrt(clampOneMValue); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); + XMVECTOR t0 = vmlaq_lane_f32(vConstants, x, vget_high_f32(AEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); + t0 = vmlaq_f32(vConstants, t0, x); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); + t0 = vmlaq_f32(vConstants, t0, x); + t0 = vmulq_f32(t0, root); + + float32x4_t t1 = vsubq_f32(g_XMPi, t0); + t0 = vbslq_f32(nonnegative, t0, t1); + return t0; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_acos_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 nonnegative = _mm_cmpge_ps(V, g_XMZero); + __m128 mvalue = _mm_sub_ps(g_XMZero, V); + __m128 x = _mm_max_ps(V, mvalue); // |V| + + // Compute (1-|V|), clamp to zero to avoid sqrt of negative number. + __m128 oneMValue = _mm_sub_ps(g_XMOne, x); + __m128 clampOneMValue = _mm_max_ps(g_XMZero, oneMValue); + __m128 root = _mm_sqrt_ps(clampOneMValue); // sqrt(1-|V|) + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMArcEstCoefficients; + __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t0 = XM_FMADD_PS(vConstantsB, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); + t0 = XM_FMADD_PS(t0, x, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); + t0 = XM_FMADD_PS(t0, x, vConstants); + t0 = _mm_mul_ps(t0, root); + + __m128 t1 = _mm_sub_ps(g_XMPi, t0); + t0 = _mm_and_ps(nonnegative, t0); + t1 = _mm_andnot_ps(nonnegative, t1); + t0 = _mm_or_ps(t0, t1); + return t0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATanEst(FXMVECTOR V) noexcept +{ + // 9-degree minimax approximation + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atanf(V.vector4_f32[0]), + atanf(V.vector4_f32[1]), + atanf(V.vector4_f32[2]), + atanf(V.vector4_f32[3]) + } } }; + return Result.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t absV = vabsq_f32(V); + float32x4_t invV = XMVectorReciprocalEst(V); + uint32x4_t comp = vcgtq_f32(V, g_XMOne); + float32x4_t sign = vbslq_f32(comp, g_XMOne, g_XMNegativeOne); + comp = vcleq_f32(absV, g_XMOne); + sign = vbslq_f32(comp, g_XMZero, sign); + float32x4_t x = vbslq_f32(comp, V, invV); + + float32x4_t x2 = vmulq_f32(x, x); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMATanEstCoefficients1; + XMVECTOR vConstants = vdupq_lane_f32(vget_high_f32(AEC), 0); + XMVECTOR Result = vmlaq_lane_f32(vConstants, x2, vget_high_f32(AEC), 1); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 1); + Result = vmlaq_f32(vConstants, Result, x2); + + vConstants = vdupq_lane_f32(vget_low_f32(AEC), 0); + Result = vmlaq_f32(vConstants, Result, x2); + + // ATanEstCoefficients0 is already splatted + Result = vmlaq_f32(g_XMATanEstCoefficients0, Result, x2); + Result = vmulq_f32(Result, x); + + float32x4_t result1 = vmulq_f32(sign, g_XMHalfPi); + result1 = vsubq_f32(result1, Result); + + comp = vceqq_f32(sign, g_XMZero); + Result = vbslq_f32(comp, Result, result1); + return Result; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan_ps(V); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + __m128 absV = XMVectorAbs(V); + __m128 invV = _mm_div_ps(g_XMOne, V); + __m128 comp = _mm_cmpgt_ps(V, g_XMOne); + __m128 select0 = _mm_and_ps(comp, g_XMOne); + __m128 select1 = _mm_andnot_ps(comp, g_XMNegativeOne); + __m128 sign = _mm_or_ps(select0, select1); + comp = _mm_cmple_ps(absV, g_XMOne); + select0 = _mm_and_ps(comp, g_XMZero); + select1 = _mm_andnot_ps(comp, sign); + sign = _mm_or_ps(select0, select1); + select0 = _mm_and_ps(comp, V); + select1 = _mm_andnot_ps(comp, invV); + __m128 x = _mm_or_ps(select0, select1); + + __m128 x2 = _mm_mul_ps(x, x); + + // Compute polynomial approximation + const XMVECTOR AEC = g_XMATanEstCoefficients1; + __m128 vConstantsB = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Result = XM_FMADD_PS(vConstantsB, x2, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(1, 1, 1, 1)); + Result = XM_FMADD_PS(Result, x2, vConstants); + + vConstants = XM_PERMUTE_PS(AEC, _MM_SHUFFLE(0, 0, 0, 0)); + Result = XM_FMADD_PS(Result, x2, vConstants); + // ATanEstCoefficients0 is already splatted + Result = XM_FMADD_PS(Result, x2, g_XMATanEstCoefficients0); + Result = _mm_mul_ps(Result, x); + __m128 result1 = _mm_mul_ps(sign, g_XMHalfPi); + result1 = _mm_sub_ps(result1, Result); + + comp = _mm_cmpeq_ps(sign, g_XMZero); + select0 = _mm_and_ps(comp, Result); + select1 = _mm_andnot_ps(comp, result1); + Result = _mm_or_ps(select0, select1); + return Result; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorATan2Est +( + FXMVECTOR Y, + FXMVECTOR X +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 Result = { { { + atan2f(Y.vector4_f32[0], X.vector4_f32[0]), + atan2f(Y.vector4_f32[1], X.vector4_f32[1]), + atan2f(Y.vector4_f32[2], X.vector4_f32[2]), + atan2f(Y.vector4_f32[3], X.vector4_f32[3]), + } } }; + return Result.v; +#elif defined(_XM_SVML_INTRINSICS_) + XMVECTOR Result = _mm_atan2_ps(Y, X); + return Result; +#else + + static const XMVECTORF32 ATan2Constants = { { { XM_PI, XM_PIDIV2, XM_PIDIV4, 2.3561944905f /* Pi*3/4 */ } } }; + + const XMVECTOR Zero = XMVectorZero(); + XMVECTOR ATanResultValid = XMVectorTrueInt(); + + XMVECTOR Pi = XMVectorSplatX(ATan2Constants); + XMVECTOR PiOverTwo = XMVectorSplatY(ATan2Constants); + XMVECTOR PiOverFour = XMVectorSplatZ(ATan2Constants); + XMVECTOR ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + XMVECTOR YEqualsZero = XMVectorEqual(Y, Zero); + XMVECTOR XEqualsZero = XMVectorEqual(X, Zero); + XMVECTOR XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + + XMVECTOR YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + XMVECTOR R1 = XMVectorSelect(Pi, YSign, XIsPositive); + XMVECTOR R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + XMVECTOR R3 = XMVectorSelect(R2, R1, YEqualsZero); + XMVECTOR R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + XMVECTOR Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + XMVECTOR Reciprocal = XMVectorReciprocalEst(X); + XMVECTOR V = XMVectorMultiply(Y, Reciprocal); + XMVECTOR R0 = XMVectorATanEst(V); + + R1 = XMVectorSelect(Pi, g_XMNegativeZero, XIsPositive); + R2 = XMVectorAdd(R0, R1); + + Result = XMVectorSelect(Result, R2, ATanResultValid); + + return Result; + +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLerp +( + FXMVECTOR V0, + FXMVECTOR V1, + float t +) noexcept +{ + // V0 + t * (V1 - V0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Scale = XMVectorReplicate(t); + XMVECTOR Length = XMVectorSubtract(V1, V0); + return XMVectorMultiplyAdd(Length, Scale, V0); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR L = vsubq_f32(V1, V0); + return vmlaq_n_f32(V0, L, t); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L = _mm_sub_ps(V1, V0); + XMVECTOR S = _mm_set_ps1(t); + return XM_FMADD_PS(L, S, V0); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorLerpV +( + FXMVECTOR V0, + FXMVECTOR V1, + FXMVECTOR T +) noexcept +{ + // V0 + T * (V1 - V0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Length = XMVectorSubtract(V1, V0); + return XMVectorMultiplyAdd(Length, T, V0); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR L = vsubq_f32(V1, V0); + return vmlaq_f32(V0, L, T); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Length = _mm_sub_ps(V1, V0); + return XM_FMADD_PS(Length, T, V0); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorHermite +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + GXMVECTOR Tangent1, + float t +) noexcept +{ + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + +#if defined(_XM_NO_INTRINSICS_) + + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = XMVectorReplicate(2.0f * t3 - 3.0f * t2 + 1.0f); + XMVECTOR T0 = XMVectorReplicate(t3 - 2.0f * t2 + t); + XMVECTOR P1 = XMVectorReplicate(-2.0f * t3 + 3.0f * t2); + XMVECTOR T1 = XMVectorReplicate(t3 - t2); + + XMVECTOR Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + float p0 = 2.0f * t3 - 3.0f * t2 + 1.0f; + float t0 = t3 - 2.0f * t2 + t; + float p1 = -2.0f * t3 + 3.0f * t2; + float t1 = t3 - t2; + + XMVECTOR vResult = vmulq_n_f32(Position0, p0); + vResult = vmlaq_n_f32(vResult, Tangent0, t0); + vResult = vmlaq_n_f32(vResult, Position1, p1); + vResult = vmlaq_n_f32(vResult, Tangent1, t1); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1(2.0f * t3 - 3.0f * t2 + 1.0f); + XMVECTOR T0 = _mm_set_ps1(t3 - 2.0f * t2 + t); + XMVECTOR P1 = _mm_set_ps1(-2.0f * t3 + 3.0f * t2); + XMVECTOR T1 = _mm_set_ps1(t3 - t2); + + XMVECTOR vResult = _mm_mul_ps(P0, Position0); + vResult = XM_FMADD_PS(Tangent0, T0, vResult); + vResult = XM_FMADD_PS(Position1, P1, vResult); + vResult = XM_FMADD_PS(Tangent1, T1, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorHermiteV +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + GXMVECTOR Tangent1, + HXMVECTOR T +) noexcept +{ + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR T2 = XMVectorMultiply(T, T); + XMVECTOR T3 = XMVectorMultiply(T, T2); + + XMVECTOR P0 = XMVectorReplicate(2.0f * T3.vector4_f32[0] - 3.0f * T2.vector4_f32[0] + 1.0f); + XMVECTOR T0 = XMVectorReplicate(T3.vector4_f32[1] - 2.0f * T2.vector4_f32[1] + T.vector4_f32[1]); + XMVECTOR P1 = XMVectorReplicate(-2.0f * T3.vector4_f32[2] + 3.0f * T2.vector4_f32[2]); + XMVECTOR T1 = XMVectorReplicate(T3.vector4_f32[3] - T2.vector4_f32[3]); + + XMVECTOR Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 CatMulT2 = { { { -3.0f, -2.0f, 3.0f, -1.0f } } }; + static const XMVECTORF32 CatMulT3 = { { { 2.0f, 1.0f, -2.0f, 1.0f } } }; + + XMVECTOR T2 = vmulq_f32(T, T); + XMVECTOR T3 = vmulq_f32(T, T2); + // Mul by the constants against t^2 + T2 = vmulq_f32(T2, CatMulT2); + // Mul by the constants against t^3 + T3 = vmlaq_f32(T2, T3, CatMulT3); + // T3 now has the pre-result. + // I need to add t.y only + T2 = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(T), g_XMMaskY)); + T3 = vaddq_f32(T3, T2); + // Add 1.0f to x + T3 = vaddq_f32(T3, g_XMIdentityR0); + // Now, I have the constants created + // Mul the x constant to Position0 + XMVECTOR vResult = vmulq_lane_f32(Position0, vget_low_f32(T3), 0); // T3[0] + // Mul the y constant to Tangent0 + vResult = vmlaq_lane_f32(vResult, Tangent0, vget_low_f32(T3), 1); // T3[1] + // Mul the z constant to Position1 + vResult = vmlaq_lane_f32(vResult, Position1, vget_high_f32(T3), 0); // T3[2] + // Mul the w constant to Tangent1 + vResult = vmlaq_lane_f32(vResult, Tangent1, vget_high_f32(T3), 1); // T3[3] + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 CatMulT2 = { { { -3.0f, -2.0f, 3.0f, -1.0f } } }; + static const XMVECTORF32 CatMulT3 = { { { 2.0f, 1.0f, -2.0f, 1.0f } } }; + + XMVECTOR T2 = _mm_mul_ps(T, T); + XMVECTOR T3 = _mm_mul_ps(T, T2); + // Mul by the constants against t^2 + T2 = _mm_mul_ps(T2, CatMulT2); + // Mul by the constants against t^3 + T3 = XM_FMADD_PS(T3, CatMulT3, T2); + // T3 now has the pre-result. + // I need to add t.y only + T2 = _mm_and_ps(T, g_XMMaskY); + T3 = _mm_add_ps(T3, T2); + // Add 1.0f to x + T3 = _mm_add_ps(T3, g_XMIdentityR0); + // Now, I have the constants created + // Mul the x constant to Position0 + XMVECTOR vResult = XM_PERMUTE_PS(T3, _MM_SHUFFLE(0, 0, 0, 0)); + vResult = _mm_mul_ps(vResult, Position0); + // Mul the y constant to Tangent0 + T2 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(1, 1, 1, 1)); + vResult = XM_FMADD_PS(T2, Tangent0, vResult); + // Mul the z constant to Position1 + T2 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(2, 2, 2, 2)); + vResult = XM_FMADD_PS(T2, Position1, vResult); + // Mul the w constant to Tangent1 + T3 = XM_PERMUTE_PS(T3, _MM_SHUFFLE(3, 3, 3, 3)); + vResult = XM_FMADD_PS(T3, Tangent1, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCatmullRom +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR Position3, + float t +) noexcept +{ + // Result = ((-t^3 + 2 * t^2 - t) * Position0 + + // (3 * t^3 - 5 * t^2 + 2) * Position1 + + // (-3 * t^3 + 4 * t^2 + t) * Position2 + + // (t^3 - t^2) * Position3) * 0.5 + +#if defined(_XM_NO_INTRINSICS_) + + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = XMVectorReplicate((-t3 + 2.0f * t2 - t) * 0.5f); + XMVECTOR P1 = XMVectorReplicate((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + XMVECTOR P2 = XMVectorReplicate((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + XMVECTOR P3 = XMVectorReplicate((t3 - t2) * 0.5f); + + XMVECTOR Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(P2, Position2, Result); + Result = XMVectorMultiplyAdd(P3, Position3, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + float p0 = (-t3 + 2.0f * t2 - t) * 0.5f; + float p1 = (3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f; + float p2 = (-3.0f * t3 + 4.0f * t2 + t) * 0.5f; + float p3 = (t3 - t2) * 0.5f; + + XMVECTOR P1 = vmulq_n_f32(Position1, p1); + XMVECTOR P0 = vmlaq_n_f32(P1, Position0, p0); + XMVECTOR P3 = vmulq_n_f32(Position3, p3); + XMVECTOR P2 = vmlaq_n_f32(P3, Position2, p2); + P0 = vaddq_f32(P0, P2); + return P0; +#elif defined(_XM_SSE_INTRINSICS_) + float t2 = t * t; + float t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1((-t3 + 2.0f * t2 - t) * 0.5f); + XMVECTOR P1 = _mm_set_ps1((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + XMVECTOR P2 = _mm_set_ps1((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + XMVECTOR P3 = _mm_set_ps1((t3 - t2) * 0.5f); + + P1 = _mm_mul_ps(Position1, P1); + P0 = XM_FMADD_PS(Position0, P0, P1); + P3 = _mm_mul_ps(Position3, P3); + P2 = XM_FMADD_PS(Position2, P2, P3); + P0 = _mm_add_ps(P0, P2); + return P0; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorCatmullRomV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR Position3, + HXMVECTOR T +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fx = T.vector4_f32[0]; + float fy = T.vector4_f32[1]; + float fz = T.vector4_f32[2]; + float fw = T.vector4_f32[3]; + XMVECTORF32 vResult = { { { + 0.5f * ((-fx * fx * fx + 2 * fx * fx - fx) * Position0.vector4_f32[0] + + (3 * fx * fx * fx - 5 * fx * fx + 2) * Position1.vector4_f32[0] + + (-3 * fx * fx * fx + 4 * fx * fx + fx) * Position2.vector4_f32[0] + + (fx * fx * fx - fx * fx) * Position3.vector4_f32[0]), + + 0.5f * ((-fy * fy * fy + 2 * fy * fy - fy) * Position0.vector4_f32[1] + + (3 * fy * fy * fy - 5 * fy * fy + 2) * Position1.vector4_f32[1] + + (-3 * fy * fy * fy + 4 * fy * fy + fy) * Position2.vector4_f32[1] + + (fy * fy * fy - fy * fy) * Position3.vector4_f32[1]), + + 0.5f * ((-fz * fz * fz + 2 * fz * fz - fz) * Position0.vector4_f32[2] + + (3 * fz * fz * fz - 5 * fz * fz + 2) * Position1.vector4_f32[2] + + (-3 * fz * fz * fz + 4 * fz * fz + fz) * Position2.vector4_f32[2] + + (fz * fz * fz - fz * fz) * Position3.vector4_f32[2]), + + 0.5f * ((-fw * fw * fw + 2 * fw * fw - fw) * Position0.vector4_f32[3] + + (3 * fw * fw * fw - 5 * fw * fw + 2) * Position1.vector4_f32[3] + + (-3 * fw * fw * fw + 4 * fw * fw + fw) * Position2.vector4_f32[3] + + (fw * fw * fw - fw * fw) * Position3.vector4_f32[3]) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Catmul2 = { { { 2.0f, 2.0f, 2.0f, 2.0f } } }; + static const XMVECTORF32 Catmul3 = { { { 3.0f, 3.0f, 3.0f, 3.0f } } }; + static const XMVECTORF32 Catmul4 = { { { 4.0f, 4.0f, 4.0f, 4.0f } } }; + static const XMVECTORF32 Catmul5 = { { { 5.0f, 5.0f, 5.0f, 5.0f } } }; + // Cache T^2 and T^3 + XMVECTOR T2 = vmulq_f32(T, T); + XMVECTOR T3 = vmulq_f32(T, T2); + // Perform the Position0 term + XMVECTOR vResult = vaddq_f32(T2, T2); + vResult = vsubq_f32(vResult, T); + vResult = vsubq_f32(vResult, T3); + vResult = vmulq_f32(vResult, Position0); + // Perform the Position1 term and add + XMVECTOR vTemp = vmulq_f32(T3, Catmul3); + vTemp = vmlsq_f32(vTemp, T2, Catmul5); + vTemp = vaddq_f32(vTemp, Catmul2); + vResult = vmlaq_f32(vResult, vTemp, Position1); + // Perform the Position2 term and add + vTemp = vmulq_f32(T2, Catmul4); + vTemp = vmlsq_f32(vTemp, T3, Catmul3); + vTemp = vaddq_f32(vTemp, T); + vResult = vmlaq_f32(vResult, vTemp, Position2); + // Position3 is the last term + T3 = vsubq_f32(T3, T2); + vResult = vmlaq_f32(vResult, T3, Position3); + // Multiply by 0.5f and exit + vResult = vmulq_f32(vResult, g_XMOneHalf); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Catmul2 = { { { 2.0f, 2.0f, 2.0f, 2.0f } } }; + static const XMVECTORF32 Catmul3 = { { { 3.0f, 3.0f, 3.0f, 3.0f } } }; + static const XMVECTORF32 Catmul4 = { { { 4.0f, 4.0f, 4.0f, 4.0f } } }; + static const XMVECTORF32 Catmul5 = { { { 5.0f, 5.0f, 5.0f, 5.0f } } }; + // Cache T^2 and T^3 + XMVECTOR T2 = _mm_mul_ps(T, T); + XMVECTOR T3 = _mm_mul_ps(T, T2); + // Perform the Position0 term + XMVECTOR vResult = _mm_add_ps(T2, T2); + vResult = _mm_sub_ps(vResult, T); + vResult = _mm_sub_ps(vResult, T3); + vResult = _mm_mul_ps(vResult, Position0); + // Perform the Position1 term and add + XMVECTOR vTemp = _mm_mul_ps(T3, Catmul3); + vTemp = XM_FNMADD_PS(T2, Catmul5, vTemp); + vTemp = _mm_add_ps(vTemp, Catmul2); + vResult = XM_FMADD_PS(vTemp, Position1, vResult); + // Perform the Position2 term and add + vTemp = _mm_mul_ps(T2, Catmul4); + vTemp = XM_FNMADD_PS(T3, Catmul3, vTemp); + vTemp = _mm_add_ps(vTemp, T); + vResult = XM_FMADD_PS(vTemp, Position2, vResult); + // Position3 is the last term + T3 = _mm_sub_ps(T3, T2); + vResult = XM_FMADD_PS(T3, Position3, vResult); + // Multiply by 0.5f and exit + vResult = _mm_mul_ps(vResult, g_XMOneHalf); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorBaryCentric +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + float f, + float g +) noexcept +{ + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P10 = XMVectorSubtract(Position1, Position0); + XMVECTOR ScaleF = XMVectorReplicate(f); + + XMVECTOR P20 = XMVectorSubtract(Position2, Position0); + XMVECTOR ScaleG = XMVectorReplicate(g); + + XMVECTOR Result = XMVectorMultiplyAdd(P10, ScaleF, Position0); + Result = XMVectorMultiplyAdd(P20, ScaleG, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR R1 = vsubq_f32(Position1, Position0); + XMVECTOR R2 = vsubq_f32(Position2, Position0); + R1 = vmlaq_n_f32(Position0, R1, f); + return vmlaq_n_f32(R1, R2, g); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1, Position0); + XMVECTOR R2 = _mm_sub_ps(Position2, Position0); + XMVECTOR SF = _mm_set_ps1(f); + R1 = XM_FMADD_PS(R1, SF, Position0); + XMVECTOR SG = _mm_set_ps1(g); + return XM_FMADD_PS(R2, SG, R1); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVectorBaryCentricV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + GXMVECTOR F, + HXMVECTOR G +) noexcept +{ + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P10 = XMVectorSubtract(Position1, Position0); + XMVECTOR P20 = XMVectorSubtract(Position2, Position0); + + XMVECTOR Result = XMVectorMultiplyAdd(P10, F, Position0); + Result = XMVectorMultiplyAdd(P20, G, Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR R1 = vsubq_f32(Position1, Position0); + XMVECTOR R2 = vsubq_f32(Position2, Position0); + R1 = vmlaq_f32(Position0, R1, F); + return vmlaq_f32(R1, R2, G); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1, Position0); + XMVECTOR R2 = _mm_sub_ps(Position2, Position0); + R1 = XM_FMADD_PS(R1, F, Position0); + return XM_FMADD_PS(R2, G, R1); +#endif +} + +/**************************************************************************** + * + * 2D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + // z and w are don't care + int iTest = _mm_movemask_ps(vTemp) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTest = _mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); + float dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); + return ((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t vDelta = vsub_f32(vget_low_f32(V1), vget_low_f32(V2)); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x2_t vTemp = vacle_f32(vDelta, vget_low_u32(Epsilon)); +#else + uint32x2_t vTemp = vcle_f32(vabs_f32(vDelta), vget_low_f32(Epsilon)); +#endif + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + return (r == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) == 0x3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) != 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vceq_u32(vget_low_u32(vreinterpretq_u32_f32(V1)), vget_low_u32(vreinterpretq_u32_f32(V2))); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 3) != 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcgt_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + // z and w are don't care + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcgt_f32(vget_low_f32(V1), vget_low_f32(V2)); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcge_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector2GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcge_f32(vget_low_f32(V1), vget_low_f32(V2)); + uint64_t r = vget_lane_u64(vreinterpret_u64_u32(vTemp), 0); + uint32_t CR = 0; + if (r == 0xFFFFFFFFFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp) & 3; + uint32_t CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vclt_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vTemp = vcle_f32(vget_low_f32(V1), vget_low_f32(V2)); + return (vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 3) == 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + float32x2_t B = vget_low_f32(Bounds); + // Test if less than or equal + uint32x2_t ivTemp1 = vcle_f32(VL, B); + // Negate the bounds + float32x2_t vTemp2 = vneg_f32(B); + // Test if greater or equal (Reversed) + uint32x2_t ivTemp2 = vcle_f32(vTemp2, VL); + // Blend answers + ivTemp1 = vand_u32(ivTemp1, ivTemp2); + // x and y in bounds? + return (vget_lane_u64(vreinterpret_u64_u32(ivTemp1), 0) == 0xFFFFFFFFFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + // x and y in bounds? (z and w are don't care) + return (((_mm_movemask_ps(vTemp1) & 0x3) == 0x3) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + return isnan(vgetq_lane_f32(V, 0)) || isnan(vgetq_lane_f32(V, 1)); +#else + float32x2_t VL = vget_low_f32(V); + // Test against itself. NaN is always not equal + uint32x2_t vTempNan = vceq_f32(VL, VL); + // If x or y are NaN, the mask is zero + return (vget_lane_u64(vreinterpret_u64_u32(vTempNan), 0) != 0xFFFFFFFFFFFFFFFFU); +#endif +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + XM_ALIGNED_DATA(16) float tmp[4]; + _mm_store_ps(tmp, V); + return isnan(tmp[0]) || isnan(tmp[1]); +#else +// Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); + // If x or y are NaN, the mask is non-zero + return ((_mm_movemask_ps(vTempNan) & 3) != 0); +#endif +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector2IsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x2_t vTemp = vand_u32(vget_low_u32(vreinterpretq_u32_f32(V)), vget_low_u32(g_XMAbsMask)); + // Compare to infinity + vTemp = vceq_f32(vreinterpret_f32_u32(vTemp), vget_low_f32(g_XMInfinity)); + // If any are infinity, the signs are true. + return vget_lane_u64(vreinterpret_u64_u32(vTemp), 0) != 0; +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If x or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp) & 3) != 0); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result; + Result.f[0] = + Result.f[1] = + Result.f[2] = + Result.f[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1]; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Perform the dot product on x and y + float32x2_t vTemp = vmul_f32(vget_low_f32(V1), vget_low_f32(V2)); + vTemp = vpadd_f32(vTemp, vTemp); + return vcombine_f32(vTemp, vTemp); +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_dp_ps(V1, V2, 0x3f); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V1, V2); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_moveldup_ps(vDot); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V1, V2); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + // [ V1.x*V2.y - V1.y*V2.x, V1.x*V2.y - V1.y*V2.x ] + +#if defined(_XM_NO_INTRINSICS_) + float fCross = (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]); + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = fCross; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Negate = { { { 1.f, -1.f, 0, 0 } } }; + + float32x2_t vTemp = vmul_f32(vget_low_f32(V1), vrev64_f32(vget_low_f32(V2))); + vTemp = vmul_f32(vTemp, vget_low_f32(Negate)); + vTemp = vpadd_f32(vTemp, vTemp); + return vcombine_f32(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + // Swap x and y + XMVECTOR vResult = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 1, 0, 1)); + // Perform the muls + vResult = _mm_mul_ps(vResult, V1); + // Splat y + XMVECTOR vTemp = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(1, 1, 1, 1)); + // Sub the values + vResult = _mm_sub_ss(vResult, vTemp); + // Splat the cross product + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 0, 0, 0)); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2LengthSq(FXMVECTOR V) noexcept +{ + return XMVector2Dot(V, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ReciprocalLengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + // Reciprocal sqrt (estimate) + vTemp = vrsqrte_f32(vTemp); + return vcombine_f32(vTemp, vTemp); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + return _mm_rsqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ss(vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ReciprocalLength(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + // Reciprocal sqrt + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); + return _mm_div_ps(g_XMOne, vLengthSq); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ss(vTemp); + vLengthSq = _mm_div_ss(g_XMOne, vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = _mm_div_ss(g_XMOne, vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2LengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrtEst(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(vTemp, zero); + // Sqrt (estimate) + float32x2_t Result = vrsqrte_f32(vTemp); + Result = vmul_f32(vTemp, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ss(vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Length(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrt(Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(vTemp, zero); + // Sqrt + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + Result = vmul_f32(vTemp, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ss(vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ +// XMVector2NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMVector2NormalizeEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + // Reciprocal sqrt (estimate) + vTemp = vrsqrte_f32(vTemp); + // Normalize + float32x2_t Result = vmul_f32(VL, vTemp); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x3f); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, V); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + vLengthSq = _mm_mul_ps(vLengthSq, V); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has y splatted + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + vLengthSq = _mm_mul_ps(vLengthSq, V); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Normalize(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR vResult = XMVector2Length(V); + float fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) + { + fLength = 1.0f / fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; + vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; + vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; + vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + // Dot2 + float32x2_t vTemp = vmul_f32(VL, VL); + vTemp = vpadd_f32(vTemp, vTemp); + uint32x2_t VEqualsZero = vceq_f32(vTemp, vdup_n_f32(0)); + uint32x2_t VEqualsInf = vceq_f32(vTemp, vget_low_f32(g_XMInfinity)); + // Reciprocal sqrt (2 iterations of Newton-Raphson) + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + vTemp = vmul_f32(S1, R1); + // Normalize + float32x2_t Result = vmul_f32(VL, vTemp); + Result = vbsl_f32(VEqualsZero, vdup_n_f32(0), Result); + Result = vbsl_f32(VEqualsInf, vget_low_f32(g_XMQNaN), Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0x3f); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE3_INTRINSICS_) + // Perform the dot product on x and y only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_moveldup_ps(vLengthSq); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 1, 1, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ClampLength +( + FXMVECTOR V, + float LengthMin, + float LengthMax +) noexcept +{ + XMVECTOR ClampMax = XMVectorReplicate(LengthMax); + XMVECTOR ClampMin = XMVectorReplicate(LengthMin); + return XMVector2ClampLengthV(V, ClampMin, ClampMax); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) noexcept +{ + assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin))); + assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax))); + assert(XMVector2GreaterOrEqual(LengthMin, g_XMZero)); + assert(XMVector2GreaterOrEqual(LengthMax, g_XMZero)); + assert(XMVector2GreaterOrEqual(LengthMax, LengthMin)); + + XMVECTOR LengthSq = XMVector2LengthSq(V); + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); + + XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); + + XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); + + XMVECTOR Normal = XMVectorMultiply(V, RcpLength); + + XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); + XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); + + XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) noexcept +{ + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + + XMVECTOR Result; + Result = XMVector2Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + float RefractionIndex +) noexcept +{ + XMVECTOR Index = XMVectorReplicate(RefractionIndex); + return XMVector2RefractV(Incident, Normal, Index); +} + +//------------------------------------------------------------------------------ + +// Return the refraction of a 2D vector +inline XMVECTOR XM_CALLCONV XMVector2RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) noexcept +{ + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + +#if defined(_XM_NO_INTRINSICS_) + + float IDotN = (Incident.vector4_f32[0] * Normal.vector4_f32[0]) + (Incident.vector4_f32[1] * Normal.vector4_f32[1]); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + float RY = 1.0f - (IDotN * IDotN); + float RX = 1.0f - (RY * RefractionIndex.vector4_f32[0] * RefractionIndex.vector4_f32[0]); + RY = 1.0f - (RY * RefractionIndex.vector4_f32[1] * RefractionIndex.vector4_f32[1]); + if (RX >= 0.0f) + { + RX = (RefractionIndex.vector4_f32[0] * Incident.vector4_f32[0]) - (Normal.vector4_f32[0] * ((RefractionIndex.vector4_f32[0] * IDotN) + sqrtf(RX))); + } + else + { + RX = 0.0f; + } + if (RY >= 0.0f) + { + RY = (RefractionIndex.vector4_f32[1] * Incident.vector4_f32[1]) - (Normal.vector4_f32[1] * ((RefractionIndex.vector4_f32[1] * IDotN) + sqrtf(RY))); + } + else + { + RY = 0.0f; + } + + XMVECTOR vResult; + vResult.vector4_f32[0] = RX; + vResult.vector4_f32[1] = RY; + vResult.vector4_f32[2] = 0.0f; + vResult.vector4_f32[3] = 0.0f; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t IL = vget_low_f32(Incident); + float32x2_t NL = vget_low_f32(Normal); + float32x2_t RIL = vget_low_f32(RefractionIndex); + // Get the 2D Dot product of Incident-Normal + float32x2_t vTemp = vmul_f32(IL, NL); + float32x2_t IDotN = vpadd_f32(vTemp, vTemp); + // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + vTemp = vmls_f32(vget_low_f32(g_XMOne), IDotN, IDotN); + vTemp = vmul_f32(vTemp, RIL); + vTemp = vmls_f32(vget_low_f32(g_XMOne), vTemp, RIL); + // If any terms are <=0, sqrt() will fail, punt to zero + uint32x2_t vMask = vcgt_f32(vTemp, vget_low_f32(g_XMZero)); + // Sqrt(vTemp) + float32x2_t S0 = vrsqrte_f32(vTemp); + float32x2_t P0 = vmul_f32(vTemp, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(vTemp, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t S2 = vmul_f32(S1, R1); + vTemp = vmul_f32(vTemp, S2); + // R = RefractionIndex * IDotN + sqrt(R) + vTemp = vmla_f32(vTemp, RIL, IDotN); + // Result = RefractionIndex * Incident - Normal * R + float32x2_t vResult = vmul_f32(RIL, IL); + vResult = vmls_f32(vResult, vTemp, NL); + vResult = vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(vResult), vMask)); + return vcombine_f32(vResult, vResult); +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + // Get the 2D Dot product of Incident-Normal + XMVECTOR IDotN = XMVector2Dot(Incident, Normal); + // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR vTemp = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); + vTemp = _mm_mul_ps(vTemp, RefractionIndex); + vTemp = XM_FNMADD_PS(vTemp, RefractionIndex, g_XMOne); + // If any terms are <=0, sqrt() will fail, punt to zero + XMVECTOR vMask = _mm_cmpgt_ps(vTemp, g_XMZero); + // R = RefractionIndex * IDotN + sqrt(R) + vTemp = _mm_sqrt_ps(vTemp); + vTemp = XM_FMADD_PS(RefractionIndex, IDotN, vTemp); + // Result = RefractionIndex * Incident - Normal * R + XMVECTOR vResult = _mm_mul_ps(RefractionIndex, Incident); + vResult = XM_FNMADD_PS(vTemp, Normal, vResult); + vResult = _mm_and_ps(vResult, vMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Orthogonal(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + -V.vector4_f32[1], + V.vector4_f32[0], + 0.f, + 0.f + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Negate = { { { -1.f, 1.f, 0, 0 } } }; + const float32x2_t zero = vdup_n_f32(0); + + float32x2_t VL = vget_low_f32(V); + float32x2_t Result = vmul_f32(vrev64_f32(VL), vget_low_f32(Negate)); + return vcombine_f32(Result, zero); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 2, 0, 1)); + vResult = _mm_mul_ps(vResult, g_XMNegateX); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector2Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACosEst(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector2Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne, g_XMOne); + Result = XMVectorACos(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMVECTOR L1 = XMVector2ReciprocalLength(V1); + XMVECTOR L2 = XMVector2ReciprocalLength(V2); + + XMVECTOR Dot = XMVector2Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); + + return XMVectorACos(CosAngle); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) noexcept +{ + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + XMVECTOR PointVector = XMVectorSubtract(Point, LinePoint1); + XMVECTOR LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + XMVECTOR LengthSq = XMVector2LengthSq(LineVector); + + XMVECTOR PointProjectionScale = XMVector2Dot(PointVector, LineVector); + PointProjectionScale = XMVectorDivide(PointProjectionScale, LengthSq); + + XMVECTOR DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + return XMVector2Length(DistanceVector); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2IntersectLine +( + FXMVECTOR Line1Point1, + FXMVECTOR Line1Point2, + FXMVECTOR Line2Point1, + GXMVECTOR Line2Point2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) + + XMVECTOR V1 = XMVectorSubtract(Line1Point2, Line1Point1); + XMVECTOR V2 = XMVectorSubtract(Line2Point2, Line2Point1); + XMVECTOR V3 = XMVectorSubtract(Line1Point1, Line2Point1); + + XMVECTOR C1 = XMVector2Cross(V1, V2); + XMVECTOR C2 = XMVector2Cross(V2, V3); + + XMVECTOR Result; + const XMVECTOR Zero = XMVectorZero(); + if (XMVector2NearEqual(C1, Zero, g_XMEpsilon.v)) + { + if (XMVector2NearEqual(C2, Zero, g_XMEpsilon.v)) + { + // Coincident + Result = g_XMInfinity.v; + } + else + { + // Parallel + Result = g_XMQNaN.v; + } + } + else + { + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR Scale = XMVectorReciprocal(C1); + Scale = XMVectorMultiply(C2, Scale); + Result = XMVectorMultiplyAdd(V1, Scale, Line1Point1); + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1 = _mm_sub_ps(Line1Point2, Line1Point1); + XMVECTOR V2 = _mm_sub_ps(Line2Point2, Line2Point1); + XMVECTOR V3 = _mm_sub_ps(Line1Point1, Line2Point1); + // Generate the cross products + XMVECTOR C1 = XMVector2Cross(V1, V2); + XMVECTOR C2 = XMVector2Cross(V2, V3); + // If C1 is not close to epsilon, use the calculated value + XMVECTOR vResultMask = _mm_setzero_ps(); + vResultMask = _mm_sub_ps(vResultMask, C1); + vResultMask = _mm_max_ps(vResultMask, C1); + // 0xFFFFFFFF if the calculated value is to be used + vResultMask = _mm_cmpgt_ps(vResultMask, g_XMEpsilon); + // If C1 is close to epsilon, which fail type is it? INFINITY or NAN? + XMVECTOR vFailMask = _mm_setzero_ps(); + vFailMask = _mm_sub_ps(vFailMask, C2); + vFailMask = _mm_max_ps(vFailMask, C2); + vFailMask = _mm_cmple_ps(vFailMask, g_XMEpsilon); + XMVECTOR vFail = _mm_and_ps(vFailMask, g_XMInfinity); + vFailMask = _mm_andnot_ps(vFailMask, g_XMQNaN); + // vFail is NAN or INF + vFail = _mm_or_ps(vFail, vFailMask); + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR vResult = _mm_div_ps(C2, C1); + vResult = XM_FMADD_PS(vResult, V1, Line1Point1); + // Use result, or failure value + vResult = _mm_and_ps(vResult, vResultMask); + vResultMask = _mm_andnot_ps(vResultMask, vFail); + vResult = _mm_or_ps(vResult, vResultMask); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2Transform +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + float32x4_t Result = vmlaq_lane_f32(M.r[3], M.r[1], VL, 1); // Y + return vmlaq_lane_f32(Result, M.r[0], VL, 0); // X +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vResult, M.r[1], M.r[3]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT2* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); + + assert(OutputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, row1, row3); + Result = XMVectorMultiplyAdd(X, row0, Result); + + #ifdef _PREFAST_ + #pragma prefast(push) + #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) + #endif + + XMStoreFloat4(reinterpret_cast(pOutputVector), Result); + + #ifdef _PREFAST_ + #pragma prefast(pop) + #endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT4))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR vResult3 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + float32x4x4_t R; + R.val[0] = vResult0; + R.val[1] = vResult1; + R.val[2] = vResult2; + R.val[3] = vResult3; + + vst4q_f32(reinterpret_cast(pOutputVector), R); + pOutputVector += sizeof(XMFLOAT4) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, V, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y + + vst1q_f32(reinterpret_cast(pOutputVector), vResult); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + __m256 row3 = _mm256_broadcast_ps(&M.r[3]); + + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT4)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + X1 = _mm256_insertf128_ps(vTempA, _mm256_castps256_ps128(vTempA2), 1); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT4) * 2; + + X2 = _mm256_insertf128_ps(vTempA2, _mm256_extractf128_ps(vTempA, 1), 0); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X2); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + X1 = _mm256_insertf128_ps(vTempA, _mm256_castps256_ps128(vTempA2), 1); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT4) * 2; + + X2 = _mm256_insertf128_ps(vTempA2, _mm256_extractf128_ps(vTempA, 1), 0); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X2); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempA)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempA2)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempA, 1)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempA2, 1)); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + if (InputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Packed input, aligned output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 2; + } + } + else + { + // Packed input, unaligned output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 2; + } + } + } + } + + if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Aligned input, aligned output + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + else + { + // Aligned input, unaligned output + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + } + else + { + // Unaligned input + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2TransformCoord +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMVECTOR W = XMVectorSplatW(Result); + return XMVectorDivide(Result, W); +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream +( + XMFLOAT2* pOutputStream, + size_t OutputStride, + const XMFLOAT2* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); + + assert(OutputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT2)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Y, row1, row3); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMVECTOR W = XMVectorSplatW(Result); + + Result = XMVectorDivide(Result, W); + + #ifdef _PREFAST_ + #pragma prefast(push) + #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) + #endif + + XMStoreFloat2(reinterpret_cast(pOutputVector), Result); + + #ifdef _PREFAST_ + #pragma prefast(pop) + #endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT2))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V.val[0] = vdivq_f32(vResult0, W); + V.val[1] = vdivq_f32(vResult1, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + V.val[0] = vmulq_f32(vResult0, Reciprocal); + V.val[1] = vmulq_f32(vResult1, Reciprocal); + #endif + + vst2q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, V, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y + + V = vget_high_f32(vResult); + float32x2_t W = vdup_lane_f32(V, 1); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V = vget_low_f32(vResult); + V = vdiv_f32(V, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x2_t Reciprocal = vrecpe_f32(W); + float32x2_t S = vrecps_f32(Reciprocal, W); + Reciprocal = vmul_f32(S, Reciprocal); + S = vrecps_f32(Reciprocal, W); + Reciprocal = vmul_f32(S, Reciprocal); + + V = vget_low_f32(vResult); + V = vmul_f32(V, Reciprocal); + #endif + + vst1_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + __m256 row3 = _mm256_broadcast_ps(&M.r[3]); + + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA = _mm256_div_ps(vTempA, W); + + W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA2 = _mm256_div_ps(vTempA2, W); + + X1 = _mm256_shuffle_ps(vTempA, vTempA2, 0x44); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA = _mm256_div_ps(vTempA, W); + + W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA2 = _mm256_div_ps(vTempA2, W); + + X1 = _mm256_shuffle_ps(vTempA, vTempA2, 0x44); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempB = _mm256_fmadd_ps(Y1, row1, row3); + __m256 vTempB2 = _mm256_fmadd_ps(Y2, row1, row3); + __m256 vTempA = _mm256_mul_ps(X1, row0); + __m256 vTempA2 = _mm256_mul_ps(X2, row0); + vTempA = _mm256_add_ps(vTempA, vTempB); + vTempA2 = _mm256_add_ps(vTempA2, vTempB2); + + __m256 W = _mm256_shuffle_ps(vTempA, vTempA, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA = _mm256_div_ps(vTempA, W); + + W = _mm256_shuffle_ps(vTempA2, vTempA2, _MM_SHUFFLE(3, 3, 3, 3)); + vTempA2 = _mm256_div_ps(vTempA2, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempA))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempA2))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempA, 1))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempA2, 1))); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V2 = _mm_div_ps(vTemp, W); + + vTemp = _mm_movelh_ps(V1, V2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + XMVECTOR V2 = _mm_div_ps(vTemp, W); + + vTemp = _mm_movelh_ps(V1, V2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = XM_FMADD_PS(Y, row1, row3); + vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + i += 2; + } + } + } + } + + if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Y, row1, row3); + XMVECTOR vTemp2 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector2TransformNormal +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Y, M.r[1]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + float32x4_t Result = vmulq_lane_f32(M.r[1], VL, 1); // Y + return vmlaq_lane_f32(Result, M.r[0], VL, 0); // X +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = _mm_mul_ps(vResult, M.r[1]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream +( + XMFLOAT2* pOutputStream, + size_t OutputStride, + const XMFLOAT2* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT2)); + + assert(OutputStride >= sizeof(XMFLOAT2)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT2)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat2(reinterpret_cast(pInputVector)); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Y, row1); + Result = XMVectorMultiplyAdd(X, row0, Result); + + #ifdef _PREFAST_ + #pragma prefast(push) + #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) + #endif + + XMStoreFloat2(reinterpret_cast(pOutputVector), Result); + + #ifdef _PREFAST_ + #pragma prefast(pop) + #endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT2)) && (OutputStride == sizeof(XMFLOAT2))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x2_t V = vld2q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax + XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx + + XM_PREFETCH(pInputVector); + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + V.val[0] = vResult0; + V.val[1] = vResult1; + + vst2q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t V = vld1_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vResult = vmulq_lane_f32(row0, V, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, V, 1); // Y + + V = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempA = _mm256_mul_ps(Y1, row1); + __m256 vTempB = _mm256_mul_ps(Y2, row1); + vTempA = _mm256_fmadd_ps(X1, row0, vTempA); + vTempB = _mm256_fmadd_ps(X2, row0, vTempB); + + X1 = _mm256_shuffle_ps(vTempA, vTempB, 0x44); + XM256_STREAM_PS(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempA = _mm256_mul_ps(Y1, row1); + __m256 vTempB = _mm256_mul_ps(Y2, row1); + vTempA = _mm256_fmadd_ps(X1, row0, vTempA); + vTempB = _mm256_fmadd_ps(X2, row0, vTempB); + + X1 = _mm256_shuffle_ps(vTempA, vTempB, 0x44); + _mm256_storeu_ps(reinterpret_cast(pOutputVector), X1); + pOutputVector += sizeof(XMFLOAT2) * 4; + + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 4; + + __m256 Y2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + __m256 X2 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 Y1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 X1 = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + + __m256 vTempA = _mm256_mul_ps(Y1, row1); + __m256 vTempB = _mm256_mul_ps(Y2, row1); + vTempA = _mm256_fmadd_ps(X1, row0, vTempA); + vTempB = _mm256_fmadd_ps(X2, row0, vTempB); + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempA))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_castps256_ps128(vTempB))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempA, 1))); + pOutputVector += OutputStride; + + _mm_store_sd(reinterpret_cast(pOutputVector), + _mm_castps_pd(_mm256_extractf128_ps(vTempB, 1))); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + if (InputStride == sizeof(XMFLOAT2)) + { + if (OutputStride == sizeof(XMFLOAT2)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V1 = XM_FMADD_PS(X, row0, vTemp); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V2 = XM_FMADD_PS(X, row0, vTemp); + + vTemp = _mm_movelh_ps(V1, V2); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V1 = XM_FMADD_PS(X, row0, vTemp); + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = _mm_mul_ps(Y, row1); + XMVECTOR V2 = XM_FMADD_PS(X, row0, vTemp); + + vTemp = _mm_movelh_ps(V1, V2); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += sizeof(XMFLOAT2) * 2; + + i += 2; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < two; ++j) + { + XMVECTOR V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT2) * 2; + + // Result 1 + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + // Result 2 + Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + X = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + + vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + + i += 2; + } + } + } + } + + if (!(reinterpret_cast(pInputVector) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input + for (; i < VectorCount; i++) + { + XMVECTOR V = _mm_castsi128_ps(_mm_loadl_epi64(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input + for (; i < VectorCount; i++) + { + __m128 xy = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(pInputVector))); + pInputVector += InputStride; + + XMVECTOR Y = XM_PERMUTE_PS(xy, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(xy, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Y, row1); + vTemp = XM_FMADD_PS(X, row0, vTemp); + + _mm_store_sd(reinterpret_cast(pOutputVector), _mm_castps_pd(vTemp)); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +/**************************************************************************** + * + * 3D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp) & 7; + uint32_t CR = 0; + if (iTest == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1]) && + (V1.vector4_u32[2] == V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1]) && + (V1.vector4_u32[2] != V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTemp = _mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7; + uint32_t CR = 0; + if (iTemp == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float dx, dy, dz; + + dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2] - V2.vector4_f32[2]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vDelta = vsubq_f32(V1, V2); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x4_t vResult = vacleq_f32(vDelta, Epsilon); +#else + uint32x4_t vResult = vcleq_f32(vabsq_f32(vDelta), Epsilon); +#endif + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + // w is don't care + return (((_mm_movemask_ps(vTemp) & 7) == 0x7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) != 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return (((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) & 7) != 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1]) && + (V1.vector4_f32[2] > V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1]) && + (V1.vector4_f32[2] <= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp) & 7; + if (iTest == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector3GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU; + + uint32_t CR = 0; + if (r == 0xFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + uint32_t CR = 0; + int iTest = _mm_movemask_ps(vTemp) & 7; + if (iTest == 7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcltq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcleq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1, V2); + return (((_mm_movemask_ps(vTemp) & 7) == 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t ivTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + float32x4_t vTemp2 = vnegq_f32(Bounds); + // Test if greater or equal (Reversed) + uint32x4_t ivTemp2 = vcleq_f32(vTemp2, V); + // Blend answers + ivTemp1 = vandq_u32(ivTemp1, ivTemp2); + // in bounds? + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(ivTemp1)), vget_high_u8(vreinterpretq_u8_u32(ivTemp1))); + uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1) & 0xFFFFFFU) == 0xFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + // x,y and z in bounds? (w is don't care) + return (((_mm_movemask_ps(vTemp1) & 0x7) == 0x7) != 0); +#else + return XMComparisonAllInBounds(XMVector3InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2])); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + return isnan(vgetq_lane_f32(V, 0)) || isnan(vgetq_lane_f32(V, 1)) || isnan(vgetq_lane_f32(V, 2)); +#else +// Test against itself. NaN is always not equal + uint32x4_t vTempNan = vceqq_f32(V, V); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempNan)), vget_high_u8(vreinterpretq_u8_u32(vTempNan))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + // If x or y or z are NaN, the mask is zero + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0xFFFFFFU); +#endif +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + XM_ALIGNED_DATA(16) float tmp[4]; + _mm_store_ps(tmp, V); + return isnan(tmp[0]) || isnan(tmp[1]) || isnan(tmp[2]); +#else +// Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); + // If x or y or z are NaN, the mask is non-zero + return ((_mm_movemask_ps(vTempNan) & 7) != 0); +#endif +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector3IsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x4_t vTempInf = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + // Compare to infinity + vTempInf = vceqq_f32(vreinterpretq_f32_u32(vTempInf), g_XMInfinity); + // If any are infinity, the signs are true. + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempInf)), vget_high_u8(vreinterpretq_u8_u32(vTempInf))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return ((vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) & 0xFFFFFFU) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If x,y or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp) & 7) != 0); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fValue = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2]; + XMVECTORF32 vResult; + vResult.f[0] = + vResult.f[1] = + vResult.f[2] = + vResult.f[3] = fValue; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vTemp = vmulq_f32(V1, V2); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + return vcombine_f32(v1, v1); +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_dp_ps(V1, V2, 0x7f); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vTemp = _mm_mul_ps(V1, V2); + vTemp = _mm_and_ps(vTemp, g_XMMask3); + vTemp = _mm_hadd_ps(vTemp, vTemp); + return _mm_hadd_ps(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V1, V2); + // x=Dot.vector4_f32[1], y=Dot.vector4_f32[2] + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.vector4_f32[0] = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.vector4_f32[2] + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.vector4_f32[0] = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + return XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + // [ V1.y*V2.z - V1.z*V2.y, V1.z*V2.x - V1.x*V2.z, V1.x*V2.y - V1.y*V2.x ] + +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (V1.vector4_f32[1] * V2.vector4_f32[2]) - (V1.vector4_f32[2] * V2.vector4_f32[1]), + (V1.vector4_f32[2] * V2.vector4_f32[0]) - (V1.vector4_f32[0] * V2.vector4_f32[2]), + (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]), + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t v1xy = vget_low_f32(V1); + float32x2_t v2xy = vget_low_f32(V2); + + float32x2_t v1yx = vrev64_f32(v1xy); + float32x2_t v2yx = vrev64_f32(v2xy); + + float32x2_t v1zz = vdup_lane_f32(vget_high_f32(V1), 0); + float32x2_t v2zz = vdup_lane_f32(vget_high_f32(V2), 0); + + XMVECTOR vResult = vmulq_f32(vcombine_f32(v1yx, v1xy), vcombine_f32(v2zz, v2yx)); + vResult = vmlsq_f32(vResult, vcombine_f32(v1zz, v1yx), vcombine_f32(v2yx, v2xy)); + vResult = vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(vResult), g_XMFlipY)); + return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vResult), g_XMMask3)); +#elif defined(_XM_SSE_INTRINSICS_) + // y1,z1,x1,w1 + XMVECTOR vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(3, 0, 2, 1)); + // z2,x2,y2,w2 + XMVECTOR vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(3, 1, 0, 2)); + // Perform the left operation + XMVECTOR vResult = _mm_mul_ps(vTemp1, vTemp2); + // z1,x1,y1,w1 + vTemp1 = XM_PERMUTE_PS(vTemp1, _MM_SHUFFLE(3, 0, 2, 1)); + // y2,z2,x2,w2 + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(3, 1, 0, 2)); + // Perform the right operation + vResult = XM_FNMADD_PS(vTemp1, vTemp2, vResult); + // Set w to zero + return _mm_and_ps(vResult, g_XMMask3); +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3LengthSq(FXMVECTOR V) noexcept +{ + return XMVector3Dot(V, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ReciprocalLengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + return vcombine_f32(v2, v2); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + return _mm_rsqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and y + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // y,y,y,y + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // Splat the length squared + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ReciprocalLength(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + // Reciprocal sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); + return _mm_div_ps(g_XMOne, vLengthSq); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V, V); + vDot = _mm_and_ps(vDot, g_XMMask3); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_sqrt_ps(vDot); + vDot = _mm_div_ps(g_XMOne, vDot); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V, V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.z + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vDot = _mm_sqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_div_ps(g_XMOne, vDot); + return vDot; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3LengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt (estimate) + float32x2_t Result = vrsqrte_f32(v1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and y + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // y,y,y,y + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // Splat the length squared + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Length(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and y + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 2, 1, 2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // y,y,y,y + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + // Splat the length squared + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ +// XMVector3NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMVector3NormalizeEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector3ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + // Normalize + return vmulq_f32(V, vcombine_f32(v2, v2)); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0x7f); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, V); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V, V); + vDot = _mm_and_ps(vDot, g_XMMask3); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_rsqrt_ps(vDot); + vDot = _mm_mul_ps(vDot, V); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V, V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(2, 1, 2, 1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot, vTemp); + // x=Dot.z + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot, vTemp); + // Splat x + vDot = XM_PERMUTE_PS(vDot, _MM_SHUFFLE(0, 0, 0, 0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Perform the normalization + vDot = _mm_mul_ps(vDot, V); + return vDot; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Normalize(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fLength; + XMVECTOR vResult; + + vResult = XMVector3Length(V); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) + { + fLength = 1.0f / fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; + vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; + vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; + vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot3 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vpadd_f32(v1, v1); + v2 = vdup_lane_f32(v2, 0); + v1 = vadd_f32(v1, v2); + uint32x2_t VEqualsZero = vceq_f32(v1, vdup_n_f32(0)); + uint32x2_t VEqualsInf = vceq_f32(v1, vget_low_f32(g_XMInfinity)); + // Reciprocal sqrt (2 iterations of Newton-Raphson) + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + v2 = vmul_f32(S1, R1); + // Normalize + XMVECTOR vResult = vmulq_f32(V, vcombine_f32(v2, v2)); + vResult = vbslq_f32(vcombine_u32(VEqualsZero, VEqualsZero), vdupq_n_f32(0), vResult); + return vbslq_f32(vcombine_u32(VEqualsInf, VEqualsInf), g_XMQNaN, vResult); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0x7f); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE3_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_and_ps(vLengthSq, g_XMMask3); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 1, 2, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(1, 1, 1, 1)); + vLengthSq = _mm_add_ss(vLengthSq, vTemp); + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(0, 0, 0, 0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ClampLength +( + FXMVECTOR V, + float LengthMin, + float LengthMax +) noexcept +{ + XMVECTOR ClampMax = XMVectorReplicate(LengthMax); + XMVECTOR ClampMin = XMVectorReplicate(LengthMin); + + return XMVector3ClampLengthV(V, ClampMin, ClampMax); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) noexcept +{ + assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin))); + assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax))); + assert(XMVector3GreaterOrEqual(LengthMin, XMVectorZero())); + assert(XMVector3GreaterOrEqual(LengthMax, XMVectorZero())); + assert(XMVector3GreaterOrEqual(LengthMax, LengthMin)); + + XMVECTOR LengthSq = XMVector3LengthSq(V); + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); + + XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); + + XMVECTOR Normal = XMVectorMultiply(V, RcpLength); + + XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); + + XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); + XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); + + XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) noexcept +{ + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + + XMVECTOR Result = XMVector3Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + float RefractionIndex +) noexcept +{ + XMVECTOR Index = XMVectorReplicate(RefractionIndex); + return XMVector3RefractV(Incident, Normal, Index); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) noexcept +{ + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + +#if defined(_XM_NO_INTRINSICS_) + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + XMVECTOR Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + float32x4_t R = vmlsq_f32(g_XMOne, IDotN, IDotN); + R = vmulq_f32(R, RefractionIndex); + R = vmlsq_f32(g_XMOne, R, RefractionIndex); + + uint32x4_t isrzero = vcleq_f32(R, g_XMZero); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(isrzero)), vget_high_u8(vreinterpretq_u8_u32(isrzero))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + + float32x4_t vResult; + if (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // Sqrt(R) + float32x4_t S0 = vrsqrteq_f32(R); + float32x4_t P0 = vmulq_f32(R, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(R, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + float32x4_t S2 = vmulq_f32(S1, R1); + R = vmulq_f32(R, S2); + // R = RefractionIndex * IDotN + sqrt(R) + R = vmlaq_f32(R, RefractionIndex, IDotN); + // Result = RefractionIndex * Incident - Normal * R + vResult = vmulq_f32(RefractionIndex, Incident); + vResult = vmlsq_f32(vResult, R, Normal); + } + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); + XMVECTOR R2 = _mm_mul_ps(RefractionIndex, RefractionIndex); + R = XM_FNMADD_PS(R, R2, g_XMOne); + + XMVECTOR vResult = _mm_cmple_ps(R, g_XMZero); + if (_mm_movemask_ps(vResult) == 0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + R = XM_FMADD_PS(RefractionIndex, IDotN, R); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + vResult = XM_FNMADD_PS(R, Normal, vResult); + } + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Orthogonal(FXMVECTOR V) noexcept +{ + XMVECTOR Zero = XMVectorZero(); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR YZYY = XMVectorSwizzle(V); + + XMVECTOR NegativeV = XMVectorSubtract(Zero, V); + + XMVECTOR ZIsNegative = XMVectorLess(Z, Zero); + XMVECTOR YZYYIsNegative = XMVectorLess(YZYY, Zero); + + XMVECTOR S = XMVectorAdd(YZYY, Z); + XMVECTOR D = XMVectorSubtract(YZYY, Z); + + XMVECTOR Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); + + XMVECTOR R0 = XMVectorPermute(NegativeV, S); + XMVECTOR R1 = XMVectorPermute(V, D); + + return XMVectorSelect(R1, R0, Select); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector3Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACosEst(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector3Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACos(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMVECTOR L1 = XMVector3ReciprocalLength(V1); + XMVECTOR L2 = XMVector3ReciprocalLength(V2); + + XMVECTOR Dot = XMVector3Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); + + return XMVectorACos(CosAngle); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) noexcept +{ + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + XMVECTOR PointVector = XMVectorSubtract(Point, LinePoint1); + XMVECTOR LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + XMVECTOR LengthSq = XMVector3LengthSq(LineVector); + + XMVECTOR PointProjectionScale = XMVector3Dot(PointVector, LineVector); + PointProjectionScale = XMVectorDivide(PointProjectionScale, LengthSq); + + XMVECTOR DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + return XMVector3Length(DistanceVector); +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline void XM_CALLCONV XMVector3ComponentsFromNormal +( + XMVECTOR* pParallel, + XMVECTOR* pPerpendicular, + FXMVECTOR V, + FXMVECTOR Normal +) noexcept +{ + assert(pParallel != nullptr); + assert(pPerpendicular != nullptr); + + XMVECTOR Scale = XMVector3Dot(V, Normal); + + XMVECTOR Parallel = XMVectorMultiply(Normal, Scale); + + *pParallel = Parallel; + *pPerpendicular = XMVectorSubtract(V, Parallel); +} + +//------------------------------------------------------------------------------ +// Transform a vector using a rotation expressed as a unit quaternion + +inline XMVECTOR XM_CALLCONV XMVector3Rotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) noexcept +{ + XMVECTOR A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + XMVECTOR Q = XMQuaternionConjugate(RotationQuaternion); + XMVECTOR Result = XMQuaternionMultiply(Q, A); + return XMQuaternionMultiply(Result, RotationQuaternion); +} + +//------------------------------------------------------------------------------ +// Transform a vector using the inverse of a rotation expressed as a unit quaternion + +inline XMVECTOR XM_CALLCONV XMVector3InverseRotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) noexcept +{ + XMVECTOR A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + XMVECTOR Result = XMQuaternionMultiply(RotationQuaternion, A); + XMVECTOR Q = XMQuaternionConjugate(RotationQuaternion); + return XMQuaternionMultiply(Result, Q); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Transform +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmlaq_lane_f32(M.r[3], M.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y + return vmlaq_lane_f32(vResult, M.r[2], vget_high_f32(V), 0); // Z +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z + vResult = XM_FMADD_PS(vResult, M.r[2], M.r[3]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, row2, row3); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMStoreFloat4(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT4))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR vResult3 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O + vResult3 = vmlaq_lane_f32(vResult3, V.val[2], r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + float32x4x4_t R; + R.val[0] = vResult0; + R.val[1] = vResult1; + R.val[2] = vResult2; + R.val[3] = vResult3; + + vst4q_f32(reinterpret_cast(pOutputVector), R); + pOutputVector += sizeof(XMFLOAT4) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + + vst1q_f32(reinterpret_cast(pOutputVector), vResult); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Packed input, aligned output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + else + { + // Packed input, unaligned output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + // Aligned output + for (; i < VectorCount; ++i) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned output + for (; i < VectorCount; ++i) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3TransformCoord +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMVECTOR W = XMVectorSplatW(Result); + return XMVectorDivide(Result, W); +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiplyAdd(Z, row2, row3); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMVECTOR W = XMVectorSplatW(Result); + + Result = XMVectorDivide(Result, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r3 = vget_low_f32(row3); + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(row3); + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O + W = vmlaq_lane_f32(W, V.val[2], r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V.val[0] = vdivq_f32(vResult0, W); + V.val[1] = vdivq_f32(vResult1, W); + V.val[2] = vdivq_f32(vResult2, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + V.val[0] = vmulq_f32(vResult0, Reciprocal); + V.val[1] = vmulq_f32(vResult1, Reciprocal); + V.val[2] = vmulq_f32(vResult2, Reciprocal); + #endif + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(row3, row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + + VH = vget_high_f32(vResult); + XMVECTOR W = vdupq_lane_f32(VH, 1); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult = vdivq_f32(vResult, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult = vmulq_f32(vResult, Reciprocal); + #endif + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, row2, row3); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, row2, row3); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3TransformNormal +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Z, M.r[2]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmulq_lane_f32(M.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y + return vmlaq_lane_f32(vResult, M.r[2], vget_high_f32(V), 0); // Z +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z + vResult = _mm_mul_ps(vResult, M.r[2]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(Z, row2); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax + XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx + + XM_PREFETCH(pInputVector); + + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmulq_lane_f32(V.val[0], r, 0); // Cx + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + V.val[0] = vResult0; + V.val[1] = vResult1; + V.val[2] = vResult2; + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmulq_lane_f32(row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V1 = _mm_add_ps(vTemp, vTemp3); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V2 = _mm_add_ps(vTemp, vTemp3); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V3 = _mm_add_ps(vTemp, vTemp3); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V4 = _mm_add_ps(vTemp, vTemp3); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V1 = _mm_add_ps(vTemp, vTemp3); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V2 = _mm_add_ps(vTemp, vTemp3); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V3 = _mm_add_ps(vTemp, vTemp3); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + V4 = _mm_add_ps(vTemp, vTemp3); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = _mm_mul_ps(Z, row2); + vTemp2 = _mm_mul_ps(Y, row1); + vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = _mm_mul_ps(Z, row2); + XMVECTOR vTemp2 = _mm_mul_ps(Y, row1); + XMVECTOR vTemp3 = _mm_mul_ps(X, row0); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Project +( + FXMVECTOR V, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 0.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + XMVECTOR Result = XMVector3TransformCoord(V, Transform); + + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + return Result; +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + + XMVECTOR Result = XMVector3TransformCoord(V, Transform); + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + XMVECTOR ScaleX = vdupq_n_f32(HalfViewportWidth); + XMVECTOR ScaleY = vdupq_n_f32(-HalfViewportHeight); + XMVECTOR ScaleZ = vdupq_n_f32(ViewportMaxZ - ViewportMinZ); + + XMVECTOR OffsetX = vdupq_n_f32(ViewportX + HalfViewportWidth); + XMVECTOR OffsetY = vdupq_n_f32(ViewportY + HalfViewportHeight); + XMVECTOR OffsetZ = vdupq_n_f32(ViewportMinZ); + + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + float32x2_t r3 = vget_low_f32(Transform.r[3]); + float32x2_t r = vget_low_f32(Transform.r[0]); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(Transform.r[3]); + r = vget_high_f32(Transform.r[0]); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), V.val[0], r, 0); // Cx+O + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), V.val[0], r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(Transform.r[1]); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(Transform.r[1]); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy+O + W = vmlaq_lane_f32(W, V.val[1], r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(Transform.r[2]); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(Transform.r[2]); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz+O + W = vmlaq_lane_f32(W, V.val[2], r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult0 = vdivq_f32(vResult0, W); + vResult1 = vdivq_f32(vResult1, W); + vResult2 = vdivq_f32(vResult2, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult0 = vmulq_f32(vResult0, Reciprocal); + vResult1 = vmulq_f32(vResult1, Reciprocal); + vResult2 = vmulq_f32(vResult2, Reciprocal); + #endif + + V.val[0] = vmlaq_f32(OffsetX, vResult0, ScaleX); + V.val[1] = vmlaq_f32(OffsetY, vResult1, ScaleY); + V.val[2] = vmlaq_f32(OffsetZ, vResult2, ScaleZ); + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + if (i < VectorCount) + { + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + XMVECTOR vResult = vmlaq_lane_f32(Transform.r[3], Transform.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, Transform.r[1], VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, Transform.r[2], VH, 0); // Z + + VH = vget_high_f32(vResult); + XMVECTOR W = vdupq_lane_f32(VH, 1); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult = vdivq_f32(vResult, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult = vmulq_f32(vResult, Reciprocal); + #endif + + vResult = vmlaq_f32(Offset, vResult, Scale); + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + const float HalfViewportWidth = ViewportWidth * 0.5f; + const float HalfViewportHeight = ViewportHeight * 0.5f; + + XMVECTOR Scale = XMVectorSet(HalfViewportWidth, -HalfViewportHeight, ViewportMaxZ - ViewportMinZ, 1.0f); + XMVECTOR Offset = XMVectorSet(ViewportX + HalfViewportWidth, ViewportY + HalfViewportHeight, ViewportMinZ, 0.0f); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V1 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V2 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V3 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V4 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V1 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V2 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V3 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + V4 = XM_FMADD_PS(vTemp, Scale, Offset); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + vTemp = XM_FMADD_PS(vTemp, Scale, Offset); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector3Unproject +( + FXMVECTOR V, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; + + XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); + Scale = XMVectorReciprocal(Scale); + + XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D.v); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); + + return XMVector3TransformCoord(Result, Transform); +} + +//------------------------------------------------------------------------------ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream +( + XMFLOAT3* pOutputStream, + size_t OutputStride, + const XMFLOAT3* pInputStream, + size_t InputStride, + size_t VectorCount, + float ViewportX, + float ViewportY, + float ViewportWidth, + float ViewportHeight, + float ViewportMinZ, + float ViewportMaxZ, + FXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT3)); + + assert(OutputStride >= sizeof(XMFLOAT3)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT3)); + +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; + + XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); + Scale = XMVectorReciprocal(Scale); + + XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D.v); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + + XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + XMStoreFloat3(reinterpret_cast(pOutputVector), Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + float sx = 1.f / (ViewportWidth * 0.5f); + float sy = 1.f / (-ViewportHeight * 0.5f); + float sz = 1.f / (ViewportMaxZ - ViewportMinZ); + + float ox = (-ViewportX * sx) - 1.f; + float oy = (-ViewportY * sy) + 1.f; + float oz = (-ViewportMinZ * sz); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT3)) && (OutputStride == sizeof(XMFLOAT3))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x3_t V = vld3q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT3) * 4; + + XMVECTOR ScaleX = vdupq_n_f32(sx); + XMVECTOR OffsetX = vdupq_n_f32(ox); + XMVECTOR VX = vmlaq_f32(OffsetX, ScaleX, V.val[0]); + + float32x2_t r3 = vget_low_f32(Transform.r[3]); + float32x2_t r = vget_low_f32(Transform.r[0]); + XMVECTOR vResult0 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), VX, r, 0); // Ax+M + XMVECTOR vResult1 = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), VX, r, 1); // Bx+N + + XM_PREFETCH(pInputVector); + + r3 = vget_high_f32(Transform.r[3]); + r = vget_high_f32(Transform.r[0]); + XMVECTOR vResult2 = vmlaq_lane_f32(vdupq_lane_f32(r3, 0), VX, r, 0); // Cx+O + XMVECTOR W = vmlaq_lane_f32(vdupq_lane_f32(r3, 1), VX, r, 1); // Dx+P + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + XMVECTOR ScaleY = vdupq_n_f32(sy); + XMVECTOR OffsetY = vdupq_n_f32(oy); + XMVECTOR VY = vmlaq_f32(OffsetY, ScaleY, V.val[1]); + + r = vget_low_f32(Transform.r[1]); + vResult0 = vmlaq_lane_f32(vResult0, VY, r, 0); // Ax+Ey+M + vResult1 = vmlaq_lane_f32(vResult1, VY, r, 1); // Bx+Fy+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(Transform.r[1]); + vResult2 = vmlaq_lane_f32(vResult2, VY, r, 0); // Cx+Gy+O + W = vmlaq_lane_f32(W, VY, r, 1); // Dx+Hy+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + XMVECTOR ScaleZ = vdupq_n_f32(sz); + XMVECTOR OffsetZ = vdupq_n_f32(oz); + XMVECTOR VZ = vmlaq_f32(OffsetZ, ScaleZ, V.val[2]); + + r = vget_low_f32(Transform.r[2]); + vResult0 = vmlaq_lane_f32(vResult0, VZ, r, 0); // Ax+Ey+Iz+M + vResult1 = vmlaq_lane_f32(vResult1, VZ, r, 1); // Bx+Fy+Jz+N + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(Transform.r[2]); + vResult2 = vmlaq_lane_f32(vResult2, VZ, r, 0); // Cx+Gy+Kz+O + W = vmlaq_lane_f32(W, VZ, r, 1); // Dx+Hy+Lz+P + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + V.val[0] = vdivq_f32(vResult0, W); + V.val[1] = vdivq_f32(vResult1, W); + V.val[2] = vdivq_f32(vResult2, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + V.val[0] = vmulq_f32(vResult0, Reciprocal); + V.val[1] = vmulq_f32(vResult1, Reciprocal); + V.val[2] = vmulq_f32(vResult2, Reciprocal); + #endif + + vst3q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT3) * 4; + + i += 4; + } + } + } + + if (i < VectorCount) + { + float32x2_t ScaleL = vcreate_f32( + static_cast(*reinterpret_cast(&sx)) + | (static_cast(*reinterpret_cast(&sy)) << 32)); + float32x2_t ScaleH = vcreate_f32(static_cast(*reinterpret_cast(&sz))); + + float32x2_t OffsetL = vcreate_f32( + static_cast(*reinterpret_cast(&ox)) + | (static_cast(*reinterpret_cast(&oy)) << 32)); + float32x2_t OffsetH = vcreate_f32(static_cast(*reinterpret_cast(&oz))); + + for (; i < VectorCount; i++) + { + float32x2_t VL = vld1_f32(reinterpret_cast(pInputVector)); + float32x2_t zero = vdup_n_f32(0); + float32x2_t VH = vld1_lane_f32(reinterpret_cast(pInputVector) + 2, zero, 0); + pInputVector += InputStride; + + VL = vmla_f32(OffsetL, VL, ScaleL); + VH = vmla_f32(OffsetH, VH, ScaleH); + + XMVECTOR vResult = vmlaq_lane_f32(Transform.r[3], Transform.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, Transform.r[1], VL, 1); // Y + vResult = vmlaq_lane_f32(vResult, Transform.r[2], VH, 0); // Z + + VH = vget_high_f32(vResult); + XMVECTOR W = vdupq_lane_f32(VH, 1); + + #if defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__ + vResult = vdivq_f32(vResult, W); + #else + // 2 iterations of Newton-Raphson refinement of reciprocal for W + float32x4_t Reciprocal = vrecpeq_f32(W); + float32x4_t S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + S = vrecpsq_f32(Reciprocal, W); + Reciprocal = vmulq_f32(S, Reciprocal); + + vResult = vmulq_f32(vResult, Reciprocal); + #endif + + VL = vget_low_f32(vResult); + vst1_f32(reinterpret_cast(pOutputVector), VL); + vst1q_lane_f32(reinterpret_cast(pOutputVector) + 2, vResult, 2); + pOutputVector += OutputStride; + } + } + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 D = { { { -1.0f, 1.0f, 0.0f, 0.0f } } }; + + XMVECTOR Scale = XMVectorSet(ViewportWidth * 0.5f, -ViewportHeight * 0.5f, ViewportMaxZ - ViewportMinZ, 1.0f); + Scale = XMVectorReciprocal(Scale); + + XMVECTOR Offset = XMVectorSet(-ViewportX, -ViewportY, -ViewportMinZ, 0.0f); + Offset = _mm_mul_ps(Scale, Offset); + Offset = _mm_add_ps(Offset, D); + + XMMATRIX Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(nullptr, Transform); + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(XMFLOAT3)) + { + if (OutputStride == sizeof(XMFLOAT3)) + { + if (!(reinterpret_cast(pOutputStream) & 0xF)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + V1 = XM_FMADD_PS(V1, Scale, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + V2 = XM_FMADD_PS(V2, Scale, Offset); + + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + V3 = XM_FMADD_PS(V3, Scale, Offset); + + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + V4 = XM_FMADD_PS(V4, Scale, Offset); + + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector), V1); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 16), vTemp); + XM_STREAM_PS(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + else + { + // Packed input, unaligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + V1 = XM_FMADD_PS(V1, Scale, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V1 = _mm_div_ps(vTemp, W); + + // Result 2 + V2 = XM_FMADD_PS(V2, Scale, Offset); + + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V2 = _mm_div_ps(vTemp, W); + + // Result 3 + V3 = XM_FMADD_PS(V3, Scale, Offset); + + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V3 = _mm_div_ps(vTemp, W); + + // Result 4 + V4 = XM_FMADD_PS(V4, Scale, Offset); + + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + V4 = _mm_div_ps(vTemp, W); + + // Pack and store the vectors + XM3PACK4INTO3(vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector), V1); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 16), vTemp); + _mm_storeu_ps(reinterpret_cast(pOutputVector + 32), V3); + pOutputVector += sizeof(XMFLOAT3) * 4; + i += 4; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < four; ++j) + { + __m128 V1 = _mm_loadu_ps(reinterpret_cast(pInputVector)); + __m128 L2 = _mm_loadu_ps(reinterpret_cast(pInputVector + 16)); + __m128 L3 = _mm_loadu_ps(reinterpret_cast(pInputVector + 32)); + pInputVector += sizeof(XMFLOAT3) * 4; + + // Unpack the 4 vectors (.w components are junk) + XM3UNPACK3INTO4(V1, L2, L3); + + // Result 1 + V1 = XM_FMADD_PS(V1, Scale, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 2 + V2 = XM_FMADD_PS(V2, Scale, Offset); + + Z = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V2, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 3 + V3 = XM_FMADD_PS(V3, Scale, Offset); + + Z = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + // Result 4 + V4 = XM_FMADD_PS(V4, Scale, Offset); + + Z = XM_PERMUTE_PS(V4, _MM_SHUFFLE(2, 2, 2, 2)); + Y = XM_PERMUTE_PS(V4, _MM_SHUFFLE(1, 1, 1, 1)); + X = XM_PERMUTE_PS(V4, _MM_SHUFFLE(0, 0, 0, 0)); + + vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + + i += 4; + } + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + V = _mm_mul_ps(V, Scale); + V = _mm_add_ps(V, Offset); + + XMVECTOR Z = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR Y = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR X = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + + XMVECTOR vTemp = XM_FMADD_PS(Z, Transform.r[2], Transform.r[3]); + XMVECTOR vTemp2 = _mm_mul_ps(Y, Transform.r[1]); + XMVECTOR vTemp3 = _mm_mul_ps(X, Transform.r[0]); + vTemp = _mm_add_ps(vTemp, vTemp2); + vTemp = _mm_add_ps(vTemp, vTemp3); + + XMVECTOR W = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 3, 3, 3)); + vTemp = _mm_div_ps(vTemp, W); + + XMStoreFloat3(reinterpret_cast(pOutputVector), vTemp); + pOutputVector += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * 4D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2]) && (V1.vector4_f32[3] == V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + uint32_t CR = 0; + + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2]) && + (V1.vector4_f32[3] == V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2]) && + (V1.vector4_f32[3] != V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp); + uint32_t CR = 0; + if (iTest == 0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest == 0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2]) && (V1.vector4_u32[3] == V2.vector4_u32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return ((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) == 0xf) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if (V1.vector4_u32[0] == V2.vector4_u32[0] && + V1.vector4_u32[1] == V2.vector4_u32[1] && + V1.vector4_u32[2] == V2.vector4_u32[2] && + V1.vector4_u32[3] == V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_u32[0] != V2.vector4_u32[0] && + V1.vector4_u32[1] != V2.vector4_u32[1] && + V1.vector4_u32[2] != V2.vector4_u32[2] && + V1.vector4_u32[3] != V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + int iTest = _mm_movemask_ps(_mm_castsi128_ps(vTemp)); + uint32_t CR = 0; + if (iTest == 0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest == 0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +inline bool XM_CALLCONV XMVector4NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float dx, dy, dz, dw; + + dx = fabsf(V1.vector4_f32[0] - V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1] - V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2] - V2.vector4_f32[2]); + dw = fabsf(V1.vector4_f32[3] - V2.vector4_f32[3]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2]) && + (dw <= Epsilon.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vDelta = vsubq_f32(V1, V2); +#if defined(_MSC_VER) && !defined(__clang__) && !defined(_ARM64_DISTINCT_NEON_TYPES) + uint32x4_t vResult = vacleq_f32(vDelta, Epsilon); +#else + uint32x4_t vResult = vcleq_f32(vabsq_f32(vDelta), Epsilon); +#endif + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1, V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp, vDelta); + vTemp = _mm_max_ps(vTemp, vDelta); + vTemp = _mm_cmple_ps(vTemp, Epsilon); + return ((_mm_movemask_ps(vTemp) == 0xf) != 0); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2]) || (V1.vector4_f32[3] != V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpneq_ps(V1, V2); + return ((_mm_movemask_ps(vTemp)) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2]) || (V1.vector4_u32[3] != V2.vector4_u32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vceqq_u32(vreinterpretq_u32_f32(V1), vreinterpretq_u32_f32(V2)); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(_mm_castps_si128(V1), _mm_castps_si128(V2)); + return ((_mm_movemask_ps(_mm_castsi128_ps(vTemp)) != 0xF) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2]) && (V1.vector4_f32[3] > V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if (V1.vector4_f32[0] > V2.vector4_f32[0] && + V1.vector4_f32[1] > V2.vector4_f32[1] && + V1.vector4_f32[2] > V2.vector4_f32[2] && + V1.vector4_f32[3] > V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_f32[0] <= V2.vector4_f32[0] && + V1.vector4_f32[1] <= V2.vector4_f32[1] && + V1.vector4_f32[2] <= V2.vector4_f32[2] && + V1.vector4_f32[3] <= V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgtq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + uint32_t CR = 0; + XMVECTOR vTemp = _mm_cmpgt_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2]) && (V1.vector4_f32[3] >= V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +inline uint32_t XM_CALLCONV XMVector4GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + uint32_t CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2]) && + (V1.vector4_f32[3] >= V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2]) && + (V1.vector4_f32[3] < V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcgeq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + uint32_t r = vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1); + + uint32_t CR = 0; + if (r == 0xFFFFFFFFU) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!r) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + uint32_t CR = 0; + XMVECTOR vTemp = _mm_cmpge_ps(V1, V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest == 0x0f) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2]) && (V1.vector4_f32[3] < V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcltq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2]) && (V1.vector4_f32[3] <= V2.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vResult = vcleq_f32(V1, V2); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vResult)), vget_high_u8(vreinterpretq_u8_u32(vResult))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1, V2); + return ((_mm_movemask_ps(vTemp) == 0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) != 0); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Test if less than or equal + uint32x4_t ivTemp1 = vcleq_f32(V, Bounds); + // Negate the bounds + float32x4_t vTemp2 = vnegq_f32(Bounds); + // Test if greater or equal (Reversed) + uint32x4_t ivTemp2 = vcleq_f32(vTemp2, V); + // Blend answers + ivTemp1 = vandq_u32(ivTemp1, ivTemp2); + // in bounds? + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(ivTemp1)), vget_high_u8(vreinterpretq_u8_u32(ivTemp1))); + uint16x4x2_t vTemp3 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp3.val[1]), 1) == 0xFFFFFFFFU); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V, Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds, g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2, V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1, vTemp2); + // All in bounds? + return ((_mm_movemask_ps(vTemp1) == 0x0f) != 0); +#else + return XMComparisonAllInBounds(XMVector4InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(push) +#pragma float_control(precise, on) +#endif + +inline bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2]) || + XMISNAN(V.vector4_f32[3])); +#elif defined(_XM_ARM_NEON_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + return isnan(vgetq_lane_f32(V, 0)) || isnan(vgetq_lane_f32(V, 1)) || isnan(vgetq_lane_f32(V, 2)) || isnan(vgetq_lane_f32(V, 3)); +#else +// Test against itself. NaN is always not equal + uint32x4_t vTempNan = vceqq_f32(V, V); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempNan)), vget_high_u8(vreinterpretq_u8_u32(vTempNan))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + // If any are NaN, the mask is zero + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0xFFFFFFFFU); +#endif +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(__clang__) && defined(__FINITE_MATH_ONLY__) + XM_ALIGNED_DATA(16) float tmp[4]; + _mm_store_ps(tmp, V); + return isnan(tmp[0]) || isnan(tmp[1]) || isnan(tmp[2]) || isnan(tmp[3]); +#else +// Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V, V); + // If any are NaN, the mask is non-zero + return (_mm_movemask_ps(vTempNan) != 0); +#endif +#endif +} + +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) +#pragma float_control(pop) +#endif + +//------------------------------------------------------------------------------ + +inline bool XM_CALLCONV XMVector4IsInfinite(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2]) || + XMISINF(V.vector4_f32[3])); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Mask off the sign bit + uint32x4_t vTempInf = vandq_u32(vreinterpretq_u32_f32(V), g_XMAbsMask); + // Compare to infinity + vTempInf = vceqq_f32(vreinterpretq_f32_u32(vTempInf), g_XMInfinity); + // If any are infinity, the signs are true. + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(vTempInf)), vget_high_u8(vreinterpretq_u8_u32(vTempInf))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + return (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + XMVECTOR vTemp = _mm_and_ps(V, g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp, g_XMInfinity); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp) != 0); +#endif +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result; + Result.f[0] = + Result.f[1] = + Result.f[2] = + Result.f[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2] + V1.vector4_f32[3] * V2.vector4_f32[3]; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vTemp = vmulq_f32(V1, V2); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + return vcombine_f32(v1, v1); +#elif defined(_XM_SSE4_INTRINSICS_) + return _mm_dp_ps(V1, V2, 0xff); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vTemp = _mm_mul_ps(V1, V2); + vTemp = _mm_hadd_ps(vTemp, vTemp); + return _mm_hadd_ps(vTemp, vTemp); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp2 = V2; + XMVECTOR vTemp = _mm_mul_ps(V1, vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2, vTemp, _MM_SHUFFLE(1, 0, 0, 0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2, vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp, vTemp2, _MM_SHUFFLE(0, 3, 0, 0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp, vTemp2); // Add Z and W together + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(2, 2, 2, 2)); // Splat Z and return +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Cross +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) noexcept +{ + // [ ((v2.z*v3.w-v2.w*v3.z)*v1.y)-((v2.y*v3.w-v2.w*v3.y)*v1.z)+((v2.y*v3.z-v2.z*v3.y)*v1.w), + // ((v2.w*v3.z-v2.z*v3.w)*v1.x)-((v2.w*v3.x-v2.x*v3.w)*v1.z)+((v2.z*v3.x-v2.x*v3.z)*v1.w), + // ((v2.y*v3.w-v2.w*v3.y)*v1.x)-((v2.x*v3.w-v2.w*v3.x)*v1.y)+((v2.x*v3.y-v2.y*v3.x)*v1.w), + // ((v2.z*v3.y-v2.y*v3.z)*v1.x)-((v2.z*v3.x-v2.x*v3.z)*v1.y)+((v2.y*v3.x-v2.x*v3.y)*v1.z) ] + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + (((V2.vector4_f32[2] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[2])) * V1.vector4_f32[1]) - (((V2.vector4_f32[1] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[1])) * V1.vector4_f32[2]) + (((V2.vector4_f32[1] * V3.vector4_f32[2]) - (V2.vector4_f32[2] * V3.vector4_f32[1])) * V1.vector4_f32[3]), + (((V2.vector4_f32[3] * V3.vector4_f32[2]) - (V2.vector4_f32[2] * V3.vector4_f32[3])) * V1.vector4_f32[0]) - (((V2.vector4_f32[3] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[3])) * V1.vector4_f32[2]) + (((V2.vector4_f32[2] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[2])) * V1.vector4_f32[3]), + (((V2.vector4_f32[1] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[1])) * V1.vector4_f32[0]) - (((V2.vector4_f32[0] * V3.vector4_f32[3]) - (V2.vector4_f32[3] * V3.vector4_f32[0])) * V1.vector4_f32[1]) + (((V2.vector4_f32[0] * V3.vector4_f32[1]) - (V2.vector4_f32[1] * V3.vector4_f32[0])) * V1.vector4_f32[3]), + (((V2.vector4_f32[2] * V3.vector4_f32[1]) - (V2.vector4_f32[1] * V3.vector4_f32[2])) * V1.vector4_f32[0]) - (((V2.vector4_f32[2] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[2])) * V1.vector4_f32[1]) + (((V2.vector4_f32[1] * V3.vector4_f32[0]) - (V2.vector4_f32[0] * V3.vector4_f32[1])) * V1.vector4_f32[2]), + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + const uint32x2_t select = vget_low_u32(g_XMMaskX); + + // Term1: V2zwyz * V3wzwy + const float32x2_t v2xy = vget_low_f32(V2); + const float32x2_t v2zw = vget_high_f32(V2); + const float32x2_t v2yx = vrev64_f32(v2xy); + const float32x2_t v2wz = vrev64_f32(v2zw); + const float32x2_t v2yz = vbsl_f32(select, v2yx, v2wz); + + const float32x2_t v3zw = vget_high_f32(V3); + const float32x2_t v3wz = vrev64_f32(v3zw); + const float32x2_t v3xy = vget_low_f32(V3); + const float32x2_t v3wy = vbsl_f32(select, v3wz, v3xy); + + float32x4_t vTemp1 = vcombine_f32(v2zw, v2yz); + float32x4_t vTemp2 = vcombine_f32(v3wz, v3wy); + XMVECTOR vResult = vmulq_f32(vTemp1, vTemp2); + + // - V2wzwy * V3zwyz + const float32x2_t v2wy = vbsl_f32(select, v2wz, v2xy); + + const float32x2_t v3yx = vrev64_f32(v3xy); + const float32x2_t v3yz = vbsl_f32(select, v3yx, v3wz); + + vTemp1 = vcombine_f32(v2wz, v2wy); + vTemp2 = vcombine_f32(v3zw, v3yz); + vResult = vmlsq_f32(vResult, vTemp1, vTemp2); + + // term1 * V1yxxx + const float32x2_t v1xy = vget_low_f32(V1); + const float32x2_t v1yx = vrev64_f32(v1xy); + + vTemp1 = vcombine_f32(v1yx, vdup_lane_f32(v1yx, 1)); + vResult = vmulq_f32(vResult, vTemp1); + + // Term2: V2ywxz * V3wxwx + const float32x2_t v2yw = vrev64_f32(v2wy); + const float32x2_t v2xz = vbsl_f32(select, v2xy, v2wz); + + const float32x2_t v3wx = vbsl_f32(select, v3wz, v3yx); + + vTemp1 = vcombine_f32(v2yw, v2xz); + vTemp2 = vcombine_f32(v3wx, v3wx); + float32x4_t vTerm = vmulq_f32(vTemp1, vTemp2); + + // - V2wxwx * V3ywxz + const float32x2_t v2wx = vbsl_f32(select, v2wz, v2yx); + + const float32x2_t v3yw = vrev64_f32(v3wy); + const float32x2_t v3xz = vbsl_f32(select, v3xy, v3wz); + + vTemp1 = vcombine_f32(v2wx, v2wx); + vTemp2 = vcombine_f32(v3yw, v3xz); + vTerm = vmlsq_f32(vTerm, vTemp1, vTemp2); + + // vResult - term2 * V1zzyy + const float32x2_t v1zw = vget_high_f32(V1); + + vTemp1 = vcombine_f32(vdup_lane_f32(v1zw, 0), vdup_lane_f32(v1yx, 0)); + vResult = vmlsq_f32(vResult, vTerm, vTemp1); + + // Term3: V2yzxy * V3zxyx + const float32x2_t v3zx = vrev64_f32(v3xz); + + vTemp1 = vcombine_f32(v2yz, v2xy); + vTemp2 = vcombine_f32(v3zx, v3yx); + vTerm = vmulq_f32(vTemp1, vTemp2); + + // - V2zxyx * V3yzxy + const float32x2_t v2zx = vrev64_f32(v2xz); + + vTemp1 = vcombine_f32(v2zx, v2yx); + vTemp2 = vcombine_f32(v3yz, v3xy); + vTerm = vmlsq_f32(vTerm, vTemp1, vTemp2); + + // vResult + term3 * V1wwwz + const float32x2_t v1wz = vrev64_f32(v1zw); + + vTemp1 = vcombine_f32(vdup_lane_f32(v1wz, 0), v1wz); + return vmlaq_f32(vResult, vTerm, vTemp1); +#elif defined(_XM_SSE_INTRINSICS_) + // V2zwyz * V3wzwy + XMVECTOR vResult = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 1, 3, 2)); + XMVECTOR vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 3, 2, 3)); + vResult = _mm_mul_ps(vResult, vTemp3); + // - V2wzwy * V3zwyz + XMVECTOR vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 3, 2, 3)); + vTemp3 = XM_PERMUTE_PS(vTemp3, _MM_SHUFFLE(1, 3, 0, 1)); + vResult = XM_FNMADD_PS(vTemp2, vTemp3, vResult); + // term1 * V1yxxx + XMVECTOR vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(0, 0, 0, 1)); + vResult = _mm_mul_ps(vResult, vTemp1); + + // V2ywxz * V3wxwx + vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(2, 0, 3, 1)); + vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 3, 0, 3)); + vTemp3 = _mm_mul_ps(vTemp3, vTemp2); + // - V2wxwx * V3ywxz + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(2, 1, 2, 1)); + vTemp1 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(2, 0, 3, 1)); + vTemp3 = XM_FNMADD_PS(vTemp2, vTemp1, vTemp3); + // vResult - temp * V1zzyy + vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(1, 1, 2, 2)); + vResult = XM_FNMADD_PS(vTemp1, vTemp3, vResult); + + // V2yzxy * V3zxyx + vTemp2 = XM_PERMUTE_PS(V2, _MM_SHUFFLE(1, 0, 2, 1)); + vTemp3 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(0, 1, 0, 2)); + vTemp3 = _mm_mul_ps(vTemp3, vTemp2); + // - V2zxyx * V3yzxy + vTemp2 = XM_PERMUTE_PS(vTemp2, _MM_SHUFFLE(2, 0, 2, 1)); + vTemp1 = XM_PERMUTE_PS(V3, _MM_SHUFFLE(1, 0, 2, 1)); + vTemp3 = XM_FNMADD_PS(vTemp1, vTemp2, vTemp3); + // vResult + term * V1wwwz + vTemp1 = XM_PERMUTE_PS(V1, _MM_SHUFFLE(2, 3, 3, 3)); + vResult = XM_FMADD_PS(vTemp3, vTemp1, vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4LengthSq(FXMVECTOR V) noexcept +{ + return XMVector4Dot(V, V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ReciprocalLengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + return vcombine_f32(v2, v2); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + return _mm_rsqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ReciprocalLength(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + // Reciprocal sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + XMVECTOR vLengthSq = _mm_sqrt_ps(vTemp); + return _mm_div_ps(g_XMOne, vLengthSq); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + vLengthSq = _mm_div_ps(g_XMOne, vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the reciprocal + vLengthSq = _mm_sqrt_ps(vLengthSq); + // Accurate! + vLengthSq = _mm_div_ps(g_XMOne, vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4LengthEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt (estimate) + float32x2_t Result = vrsqrte_f32(v1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Length(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + const float32x2_t zero = vdup_n_f32(0); + uint32x2_t VEqualsZero = vceq_f32(v1, zero); + // Sqrt + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + float32x2_t Result = vmul_f32(S1, R1); + Result = vmul_f32(v1, Result); + Result = vbsl_f32(VEqualsZero, zero, Result); + return vcombine_f32(Result, Result); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + return _mm_sqrt_ps(vTemp); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#endif +} + +//------------------------------------------------------------------------------ +// XMVector4NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +inline XMVECTOR XM_CALLCONV XMVector4NormalizeEst(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector4ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + // Reciprocal sqrt (estimate) + v2 = vrsqrte_f32(v1); + // Normalize + return vmulq_f32(V, vcombine_f32(v2, v2)); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vTemp = _mm_dp_ps(V, V, 0xff); + XMVECTOR vResult = _mm_rsqrt_ps(vTemp); + return _mm_mul_ps(vResult, V); +#elif defined(_XM_SSE3_INTRINSICS_) + XMVECTOR vDot = _mm_mul_ps(V, V); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_hadd_ps(vDot, vDot); + vDot = _mm_rsqrt_ps(vDot); + vDot = _mm_mul_ps(vDot, V); + return vDot; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Get the reciprocal + XMVECTOR vResult = _mm_rsqrt_ps(vLengthSq); + // Reciprocal mul to perform the normalization + vResult = _mm_mul_ps(vResult, V); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Normalize(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + float fLength; + XMVECTOR vResult; + + vResult = XMVector4Length(V); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) + { + fLength = 1.0f / fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0] * fLength; + vResult.vector4_f32[1] = V.vector4_f32[1] * fLength; + vResult.vector4_f32[2] = V.vector4_f32[2] * fLength; + vResult.vector4_f32[3] = V.vector4_f32[3] * fLength; + return vResult; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + // Dot4 + float32x4_t vTemp = vmulq_f32(V, V); + float32x2_t v1 = vget_low_f32(vTemp); + float32x2_t v2 = vget_high_f32(vTemp); + v1 = vadd_f32(v1, v2); + v1 = vpadd_f32(v1, v1); + uint32x2_t VEqualsZero = vceq_f32(v1, vdup_n_f32(0)); + uint32x2_t VEqualsInf = vceq_f32(v1, vget_low_f32(g_XMInfinity)); + // Reciprocal sqrt (2 iterations of Newton-Raphson) + float32x2_t S0 = vrsqrte_f32(v1); + float32x2_t P0 = vmul_f32(v1, S0); + float32x2_t R0 = vrsqrts_f32(P0, S0); + float32x2_t S1 = vmul_f32(S0, R0); + float32x2_t P1 = vmul_f32(v1, S1); + float32x2_t R1 = vrsqrts_f32(P1, S1); + v2 = vmul_f32(S1, R1); + // Normalize + XMVECTOR vResult = vmulq_f32(V, vcombine_f32(v2, v2)); + vResult = vbslq_f32(vcombine_u32(VEqualsZero, VEqualsZero), vdupq_n_f32(0), vResult); + return vbslq_f32(vcombine_u32(VEqualsInf, VEqualsInf), g_XMQNaN, vResult); +#elif defined(_XM_SSE4_INTRINSICS_) + XMVECTOR vLengthSq = _mm_dp_ps(V, V, 0xff); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE3_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + vLengthSq = _mm_hadd_ps(vLengthSq, vLengthSq); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V, V); + // vTemp has z and w + XMVECTOR vTemp = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(3, 2, 3, 2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(1, 0, 0, 0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp, vLengthSq, _MM_SHUFFLE(3, 3, 0, 0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq, vTemp); + // Splat the length + vLengthSq = XM_PERMUTE_PS(vLengthSq, _MM_SHUFFLE(2, 2, 2, 2)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask, vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq, g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V, vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult, vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq, g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult, vLengthSq); + vResult = _mm_or_ps(vTemp1, vTemp2); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ClampLength +( + FXMVECTOR V, + float LengthMin, + float LengthMax +) noexcept +{ + XMVECTOR ClampMax = XMVectorReplicate(LengthMax); + XMVECTOR ClampMin = XMVectorReplicate(LengthMin); + + return XMVector4ClampLengthV(V, ClampMin, ClampMax); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) noexcept +{ + assert((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetW(LengthMin) == XMVectorGetX(LengthMin))); + assert((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetW(LengthMax) == XMVectorGetX(LengthMax))); + assert(XMVector4GreaterOrEqual(LengthMin, XMVectorZero())); + assert(XMVector4GreaterOrEqual(LengthMax, XMVectorZero())); + assert(XMVector4GreaterOrEqual(LengthMax, LengthMin)); + + XMVECTOR LengthSq = XMVector4LengthSq(V); + + const XMVECTOR Zero = XMVectorZero(); + + XMVECTOR RcpLength = XMVectorReciprocalSqrt(LengthSq); + + XMVECTOR InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + XMVECTOR ZeroLength = XMVectorEqual(LengthSq, Zero); + + XMVECTOR Normal = XMVectorMultiply(V, RcpLength); + + XMVECTOR Length = XMVectorMultiply(LengthSq, RcpLength); + + XMVECTOR Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + XMVECTOR ControlMax = XMVectorGreater(Length, LengthMax); + XMVECTOR ControlMin = XMVectorLess(Length, LengthMin); + + XMVECTOR ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + XMVECTOR Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + XMVECTOR Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) noexcept +{ + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + + XMVECTOR Result = XMVector4Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + float RefractionIndex +) noexcept +{ + XMVECTOR Index = XMVectorReplicate(RefractionIndex); + return XMVector4RefractV(Incident, Normal, Index); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR IDotN; + XMVECTOR R; + const XMVECTOR Zero = XMVectorZero(); + + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + XMVECTOR Result; + + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + XMVECTOR IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + float32x4_t R = vmlsq_f32(g_XMOne, IDotN, IDotN); + R = vmulq_f32(R, RefractionIndex); + R = vmlsq_f32(g_XMOne, R, RefractionIndex); + + uint32x4_t isrzero = vcleq_f32(R, g_XMZero); + uint8x8x2_t vTemp = vzip_u8(vget_low_u8(vreinterpretq_u8_u32(isrzero)), vget_high_u8(vreinterpretq_u8_u32(isrzero))); + uint16x4x2_t vTemp2 = vzip_u16(vreinterpret_u16_u8(vTemp.val[0]), vreinterpret_u16_u8(vTemp.val[1])); + + float32x4_t vResult; + if (vget_lane_u32(vreinterpret_u32_u16(vTemp2.val[1]), 1) == 0xFFFFFFFFU) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // Sqrt(R) + float32x4_t S0 = vrsqrteq_f32(R); + float32x4_t P0 = vmulq_f32(R, S0); + float32x4_t R0 = vrsqrtsq_f32(P0, S0); + float32x4_t S1 = vmulq_f32(S0, R0); + float32x4_t P1 = vmulq_f32(R, S1); + float32x4_t R1 = vrsqrtsq_f32(P1, S1); + float32x4_t S2 = vmulq_f32(S1, R1); + R = vmulq_f32(R, S2); + // R = RefractionIndex * IDotN + sqrt(R) + R = vmlaq_f32(R, RefractionIndex, IDotN); + // Result = RefractionIndex * Incident - Normal * R + vResult = vmulq_f32(RefractionIndex, Incident); + vResult = vmlsq_f32(vResult, R, Normal); + } + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = XM_FNMADD_PS(IDotN, IDotN, g_XMOne); + XMVECTOR R2 = _mm_mul_ps(RefractionIndex, RefractionIndex); + R = XM_FNMADD_PS(R, R2, g_XMOne); + + XMVECTOR vResult = _mm_cmple_ps(R, g_XMZero); + if (_mm_movemask_ps(vResult) == 0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + R = XM_FMADD_PS(RefractionIndex, IDotN, R); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + vResult = XM_FNMADD_PS(R, Normal, vResult); + } + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Orthogonal(FXMVECTOR V) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTORF32 Result = { { { + V.vector4_f32[2], + V.vector4_f32[3], + -V.vector4_f32[0], + -V.vector4_f32[1] + } } }; + return Result.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Negate = { { { 1.f, 1.f, -1.f, -1.f } } }; + + float32x4_t Result = vcombine_f32(vget_high_f32(V), vget_low_f32(V)); + return vmulq_f32(Result, Negate); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FlipZW = { { { 1.0f, 1.0f, -1.0f, -1.0f } } }; + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 0, 3, 2)); + vResult = _mm_mul_ps(vResult, FlipZW); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector4Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACosEst(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) noexcept +{ + XMVECTOR Result = XMVector4Dot(N1, N2); + Result = XMVectorClamp(Result, g_XMNegativeOne.v, g_XMOne.v); + Result = XMVectorACos(Result); + return Result; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) noexcept +{ + XMVECTOR L1 = XMVector4ReciprocalLength(V1); + XMVECTOR L2 = XMVector4ReciprocalLength(V2); + + XMVECTOR Dot = XMVector4Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + XMVECTOR CosAngle = XMVectorMultiply(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne.v, g_XMOne.v); + + return XMVectorACos(CosAngle); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV XMVector4Transform +( + FXMVECTOR V, + FXMMATRIX M +) noexcept +{ +#if defined(_XM_NO_INTRINSICS_) + + float fX = (M.m[0][0] * V.vector4_f32[0]) + (M.m[1][0] * V.vector4_f32[1]) + (M.m[2][0] * V.vector4_f32[2]) + (M.m[3][0] * V.vector4_f32[3]); + float fY = (M.m[0][1] * V.vector4_f32[0]) + (M.m[1][1] * V.vector4_f32[1]) + (M.m[2][1] * V.vector4_f32[2]) + (M.m[3][1] * V.vector4_f32[3]); + float fZ = (M.m[0][2] * V.vector4_f32[0]) + (M.m[1][2] * V.vector4_f32[1]) + (M.m[2][2] * V.vector4_f32[2]) + (M.m[3][2] * V.vector4_f32[3]); + float fW = (M.m[0][3] * V.vector4_f32[0]) + (M.m[1][3] * V.vector4_f32[1]) + (M.m[2][3] * V.vector4_f32[2]) + (M.m[3][3] * V.vector4_f32[3]); + XMVECTORF32 vResult = { { { fX, fY, fZ, fW } } }; + return vResult.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmulq_lane_f32(M.r[0], VL, 0); // X + vResult = vmlaq_lane_f32(vResult, M.r[1], VL, 1); // Y + float32x2_t VH = vget_high_f32(V); + vResult = vmlaq_lane_f32(vResult, M.r[2], VH, 0); // Z + return vmlaq_lane_f32(vResult, M.r[3], VH, 1); // W +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); // W + vResult = _mm_mul_ps(vResult, M.r[3]); + XMVECTOR vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); // Z + vResult = XM_FMADD_PS(vTemp, M.r[2], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); // Y + vResult = XM_FMADD_PS(vTemp, M.r[1], vResult); + vTemp = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); // X + vResult = XM_FMADD_PS(vTemp, M.r[0], vResult); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream +( + XMFLOAT4* pOutputStream, + size_t OutputStride, + const XMFLOAT4* pInputStream, + size_t InputStride, + size_t VectorCount, + FXMMATRIX M +) noexcept +{ + assert(pOutputStream != nullptr); + assert(pInputStream != nullptr); + + assert(InputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(InputStride >= sizeof(XMFLOAT4)); + + assert(OutputStride >= sizeof(XMFLOAT4)); + _Analysis_assume_(OutputStride >= sizeof(XMFLOAT4)); + +#if defined(_XM_NO_INTRINSICS_) + + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (size_t i = 0; i < VectorCount; i++) + { + XMVECTOR V = XMLoadFloat4(reinterpret_cast(pInputVector)); + XMVECTOR W = XMVectorSplatW(V); + XMVECTOR Z = XMVectorSplatZ(V); + XMVECTOR Y = XMVectorSplatY(V); + XMVECTOR X = XMVectorSplatX(V); + + XMVECTOR Result = XMVectorMultiply(W, row3); + Result = XMVectorMultiplyAdd(Z, row2, Result); + Result = XMVectorMultiplyAdd(Y, row1, Result); + Result = XMVectorMultiplyAdd(X, row0, Result); + + #ifdef _PREFAST_ + #pragma prefast(push) + #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) + #endif + + XMStoreFloat4(reinterpret_cast(pOutputVector), Result); + + #ifdef _PREFAST_ + #pragma prefast(pop) + #endif + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + size_t i = 0; + size_t four = VectorCount >> 2; + if (four > 0) + { + if ((InputStride == sizeof(XMFLOAT4)) && (OutputStride == sizeof(XMFLOAT4))) + { + for (size_t j = 0; j < four; ++j) + { + float32x4x4_t V = vld4q_f32(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 4; + + float32x2_t r = vget_low_f32(row0); + XMVECTOR vResult0 = vmulq_lane_f32(V.val[0], r, 0); // Ax + XMVECTOR vResult1 = vmulq_lane_f32(V.val[0], r, 1); // Bx + + XM_PREFETCH(pInputVector); + + r = vget_high_f32(row0); + XMVECTOR vResult2 = vmulq_lane_f32(V.val[0], r, 0); // Cx + XMVECTOR vResult3 = vmulq_lane_f32(V.val[0], r, 1); // Dx + + XM_PREFETCH(pInputVector + XM_CACHE_LINE_SIZE); + + r = vget_low_f32(row1); + vResult0 = vmlaq_lane_f32(vResult0, V.val[1], r, 0); // Ax+Ey + vResult1 = vmlaq_lane_f32(vResult1, V.val[1], r, 1); // Bx+Fy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 2)); + + r = vget_high_f32(row1); + vResult2 = vmlaq_lane_f32(vResult2, V.val[1], r, 0); // Cx+Gy + vResult3 = vmlaq_lane_f32(vResult3, V.val[1], r, 1); // Dx+Hy + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 3)); + + r = vget_low_f32(row2); + vResult0 = vmlaq_lane_f32(vResult0, V.val[2], r, 0); // Ax+Ey+Iz + vResult1 = vmlaq_lane_f32(vResult1, V.val[2], r, 1); // Bx+Fy+Jz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 4)); + + r = vget_high_f32(row2); + vResult2 = vmlaq_lane_f32(vResult2, V.val[2], r, 0); // Cx+Gy+Kz + vResult3 = vmlaq_lane_f32(vResult3, V.val[2], r, 1); // Dx+Hy+Lz + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 5)); + + r = vget_low_f32(row3); + vResult0 = vmlaq_lane_f32(vResult0, V.val[3], r, 0); // Ax+Ey+Iz+Mw + vResult1 = vmlaq_lane_f32(vResult1, V.val[3], r, 1); // Bx+Fy+Jz+Nw + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 6)); + + r = vget_high_f32(row3); + vResult2 = vmlaq_lane_f32(vResult2, V.val[3], r, 0); // Cx+Gy+Kz+Ow + vResult3 = vmlaq_lane_f32(vResult3, V.val[3], r, 1); // Dx+Hy+Lz+Pw + + XM_PREFETCH(pInputVector + (XM_CACHE_LINE_SIZE * 7)); + + V.val[0] = vResult0; + V.val[1] = vResult1; + V.val[2] = vResult2; + V.val[3] = vResult3; + + vst4q_f32(reinterpret_cast(pOutputVector), V); + pOutputVector += sizeof(XMFLOAT4) * 4; + + i += 4; + } + } + } + + for (; i < VectorCount; i++) + { + XMVECTOR V = vld1q_f32(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + float32x2_t VL = vget_low_f32(V); + XMVECTOR vResult = vmulq_lane_f32(row0, VL, 0); // X + vResult = vmlaq_lane_f32(vResult, row1, VL, 1); // Y + float32x2_t VH = vget_high_f32(V); + vResult = vmlaq_lane_f32(vResult, row2, VH, 0); // Z + vResult = vmlaq_lane_f32(vResult, row3, VH, 1); // W + + vst1q_f32(reinterpret_cast(pOutputVector), vResult); + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_AVX2_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t two = VectorCount >> 1; + if (two > 0) + { + __m256 row0 = _mm256_broadcast_ps(&M.r[0]); + __m256 row1 = _mm256_broadcast_ps(&M.r[1]); + __m256 row2 = _mm256_broadcast_ps(&M.r[2]); + __m256 row3 = _mm256_broadcast_ps(&M.r[3]); + + if (InputStride == sizeof(XMFLOAT4)) + { + if (OutputStride == sizeof(XMFLOAT4)) + { + if (!(reinterpret_cast(pOutputStream) & 0x1F)) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < two; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 2; + + __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm256_mul_ps(vTempX, row0); + vTempY = _mm256_mul_ps(vTempY, row1); + vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); + vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); + vTempX = _mm256_add_ps(vTempZ, vTempW); + + XM256_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 2; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < two; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 2; + + __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm256_mul_ps(vTempX, row0); + vTempY = _mm256_mul_ps(vTempY, row1); + vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); + vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); + vTempX = _mm256_add_ps(vTempZ, vTempW); + + _mm256_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += sizeof(XMFLOAT4) * 2; + + i += 2; + } + } + } + else + { + // Packed input, unpacked output + for (size_t j = 0; j < two; ++j) + { + __m256 VV = _mm256_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += sizeof(XMFLOAT4) * 2; + + __m256 vTempX = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(0, 0, 0, 0)); + __m256 vTempY = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(1, 1, 1, 1)); + __m256 vTempZ = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(2, 2, 2, 2)); + __m256 vTempW = _mm256_shuffle_ps(VV, VV, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm256_mul_ps(vTempX, row0); + vTempY = _mm256_mul_ps(vTempY, row1); + vTempZ = _mm256_fmadd_ps(vTempZ, row2, vTempX); + vTempW = _mm256_fmadd_ps(vTempW, row3, vTempY); + vTempX = _mm256_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_castps256_ps128(vTempX)); + pOutputVector += OutputStride; + + _mm_storeu_ps(reinterpret_cast(pOutputVector), _mm256_extractf128_ps(vTempX, 1)); + pOutputVector += OutputStride; + i += 2; + } + } + } + } + + if (i < VectorCount) + { + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + for (; i < VectorCount; i++) + { + __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_SSE_INTRINSICS_) + auto pInputVector = reinterpret_cast(pInputStream); + auto pOutputVector = reinterpret_cast(pOutputStream); + + const XMVECTOR row0 = M.r[0]; + const XMVECTOR row1 = M.r[1]; + const XMVECTOR row2 = M.r[2]; + const XMVECTOR row3 = M.r[3]; + + if (!(reinterpret_cast(pOutputStream) & 0xF) && !(OutputStride & 0xF)) + { + if (!(reinterpret_cast(pInputStream) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input, aligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_load_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input, aligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + XM_STREAM_PS(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + } + else + { + if (!(reinterpret_cast(pInputStream) & 0xF) && !(InputStride & 0xF)) + { + // Aligned input, unaligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_load_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + else + { + // Unaligned input, unaligned output + for (size_t i = 0; i < VectorCount; i++) + { + __m128 V = _mm_loadu_ps(reinterpret_cast(pInputVector)); + pInputVector += InputStride; + + XMVECTOR vTempX = XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0)); + XMVECTOR vTempY = XM_PERMUTE_PS(V, _MM_SHUFFLE(1, 1, 1, 1)); + XMVECTOR vTempZ = XM_PERMUTE_PS(V, _MM_SHUFFLE(2, 2, 2, 2)); + XMVECTOR vTempW = XM_PERMUTE_PS(V, _MM_SHUFFLE(3, 3, 3, 3)); + + vTempX = _mm_mul_ps(vTempX, row0); + vTempY = _mm_mul_ps(vTempY, row1); + vTempZ = XM_FMADD_PS(vTempZ, row2, vTempX); + vTempW = XM_FMADD_PS(vTempW, row3, vTempY); + vTempX = _mm_add_ps(vTempZ, vTempW); + + _mm_storeu_ps(reinterpret_cast(pOutputVector), vTempX); + pOutputVector += OutputStride; + } + } + } + + XM_SFENCE(); + + return pOutputStream; +#endif +} + +/**************************************************************************** + * + * XMVECTOR operators + * + ****************************************************************************/ + +#ifndef _XM_NO_XMVECTOR_OVERLOADS_ + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator+ (FXMVECTOR V) noexcept +{ + return V; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator- (FXMVECTOR V) noexcept +{ + return XMVectorNegate(V); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator+= +( + XMVECTOR& V1, + FXMVECTOR V2 + ) noexcept +{ + V1 = XMVectorAdd(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator-= +( + XMVECTOR& V1, + FXMVECTOR V2 + ) noexcept +{ + V1 = XMVectorSubtract(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator*= +( + XMVECTOR& V1, + FXMVECTOR V2 + ) noexcept +{ + V1 = XMVectorMultiply(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& XM_CALLCONV operator/= +( + XMVECTOR& V1, + FXMVECTOR V2 + ) noexcept +{ + V1 = XMVectorDivide(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& operator*= +( + XMVECTOR& V, + const float S + ) noexcept +{ + V = XMVectorScale(V, S); + return V; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR& operator/= +( + XMVECTOR& V, + const float S + ) noexcept +{ + XMVECTOR vS = XMVectorReplicate(S); + V = XMVectorDivide(V, vS); + return V; +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator+ +( + FXMVECTOR V1, + FXMVECTOR V2 + ) noexcept +{ + return XMVectorAdd(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator- +( + FXMVECTOR V1, + FXMVECTOR V2 + ) noexcept +{ + return XMVectorSubtract(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator* +( + FXMVECTOR V1, + FXMVECTOR V2 + ) noexcept +{ + return XMVectorMultiply(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator/ +( + FXMVECTOR V1, + FXMVECTOR V2 + ) noexcept +{ + return XMVectorDivide(V1, V2); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator* +( + FXMVECTOR V, + const float S + ) noexcept +{ + return XMVectorScale(V, S); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator/ +( + FXMVECTOR V, + const float S + ) noexcept +{ + XMVECTOR vS = XMVectorReplicate(S); + return XMVectorDivide(V, vS); +} + +//------------------------------------------------------------------------------ + +inline XMVECTOR XM_CALLCONV operator* +( + float S, + FXMVECTOR V + ) noexcept +{ + return XMVectorScale(V, S); +} + +#endif /* !_XM_NO_XMVECTOR_OVERLOADS_ */ + +#if defined(_XM_NO_INTRINSICS_) +#undef XMISNAN +#undef XMISINF +#endif + +#if defined(_XM_SSE_INTRINSICS_) +#undef XM3UNPACK3INTO4 +#undef XM3PACK4INTO3 +#endif + diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXPackedVector.h b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXPackedVector.h similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXPackedVector.h rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXPackedVector.h index 2487c67eb..4442fde21 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXPackedVector.h +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXPackedVector.h @@ -1,1329 +1,1329 @@ -//------------------------------------------------------------------------------------- -// DirectXPackedVector.h -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -#include "DirectXMath.h" - -namespace DirectX { - -namespace PackedVector { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4201 4365 4324 4996) -// C4201: nonstandard extension used -// C4365: Off by default noise -// C4324: alignment padding warnings -// C4996: deprecation warnings -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -#pragma clang diagnostic ignored "-Wnested-anon-types" -#endif - -//------------------------------------------------------------------------------ -// ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into -// a 32 bit integer. The normalized color is packed into 32 bits using 8 bit -// unsigned, normalized integers for the alpha, red, green, and blue components. -// The alpha component is stored in the most significant bits and the blue -// component in the least significant bits (A8R8G8B8): -// [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0] -struct XMCOLOR { - union { - struct { - uint8_t b; // Blue: 0/255 to 255/255 - uint8_t g; // Green: 0/255 to 255/255 - uint8_t r; // Red: 0/255 to 255/255 - uint8_t a; // Alpha: 0/255 to 255/255 - }; - uint32_t c; - }; - - XMCOLOR() = default; - - XMCOLOR(const XMCOLOR&) = default; - XMCOLOR& operator=(const XMCOLOR&) = default; - - XMCOLOR(XMCOLOR&&) = default; - XMCOLOR& operator=(XMCOLOR&&) = default; - - constexpr XMCOLOR(uint32_t Color) noexcept : c(Color) {} - XMCOLOR(float _r, float _g, float _b, float _a) noexcept; - explicit XMCOLOR(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return c; } - - XMCOLOR& operator=(const uint32_t Color) noexcept { - c = Color; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 16 bit floating point number consisting of a sign bit, a 5 bit biased -// exponent, and a 10 bit mantissa -using HALF = uint16_t; - -//------------------------------------------------------------------------------ -// 2D Vector; 16 bit floating point components -struct XMHALF2 { - union { - struct { - HALF x; - HALF y; - }; - uint32_t v; - }; - - XMHALF2() = default; - - XMHALF2(const XMHALF2&) = default; - XMHALF2& operator=(const XMHALF2&) = default; - - XMHALF2(XMHALF2&&) = default; - XMHALF2& operator=(XMHALF2&&) = default; - - explicit constexpr XMHALF2(uint32_t Packed) noexcept : v(Packed) {} - constexpr XMHALF2(HALF _x, HALF _y) noexcept : x(_x), y(_y) {} - explicit XMHALF2(_In_reads_(2) const HALF* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMHALF2(float _x, float _y) noexcept; - explicit XMHALF2(_In_reads_(2) const float* pArray) noexcept; - - XMHALF2& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 2D Vector; 16 bit signed normalized integer components -struct XMSHORTN2 { - union { - struct { - int16_t x; - int16_t y; - }; - uint32_t v; - }; - - XMSHORTN2() = default; - - XMSHORTN2(const XMSHORTN2&) = default; - XMSHORTN2& operator=(const XMSHORTN2&) = default; - - XMSHORTN2(XMSHORTN2&&) = default; - XMSHORTN2& operator=(XMSHORTN2&&) = default; - - explicit constexpr XMSHORTN2(uint32_t Packed) noexcept : v(Packed) {} - constexpr XMSHORTN2(int16_t _x, int16_t _y) noexcept : x(_x), y(_y) {} - explicit XMSHORTN2(_In_reads_(2) const int16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMSHORTN2(float _x, float _y) noexcept; - explicit XMSHORTN2(_In_reads_(2) const float* pArray) noexcept; - - XMSHORTN2& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 2D Vector; 16 bit signed integer components -struct XMSHORT2 { - union { - struct { - int16_t x; - int16_t y; - }; - uint32_t v; - }; - - XMSHORT2() = default; - - XMSHORT2(const XMSHORT2&) = default; - XMSHORT2& operator=(const XMSHORT2&) = default; - - XMSHORT2(XMSHORT2&&) = default; - XMSHORT2& operator=(XMSHORT2&&) = default; - - explicit constexpr XMSHORT2(uint32_t Packed) noexcept : v(Packed) {} - constexpr XMSHORT2(int16_t _x, int16_t _y) noexcept : x(_x), y(_y) {} - explicit XMSHORT2(_In_reads_(2) const int16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMSHORT2(float _x, float _y) noexcept; - explicit XMSHORT2(_In_reads_(2) const float* pArray) noexcept; - - XMSHORT2& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 2D Vector; 16 bit unsigned normalized integer components -struct XMUSHORTN2 { - union { - struct { - uint16_t x; - uint16_t y; - }; - uint32_t v; - }; - - XMUSHORTN2() = default; - - XMUSHORTN2(const XMUSHORTN2&) = default; - XMUSHORTN2& operator=(const XMUSHORTN2&) = default; - - XMUSHORTN2(XMUSHORTN2&&) = default; - XMUSHORTN2& operator=(XMUSHORTN2&&) = default; - - explicit constexpr XMUSHORTN2(uint32_t Packed) noexcept : v(Packed) {} - constexpr XMUSHORTN2(uint16_t _x, uint16_t _y) noexcept : x(_x), y(_y) {} - explicit XMUSHORTN2(_In_reads_(2) const uint16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMUSHORTN2(float _x, float _y) noexcept; - explicit XMUSHORTN2(_In_reads_(2) const float* pArray) noexcept; - - XMUSHORTN2& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 2D Vector; 16 bit unsigned integer components -struct XMUSHORT2 { - union { - struct { - uint16_t x; - uint16_t y; - }; - uint32_t v; - }; - - XMUSHORT2() = default; - - XMUSHORT2(const XMUSHORT2&) = default; - XMUSHORT2& operator=(const XMUSHORT2&) = default; - - XMUSHORT2(XMUSHORT2&&) = default; - XMUSHORT2& operator=(XMUSHORT2&&) = default; - - explicit constexpr XMUSHORT2(uint32_t Packed) noexcept : v(Packed) {} - constexpr XMUSHORT2(uint16_t _x, uint16_t _y) noexcept : x(_x), y(_y) {} - explicit XMUSHORT2(_In_reads_(2) const uint16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMUSHORT2(float _x, float _y) noexcept; - explicit XMUSHORT2(_In_reads_(2) const float* pArray) noexcept; - - XMUSHORT2& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 2D Vector; 8 bit signed normalized integer components -struct XMBYTEN2 { - union { - struct { - int8_t x; - int8_t y; - }; - uint16_t v; - }; - - XMBYTEN2() = default; - - XMBYTEN2(const XMBYTEN2&) = default; - XMBYTEN2& operator=(const XMBYTEN2&) = default; - - XMBYTEN2(XMBYTEN2&&) = default; - XMBYTEN2& operator=(XMBYTEN2&&) = default; - - explicit constexpr XMBYTEN2(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMBYTEN2(int8_t _x, int8_t _y) noexcept : x(_x), y(_y) {} - explicit XMBYTEN2(_In_reads_(2) const int8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMBYTEN2(float _x, float _y) noexcept; - explicit XMBYTEN2(_In_reads_(2) const float* pArray) noexcept; - - XMBYTEN2& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 2D Vector; 8 bit signed integer components -struct XMBYTE2 { - union { - struct { - int8_t x; - int8_t y; - }; - uint16_t v; - }; - - XMBYTE2() = default; - - XMBYTE2(const XMBYTE2&) = default; - XMBYTE2& operator=(const XMBYTE2&) = default; - - XMBYTE2(XMBYTE2&&) = default; - XMBYTE2& operator=(XMBYTE2&&) = default; - - explicit constexpr XMBYTE2(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMBYTE2(int8_t _x, int8_t _y) noexcept : x(_x), y(_y) {} - explicit XMBYTE2(_In_reads_(2) const int8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMBYTE2(float _x, float _y) noexcept; - explicit XMBYTE2(_In_reads_(2) const float* pArray) noexcept; - - XMBYTE2& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 2D Vector; 8 bit unsigned normalized integer components -struct XMUBYTEN2 { - union { - struct { - uint8_t x; - uint8_t y; - }; - uint16_t v; - }; - - XMUBYTEN2() = default; - - XMUBYTEN2(const XMUBYTEN2&) = default; - XMUBYTEN2& operator=(const XMUBYTEN2&) = default; - - XMUBYTEN2(XMUBYTEN2&&) = default; - XMUBYTEN2& operator=(XMUBYTEN2&&) = default; - - explicit constexpr XMUBYTEN2(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMUBYTEN2(uint8_t _x, uint8_t _y) noexcept : x(_x), y(_y) {} - explicit XMUBYTEN2(_In_reads_(2) const uint8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMUBYTEN2(float _x, float _y) noexcept; - explicit XMUBYTEN2(_In_reads_(2) const float* pArray) noexcept; - - XMUBYTEN2& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 2D Vector; 8 bit unsigned integer components -struct XMUBYTE2 { - union { - struct { - uint8_t x; - uint8_t y; - }; - uint16_t v; - }; - - XMUBYTE2() = default; - - XMUBYTE2(const XMUBYTE2&) = default; - XMUBYTE2& operator=(const XMUBYTE2&) = default; - - XMUBYTE2(XMUBYTE2&&) = default; - XMUBYTE2& operator=(XMUBYTE2&&) = default; - - explicit constexpr XMUBYTE2(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMUBYTE2(uint8_t _x, uint8_t _y) noexcept : x(_x), y(_y) {} - explicit XMUBYTE2(_In_reads_(2) const uint8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]) {} - XMUBYTE2(float _x, float _y) noexcept; - explicit XMUBYTE2(_In_reads_(2) const float* pArray) noexcept; - - XMUBYTE2& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 3D vector: 5/6/5 unsigned integer components -struct XMU565 { - union { - struct { - uint16_t x : 5; // 0 to 31 - uint16_t y : 6; // 0 to 63 - uint16_t z : 5; // 0 to 31 - }; - uint16_t v; - }; - - XMU565() = default; - - XMU565(const XMU565&) = default; - XMU565& operator=(const XMU565&) = default; - - XMU565(XMU565&&) = default; - XMU565& operator=(XMU565&&) = default; - - explicit constexpr XMU565(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMU565(uint8_t _x, uint8_t _y, uint8_t _z) noexcept - : x(_x), y(_y), z(_z) {} - explicit XMU565(_In_reads_(3) const uint8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} - XMU565(float _x, float _y, float _z) noexcept; - explicit XMU565(_In_reads_(3) const float* pArray) noexcept; - - operator uint16_t() const noexcept { return v; } - - XMU565& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 3D vector: 11/11/10 floating-point components -// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent -// and 6-bit mantissa for x component, a 5-bit biased exponent and -// 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit -// mantissa for z. The z component is stored in the most significant bits -// and the x component in the least significant bits. No sign bits so -// all partial-precision numbers are positive. -// (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0] -struct XMFLOAT3PK { - union { - struct { - uint32_t xm : 6; // x-mantissa - uint32_t xe : 5; // x-exponent - uint32_t ym : 6; // y-mantissa - uint32_t ye : 5; // y-exponent - uint32_t zm : 5; // z-mantissa - uint32_t ze : 5; // z-exponent - }; - uint32_t v; - }; - - XMFLOAT3PK() = default; - - XMFLOAT3PK(const XMFLOAT3PK&) = default; - XMFLOAT3PK& operator=(const XMFLOAT3PK&) = default; - - XMFLOAT3PK(XMFLOAT3PK&&) = default; - XMFLOAT3PK& operator=(XMFLOAT3PK&&) = default; - - explicit constexpr XMFLOAT3PK(uint32_t Packed) noexcept : v(Packed) {} - XMFLOAT3PK(float _x, float _y, float _z) noexcept; - explicit XMFLOAT3PK(_In_reads_(3) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMFLOAT3PK& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 3D vector: 9/9/9 floating-point components with shared 5-bit exponent -// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent -// with 9-bit mantissa for the x, y, and z component. The shared exponent -// is stored in the most significant bits and the x component mantissa is in -// the least significant bits. No sign bits so all partial-precision numbers -// are positive. -// (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0] -struct XMFLOAT3SE { - union { - struct { - uint32_t xm : 9; // x-mantissa - uint32_t ym : 9; // y-mantissa - uint32_t zm : 9; // z-mantissa - uint32_t e : 5; // shared exponent - }; - uint32_t v; - }; - - XMFLOAT3SE() = default; - - XMFLOAT3SE(const XMFLOAT3SE&) = default; - XMFLOAT3SE& operator=(const XMFLOAT3SE&) = default; - - XMFLOAT3SE(XMFLOAT3SE&&) = default; - XMFLOAT3SE& operator=(XMFLOAT3SE&&) = default; - - explicit constexpr XMFLOAT3SE(uint32_t Packed) noexcept : v(Packed) {} - XMFLOAT3SE(float _x, float _y, float _z) noexcept; - explicit XMFLOAT3SE(_In_reads_(3) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMFLOAT3SE& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 4D Vector; 16 bit floating point components -struct XMHALF4 { - union { - struct { - HALF x; - HALF y; - HALF z; - HALF w; - }; - uint64_t v; - }; - - XMHALF4() = default; - - XMHALF4(const XMHALF4&) = default; - XMHALF4& operator=(const XMHALF4&) = default; - - XMHALF4(XMHALF4&&) = default; - XMHALF4& operator=(XMHALF4&&) = default; - - explicit constexpr XMHALF4(uint64_t Packed) noexcept : v(Packed) {} - constexpr XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMHALF4(_In_reads_(4) const HALF* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMHALF4(float _x, float _y, float _z, float _w) noexcept; - explicit XMHALF4(_In_reads_(4) const float* pArray) noexcept; - - XMHALF4& operator=(uint64_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 4D Vector; 16 bit signed normalized integer components -struct XMSHORTN4 { - union { - struct { - int16_t x; - int16_t y; - int16_t z; - int16_t w; - }; - uint64_t v; - }; - - XMSHORTN4() = default; - - XMSHORTN4(const XMSHORTN4&) = default; - XMSHORTN4& operator=(const XMSHORTN4&) = default; - - XMSHORTN4(XMSHORTN4&&) = default; - XMSHORTN4& operator=(XMSHORTN4&&) = default; - - explicit constexpr XMSHORTN4(uint64_t Packed) noexcept : v(Packed) {} - constexpr XMSHORTN4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMSHORTN4(_In_reads_(4) const int16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMSHORTN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMSHORTN4(_In_reads_(4) const float* pArray) noexcept; - - XMSHORTN4& operator=(uint64_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 16 bit signed integer components -struct XMSHORT4 { - union { - struct { - int16_t x; - int16_t y; - int16_t z; - int16_t w; - }; - uint64_t v; - }; - - XMSHORT4() = default; - - XMSHORT4(const XMSHORT4&) = default; - XMSHORT4& operator=(const XMSHORT4&) = default; - - XMSHORT4(XMSHORT4&&) = default; - XMSHORT4& operator=(XMSHORT4&&) = default; - - explicit constexpr XMSHORT4(uint64_t Packed) noexcept : v(Packed) {} - constexpr XMSHORT4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMSHORT4(_In_reads_(4) const int16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMSHORT4(float _x, float _y, float _z, float _w) noexcept; - explicit XMSHORT4(_In_reads_(4) const float* pArray) noexcept; - - XMSHORT4& operator=(uint64_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 16 bit unsigned normalized integer components -struct XMUSHORTN4 { - union { - struct { - uint16_t x; - uint16_t y; - uint16_t z; - uint16_t w; - }; - uint64_t v; - }; - - XMUSHORTN4() = default; - - XMUSHORTN4(const XMUSHORTN4&) = default; - XMUSHORTN4& operator=(const XMUSHORTN4&) = default; - - XMUSHORTN4(XMUSHORTN4&&) = default; - XMUSHORTN4& operator=(XMUSHORTN4&&) = default; - - explicit constexpr XMUSHORTN4(uint64_t Packed) noexcept : v(Packed) {} - constexpr XMUSHORTN4(uint16_t _x, uint16_t _y, uint16_t _z, - uint16_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMUSHORTN4(_In_reads_(4) const uint16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMUSHORTN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUSHORTN4(_In_reads_(4) const float* pArray) noexcept; - - XMUSHORTN4& operator=(uint64_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 16 bit unsigned integer components -struct XMUSHORT4 { - union { - struct { - uint16_t x; - uint16_t y; - uint16_t z; - uint16_t w; - }; - uint64_t v; - }; - - XMUSHORT4() = default; - - XMUSHORT4(const XMUSHORT4&) = default; - XMUSHORT4& operator=(const XMUSHORT4&) = default; - - XMUSHORT4(XMUSHORT4&&) = default; - XMUSHORT4& operator=(XMUSHORT4&&) = default; - - explicit constexpr XMUSHORT4(uint64_t Packed) noexcept : v(Packed) {} - constexpr XMUSHORT4(uint16_t _x, uint16_t _y, uint16_t _z, - uint16_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMUSHORT4(_In_reads_(4) const uint16_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMUSHORT4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUSHORT4(_In_reads_(4) const float* pArray) noexcept; - - XMUSHORT4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer -// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, -// normalized integer for the w component and 10 bit signed, normalized -// integers for the z, y, and x components. The w component is stored in the -// most significant bits and the x component in the least significant bits -// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] -struct XMXDECN4 { - union { - struct { - int32_t x : 10; // -511/511 to 511/511 - int32_t y : 10; // -511/511 to 511/511 - int32_t z : 10; // -511/511 to 511/511 - uint32_t w : 2; // 0/3 to 3/3 - }; - uint32_t v; - }; - - XMXDECN4() = default; - - XMXDECN4(const XMXDECN4&) = default; - XMXDECN4& operator=(const XMXDECN4&) = default; - - XMXDECN4(XMXDECN4&&) = default; - XMXDECN4& operator=(XMXDECN4&&) = default; - - explicit constexpr XMXDECN4(uint32_t Packed) : v(Packed) {} - XMXDECN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMXDECN4(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMXDECN4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer -// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned -// integer for the w component and 10 bit signed integers for the -// z, y, and x components. The w component is stored in the -// most significant bits and the x component in the least significant bits -// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] -struct XM_DEPRECATED XMXDEC4 { - union { - struct { - int32_t x : 10; // -511 to 511 - int32_t y : 10; // -511 to 511 - int32_t z : 10; // -511 to 511 - uint32_t w : 2; // 0 to 3 - }; - uint32_t v; - }; - - XMXDEC4() = default; - - XMXDEC4(const XMXDEC4&) = default; - XMXDEC4& operator=(const XMXDEC4&) = default; - - XMXDEC4(XMXDEC4&&) = default; - XMXDEC4& operator=(XMXDEC4&&) = default; - - explicit constexpr XMXDEC4(uint32_t Packed) noexcept : v(Packed) {} - XMXDEC4(float _x, float _y, float _z, float _w) noexcept; - explicit XMXDEC4(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMXDEC4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer -// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed, -// normalized integer for the w component and 10 bit signed, normalized -// integers for the z, y, and x components. The w component is stored in the -// most significant bits and the x component in the least significant bits -// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] -struct XM_DEPRECATED XMDECN4 { - union { - struct { - int32_t x : 10; // -511/511 to 511/511 - int32_t y : 10; // -511/511 to 511/511 - int32_t z : 10; // -511/511 to 511/511 - int32_t w : 2; // -1/1 to 1/1 - }; - uint32_t v; - }; - - XMDECN4() = default; - - XMDECN4(const XMDECN4&) = default; - XMDECN4& operator=(const XMDECN4&) = default; - - XMDECN4(XMDECN4&&) = default; - XMDECN4& operator=(XMDECN4&&) = default; - - explicit constexpr XMDECN4(uint32_t Packed) noexcept : v(Packed) {} - XMDECN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMDECN4(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMDECN4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer -// The 4D Vector is packed into 32 bits as follows: a 2 bit signed, -// integer for the w component and 10 bit signed integers for the -// z, y, and x components. The w component is stored in the -// most significant bits and the x component in the least significant bits -// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] -struct XM_DEPRECATED XMDEC4 { - union { - struct { - int32_t x : 10; // -511 to 511 - int32_t y : 10; // -511 to 511 - int32_t z : 10; // -511 to 511 - int32_t w : 2; // -1 to 1 - }; - uint32_t v; - }; - - XMDEC4() = default; - - XMDEC4(const XMDEC4&) = default; - XMDEC4& operator=(const XMDEC4&) = default; - - XMDEC4(XMDEC4&&) = default; - XMDEC4& operator=(XMDEC4&&) = default; - - explicit constexpr XMDEC4(uint32_t Packed) noexcept : v(Packed) {} - XMDEC4(float _x, float _y, float _z, float _w) noexcept; - explicit XMDEC4(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMDEC4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer -// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, -// normalized integer for the w component and 10 bit unsigned, normalized -// integers for the z, y, and x components. The w component is stored in the -// most significant bits and the x component in the least significant bits -// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] -struct XMUDECN4 { - union { - struct { - uint32_t x : 10; // 0/1023 to 1023/1023 - uint32_t y : 10; // 0/1023 to 1023/1023 - uint32_t z : 10; // 0/1023 to 1023/1023 - uint32_t w : 2; // 0/3 to 3/3 - }; - uint32_t v; - }; - - XMUDECN4() = default; - - XMUDECN4(const XMUDECN4&) = default; - XMUDECN4& operator=(const XMUDECN4&) = default; - - XMUDECN4(XMUDECN4&&) = default; - XMUDECN4& operator=(XMUDECN4&&) = default; - - explicit constexpr XMUDECN4(uint32_t Packed) noexcept : v(Packed) {} - XMUDECN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUDECN4(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMUDECN4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer -// The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, -// integer for the w component and 10 bit unsigned integers -// for the z, y, and x components. The w component is stored in the -// most significant bits and the x component in the least significant bits -// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] -struct XMUDEC4 { - union { - struct { - uint32_t x : 10; // 0 to 1023 - uint32_t y : 10; // 0 to 1023 - uint32_t z : 10; // 0 to 1023 - uint32_t w : 2; // 0 to 3 - }; - uint32_t v; - }; - - XMUDEC4() = default; - - XMUDEC4(const XMUDEC4&) = default; - XMUDEC4& operator=(const XMUDEC4&) = default; - - XMUDEC4(XMUDEC4&&) = default; - XMUDEC4& operator=(XMUDEC4&&) = default; - - explicit constexpr XMUDEC4(uint32_t Packed) noexcept : v(Packed) {} - XMUDEC4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUDEC4(_In_reads_(4) const float* pArray) noexcept; - - operator uint32_t() const noexcept { return v; } - - XMUDEC4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 4D Vector; 8 bit signed normalized integer components -struct XMBYTEN4 { - union { - struct { - int8_t x; - int8_t y; - int8_t z; - int8_t w; - }; - uint32_t v; - }; - - XMBYTEN4() = default; - - XMBYTEN4(const XMBYTEN4&) = default; - XMBYTEN4& operator=(const XMBYTEN4&) = default; - - XMBYTEN4(XMBYTEN4&&) = default; - XMBYTEN4& operator=(XMBYTEN4&&) = default; - - constexpr XMBYTEN4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit constexpr XMBYTEN4(uint32_t Packed) noexcept : v(Packed) {} - explicit XMBYTEN4(_In_reads_(4) const int8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMBYTEN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMBYTEN4(_In_reads_(4) const float* pArray) noexcept; - - XMBYTEN4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 8 bit signed integer components -struct XMBYTE4 { - union { - struct { - int8_t x; - int8_t y; - int8_t z; - int8_t w; - }; - uint32_t v; - }; - - XMBYTE4() = default; - - XMBYTE4(const XMBYTE4&) = default; - XMBYTE4& operator=(const XMBYTE4&) = default; - - XMBYTE4(XMBYTE4&&) = default; - XMBYTE4& operator=(XMBYTE4&&) = default; - - constexpr XMBYTE4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit constexpr XMBYTE4(uint32_t Packed) noexcept : v(Packed) {} - explicit XMBYTE4(_In_reads_(4) const int8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMBYTE4(float _x, float _y, float _z, float _w) noexcept; - explicit XMBYTE4(_In_reads_(4) const float* pArray) noexcept; - - XMBYTE4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 8 bit unsigned normalized integer components -struct XMUBYTEN4 { - union { - struct { - uint8_t x; - uint8_t y; - uint8_t z; - uint8_t w; - }; - uint32_t v; - }; - - XMUBYTEN4() = default; - - XMUBYTEN4(const XMUBYTEN4&) = default; - XMUBYTEN4& operator=(const XMUBYTEN4&) = default; - - XMUBYTEN4(XMUBYTEN4&&) = default; - XMUBYTEN4& operator=(XMUBYTEN4&&) = default; - - constexpr XMUBYTEN4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit constexpr XMUBYTEN4(uint32_t Packed) noexcept : v(Packed) {} - explicit XMUBYTEN4(_In_reads_(4) const uint8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMUBYTEN4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUBYTEN4(_In_reads_(4) const float* pArray) noexcept; - - XMUBYTEN4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -// 4D Vector; 8 bit unsigned integer components -struct XMUBYTE4 { - union { - struct { - uint8_t x; - uint8_t y; - uint8_t z; - uint8_t w; - }; - uint32_t v; - }; - - XMUBYTE4() = default; - - XMUBYTE4(const XMUBYTE4&) = default; - XMUBYTE4& operator=(const XMUBYTE4&) = default; - - XMUBYTE4(XMUBYTE4&&) = default; - XMUBYTE4& operator=(XMUBYTE4&&) = default; - - constexpr XMUBYTE4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit constexpr XMUBYTE4(uint32_t Packed) noexcept : v(Packed) {} - explicit XMUBYTE4(_In_reads_(4) const uint8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMUBYTE4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUBYTE4(_In_reads_(4) const float* pArray) noexcept; - - XMUBYTE4& operator=(uint32_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 4D vector; 4 bit unsigned integer components -struct XMUNIBBLE4 { - union { - struct { - uint16_t x : 4; // 0 to 15 - uint16_t y : 4; // 0 to 15 - uint16_t z : 4; // 0 to 15 - uint16_t w : 4; // 0 to 15 - }; - uint16_t v; - }; - - XMUNIBBLE4() = default; - - XMUNIBBLE4(const XMUNIBBLE4&) = default; - XMUNIBBLE4& operator=(const XMUNIBBLE4&) = default; - - XMUNIBBLE4(XMUNIBBLE4&&) = default; - XMUNIBBLE4& operator=(XMUNIBBLE4&&) = default; - - explicit constexpr XMUNIBBLE4(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMUNIBBLE4(uint8_t _x, uint8_t _y, uint8_t _z, - uint8_t _w) noexcept - : x(_x), y(_y), z(_z), w(_w) {} - explicit XMUNIBBLE4(_In_reads_(4) const uint8_t* pArray) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} - XMUNIBBLE4(float _x, float _y, float _z, float _w) noexcept; - explicit XMUNIBBLE4(_In_reads_(4) const float* pArray) noexcept; - - operator uint16_t() const noexcept { return v; } - - XMUNIBBLE4& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -//------------------------------------------------------------------------------ -// 4D vector: 5/5/5/1 unsigned integer components -struct XMU555 { - union { - struct { - uint16_t x : 5; // 0 to 31 - uint16_t y : 5; // 0 to 31 - uint16_t z : 5; // 0 to 31 - uint16_t w : 1; // 0 or 1 - }; - uint16_t v; - }; - - XMU555() = default; - - XMU555(const XMU555&) = default; - XMU555& operator=(const XMU555&) = default; - - XMU555(XMU555&&) = default; - XMU555& operator=(XMU555&&) = default; - - explicit constexpr XMU555(uint16_t Packed) noexcept : v(Packed) {} - constexpr XMU555(uint8_t _x, uint8_t _y, uint8_t _z, bool _w) noexcept - : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {} - XMU555(_In_reads_(3) const uint8_t* pArray, _In_ bool _w) noexcept - : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(_w ? 0x1 : 0) {} - XMU555(float _x, float _y, float _z, bool _w) noexcept; - XMU555(_In_reads_(3) const float* pArray, _In_ bool _w) noexcept; - - operator uint16_t() const noexcept { return v; } - - XMU555& operator=(uint16_t Packed) noexcept { - v = Packed; - return *this; - } -}; - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * Data conversion operations - * - ****************************************************************************/ - -float XMConvertHalfToFloat(HALF Value) noexcept; -float* XMConvertHalfToFloatStream( - _Out_writes_bytes_(sizeof(float) + - OutputStride * (HalfCount - 1)) float* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(HALF) + InputStride * (HalfCount - 1)) - const HALF* pInputStream, - _In_ size_t InputStride, _In_ size_t HalfCount) noexcept; -HALF XMConvertFloatToHalf(float Value) noexcept; -HALF* XMConvertFloatToHalfStream( - _Out_writes_bytes_(sizeof(HALF) + OutputStride * (FloatCount - 1)) - HALF* pOutputStream, - _In_ size_t OutputStride, - _In_reads_bytes_(sizeof(float) + InputStride * (FloatCount - 1)) - const float* pInputStream, - _In_ size_t InputStride, _In_ size_t FloatCount) noexcept; - -/**************************************************************************** - * - * Load operations - * - ****************************************************************************/ - -XMVECTOR XM_CALLCONV XMLoadColor(_In_ const XMCOLOR* pSource) noexcept; - -XMVECTOR XM_CALLCONV XMLoadHalf2(_In_ const XMHALF2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadShortN2(_In_ const XMSHORTN2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadShort2(_In_ const XMSHORT2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUShortN2(_In_ const XMUSHORTN2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUShort2(_In_ const XMUSHORT2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadByteN2(_In_ const XMBYTEN2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadByte2(_In_ const XMBYTE2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUByteN2(_In_ const XMUBYTEN2* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUByte2(_In_ const XMUBYTE2* pSource) noexcept; - -XMVECTOR XM_CALLCONV XMLoadU565(_In_ const XMU565* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat3PK(_In_ const XMFLOAT3PK* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadFloat3SE(_In_ const XMFLOAT3SE* pSource) noexcept; - -XMVECTOR XM_CALLCONV XMLoadHalf4(_In_ const XMHALF4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadShortN4(_In_ const XMSHORTN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadShort4(_In_ const XMSHORT4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUShortN4(_In_ const XMUSHORTN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUShort4(_In_ const XMUSHORT4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadXDecN4(_In_ const XMXDECN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUDecN4(_In_ const XMUDECN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(_In_ const XMUDECN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUDec4(_In_ const XMUDEC4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadByteN4(_In_ const XMBYTEN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadByte4(_In_ const XMBYTE4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUByteN4(_In_ const XMUBYTEN4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUByte4(_In_ const XMUBYTE4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadUNibble4(_In_ const XMUNIBBLE4* pSource) noexcept; -XMVECTOR XM_CALLCONV XMLoadU555(_In_ const XMU555* pSource) noexcept; - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -XM_DEPRECATED -XMVECTOR XM_CALLCONV XMLoadDecN4(_In_ const XMDECN4* pSource) noexcept; - -XM_DEPRECATED -XMVECTOR XM_CALLCONV XMLoadDec4(_In_ const XMDEC4* pSource) noexcept; - -XM_DEPRECATED -XMVECTOR XM_CALLCONV XMLoadXDec4(_In_ const XMXDEC4* pSource) noexcept; - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * Store operations - * - ****************************************************************************/ - -void XM_CALLCONV XMStoreColor(_Out_ XMCOLOR* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreHalf2(_Out_ XMHALF2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreShortN2(_Out_ XMSHORTN2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreShort2(_Out_ XMSHORT2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUShort2(_Out_ XMUSHORT2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreByteN2(_Out_ XMBYTEN2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreByte2(_Out_ XMBYTE2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUByteN2(_Out_ XMUBYTEN2* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUByte2(_Out_ XMUBYTE2* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreU565(_Out_ XMU565* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, - _In_ FXMVECTOR V) noexcept; - -void XM_CALLCONV XMStoreHalf4(_Out_ XMHALF4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreShortN4(_Out_ XMSHORTN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreShort4(_Out_ XMSHORT4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUShort4(_Out_ XMUSHORT4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreXDecN4(_Out_ XMXDECN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUDecN4(_Out_ XMUDECN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUDecN4_XR(_Out_ XMUDECN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUDec4(_Out_ XMUDEC4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreByteN4(_Out_ XMBYTEN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreByte4(_Out_ XMBYTE4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUByte4(_Out_ XMUBYTE4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, - _In_ FXMVECTOR V) noexcept; -void XM_CALLCONV XMStoreU555(_Out_ XMU555* pDestination, - _In_ FXMVECTOR V) noexcept; - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -XM_DEPRECATED -void XM_CALLCONV XMStoreDecN4(_Out_ XMDECN4* pDestination, - _In_ FXMVECTOR V) noexcept; - -XM_DEPRECATED -void XM_CALLCONV XMStoreDec4(_Out_ XMDEC4* pDestination, - _In_ FXMVECTOR V) noexcept; - -XM_DEPRECATED -void XM_CALLCONV XMStoreXDec4(_Out_ XMXDEC4* pDestination, - _In_ FXMVECTOR V) noexcept; - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * Implementation - * - ****************************************************************************/ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4068 4214 4204 4365 4616 6001 6101) -// C4068/4616: ignore unknown pragmas -// C4214/4204: nonstandard extension used -// C4365: Off by default noise -// C6001/6101: False positives -#endif - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") -#pragma prefast(disable : 26495, "Union initialization confuses /analyze") -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" -#endif - -#include "DirectXPackedVector.inl" - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif -} // namespace PackedVector - -} // namespace DirectX +//------------------------------------------------------------------------------------- +// DirectXPackedVector.h -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +#include "DirectXMath.h" + +namespace DirectX { + +namespace PackedVector { +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4201 4365 4324 4996) +// C4201: nonstandard extension used +// C4365: Off by default noise +// C4324: alignment padding warnings +// C4996: deprecation warnings +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +#pragma clang diagnostic ignored "-Wnested-anon-types" +#endif + +//------------------------------------------------------------------------------ +// ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into +// a 32 bit integer. The normalized color is packed into 32 bits using 8 bit +// unsigned, normalized integers for the alpha, red, green, and blue components. +// The alpha component is stored in the most significant bits and the blue +// component in the least significant bits (A8R8G8B8): +// [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0] +struct XMCOLOR { + union { + struct { + uint8_t b; // Blue: 0/255 to 255/255 + uint8_t g; // Green: 0/255 to 255/255 + uint8_t r; // Red: 0/255 to 255/255 + uint8_t a; // Alpha: 0/255 to 255/255 + }; + uint32_t c; + }; + + XMCOLOR() = default; + + XMCOLOR(const XMCOLOR&) = default; + XMCOLOR& operator=(const XMCOLOR&) = default; + + XMCOLOR(XMCOLOR&&) = default; + XMCOLOR& operator=(XMCOLOR&&) = default; + + constexpr XMCOLOR(uint32_t Color) noexcept : c(Color) {} + XMCOLOR(float _r, float _g, float _b, float _a) noexcept; + explicit XMCOLOR(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return c; } + + XMCOLOR& operator=(const uint32_t Color) noexcept { + c = Color; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 16 bit floating point number consisting of a sign bit, a 5 bit biased +// exponent, and a 10 bit mantissa +using HALF = uint16_t; + +//------------------------------------------------------------------------------ +// 2D Vector; 16 bit floating point components +struct XMHALF2 { + union { + struct { + HALF x; + HALF y; + }; + uint32_t v; + }; + + XMHALF2() = default; + + XMHALF2(const XMHALF2&) = default; + XMHALF2& operator=(const XMHALF2&) = default; + + XMHALF2(XMHALF2&&) = default; + XMHALF2& operator=(XMHALF2&&) = default; + + explicit constexpr XMHALF2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMHALF2(HALF _x, HALF _y) noexcept : x(_x), y(_y) {} + explicit XMHALF2(_In_reads_(2) const HALF* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMHALF2(float _x, float _y) noexcept; + explicit XMHALF2(_In_reads_(2) const float* pArray) noexcept; + + XMHALF2& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 2D Vector; 16 bit signed normalized integer components +struct XMSHORTN2 { + union { + struct { + int16_t x; + int16_t y; + }; + uint32_t v; + }; + + XMSHORTN2() = default; + + XMSHORTN2(const XMSHORTN2&) = default; + XMSHORTN2& operator=(const XMSHORTN2&) = default; + + XMSHORTN2(XMSHORTN2&&) = default; + XMSHORTN2& operator=(XMSHORTN2&&) = default; + + explicit constexpr XMSHORTN2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMSHORTN2(int16_t _x, int16_t _y) noexcept : x(_x), y(_y) {} + explicit XMSHORTN2(_In_reads_(2) const int16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMSHORTN2(float _x, float _y) noexcept; + explicit XMSHORTN2(_In_reads_(2) const float* pArray) noexcept; + + XMSHORTN2& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 2D Vector; 16 bit signed integer components +struct XMSHORT2 { + union { + struct { + int16_t x; + int16_t y; + }; + uint32_t v; + }; + + XMSHORT2() = default; + + XMSHORT2(const XMSHORT2&) = default; + XMSHORT2& operator=(const XMSHORT2&) = default; + + XMSHORT2(XMSHORT2&&) = default; + XMSHORT2& operator=(XMSHORT2&&) = default; + + explicit constexpr XMSHORT2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMSHORT2(int16_t _x, int16_t _y) noexcept : x(_x), y(_y) {} + explicit XMSHORT2(_In_reads_(2) const int16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMSHORT2(float _x, float _y) noexcept; + explicit XMSHORT2(_In_reads_(2) const float* pArray) noexcept; + + XMSHORT2& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 2D Vector; 16 bit unsigned normalized integer components +struct XMUSHORTN2 { + union { + struct { + uint16_t x; + uint16_t y; + }; + uint32_t v; + }; + + XMUSHORTN2() = default; + + XMUSHORTN2(const XMUSHORTN2&) = default; + XMUSHORTN2& operator=(const XMUSHORTN2&) = default; + + XMUSHORTN2(XMUSHORTN2&&) = default; + XMUSHORTN2& operator=(XMUSHORTN2&&) = default; + + explicit constexpr XMUSHORTN2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORTN2(uint16_t _x, uint16_t _y) noexcept : x(_x), y(_y) {} + explicit XMUSHORTN2(_In_reads_(2) const uint16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMUSHORTN2(float _x, float _y) noexcept; + explicit XMUSHORTN2(_In_reads_(2) const float* pArray) noexcept; + + XMUSHORTN2& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 2D Vector; 16 bit unsigned integer components +struct XMUSHORT2 { + union { + struct { + uint16_t x; + uint16_t y; + }; + uint32_t v; + }; + + XMUSHORT2() = default; + + XMUSHORT2(const XMUSHORT2&) = default; + XMUSHORT2& operator=(const XMUSHORT2&) = default; + + XMUSHORT2(XMUSHORT2&&) = default; + XMUSHORT2& operator=(XMUSHORT2&&) = default; + + explicit constexpr XMUSHORT2(uint32_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORT2(uint16_t _x, uint16_t _y) noexcept : x(_x), y(_y) {} + explicit XMUSHORT2(_In_reads_(2) const uint16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMUSHORT2(float _x, float _y) noexcept; + explicit XMUSHORT2(_In_reads_(2) const float* pArray) noexcept; + + XMUSHORT2& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 2D Vector; 8 bit signed normalized integer components +struct XMBYTEN2 { + union { + struct { + int8_t x; + int8_t y; + }; + uint16_t v; + }; + + XMBYTEN2() = default; + + XMBYTEN2(const XMBYTEN2&) = default; + XMBYTEN2& operator=(const XMBYTEN2&) = default; + + XMBYTEN2(XMBYTEN2&&) = default; + XMBYTEN2& operator=(XMBYTEN2&&) = default; + + explicit constexpr XMBYTEN2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMBYTEN2(int8_t _x, int8_t _y) noexcept : x(_x), y(_y) {} + explicit XMBYTEN2(_In_reads_(2) const int8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMBYTEN2(float _x, float _y) noexcept; + explicit XMBYTEN2(_In_reads_(2) const float* pArray) noexcept; + + XMBYTEN2& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 2D Vector; 8 bit signed integer components +struct XMBYTE2 { + union { + struct { + int8_t x; + int8_t y; + }; + uint16_t v; + }; + + XMBYTE2() = default; + + XMBYTE2(const XMBYTE2&) = default; + XMBYTE2& operator=(const XMBYTE2&) = default; + + XMBYTE2(XMBYTE2&&) = default; + XMBYTE2& operator=(XMBYTE2&&) = default; + + explicit constexpr XMBYTE2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMBYTE2(int8_t _x, int8_t _y) noexcept : x(_x), y(_y) {} + explicit XMBYTE2(_In_reads_(2) const int8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMBYTE2(float _x, float _y) noexcept; + explicit XMBYTE2(_In_reads_(2) const float* pArray) noexcept; + + XMBYTE2& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 2D Vector; 8 bit unsigned normalized integer components +struct XMUBYTEN2 { + union { + struct { + uint8_t x; + uint8_t y; + }; + uint16_t v; + }; + + XMUBYTEN2() = default; + + XMUBYTEN2(const XMUBYTEN2&) = default; + XMUBYTEN2& operator=(const XMUBYTEN2&) = default; + + XMUBYTEN2(XMUBYTEN2&&) = default; + XMUBYTEN2& operator=(XMUBYTEN2&&) = default; + + explicit constexpr XMUBYTEN2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMUBYTEN2(uint8_t _x, uint8_t _y) noexcept : x(_x), y(_y) {} + explicit XMUBYTEN2(_In_reads_(2) const uint8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMUBYTEN2(float _x, float _y) noexcept; + explicit XMUBYTEN2(_In_reads_(2) const float* pArray) noexcept; + + XMUBYTEN2& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 2D Vector; 8 bit unsigned integer components +struct XMUBYTE2 { + union { + struct { + uint8_t x; + uint8_t y; + }; + uint16_t v; + }; + + XMUBYTE2() = default; + + XMUBYTE2(const XMUBYTE2&) = default; + XMUBYTE2& operator=(const XMUBYTE2&) = default; + + XMUBYTE2(XMUBYTE2&&) = default; + XMUBYTE2& operator=(XMUBYTE2&&) = default; + + explicit constexpr XMUBYTE2(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMUBYTE2(uint8_t _x, uint8_t _y) noexcept : x(_x), y(_y) {} + explicit XMUBYTE2(_In_reads_(2) const uint8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]) {} + XMUBYTE2(float _x, float _y) noexcept; + explicit XMUBYTE2(_In_reads_(2) const float* pArray) noexcept; + + XMUBYTE2& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 3D vector: 5/6/5 unsigned integer components +struct XMU565 { + union { + struct { + uint16_t x : 5; // 0 to 31 + uint16_t y : 6; // 0 to 63 + uint16_t z : 5; // 0 to 31 + }; + uint16_t v; + }; + + XMU565() = default; + + XMU565(const XMU565&) = default; + XMU565& operator=(const XMU565&) = default; + + XMU565(XMU565&&) = default; + XMU565& operator=(XMU565&&) = default; + + explicit constexpr XMU565(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMU565(uint8_t _x, uint8_t _y, uint8_t _z) noexcept + : x(_x), y(_y), z(_z) {} + explicit XMU565(_In_reads_(3) const uint8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} + XMU565(float _x, float _y, float _z) noexcept; + explicit XMU565(_In_reads_(3) const float* pArray) noexcept; + + operator uint16_t() const noexcept { return v; } + + XMU565& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 3D vector: 11/11/10 floating-point components +// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent +// and 6-bit mantissa for x component, a 5-bit biased exponent and +// 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit +// mantissa for z. The z component is stored in the most significant bits +// and the x component in the least significant bits. No sign bits so +// all partial-precision numbers are positive. +// (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0] +struct XMFLOAT3PK { + union { + struct { + uint32_t xm : 6; // x-mantissa + uint32_t xe : 5; // x-exponent + uint32_t ym : 6; // y-mantissa + uint32_t ye : 5; // y-exponent + uint32_t zm : 5; // z-mantissa + uint32_t ze : 5; // z-exponent + }; + uint32_t v; + }; + + XMFLOAT3PK() = default; + + XMFLOAT3PK(const XMFLOAT3PK&) = default; + XMFLOAT3PK& operator=(const XMFLOAT3PK&) = default; + + XMFLOAT3PK(XMFLOAT3PK&&) = default; + XMFLOAT3PK& operator=(XMFLOAT3PK&&) = default; + + explicit constexpr XMFLOAT3PK(uint32_t Packed) noexcept : v(Packed) {} + XMFLOAT3PK(float _x, float _y, float _z) noexcept; + explicit XMFLOAT3PK(_In_reads_(3) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMFLOAT3PK& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 3D vector: 9/9/9 floating-point components with shared 5-bit exponent +// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent +// with 9-bit mantissa for the x, y, and z component. The shared exponent +// is stored in the most significant bits and the x component mantissa is in +// the least significant bits. No sign bits so all partial-precision numbers +// are positive. +// (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0] +struct XMFLOAT3SE { + union { + struct { + uint32_t xm : 9; // x-mantissa + uint32_t ym : 9; // y-mantissa + uint32_t zm : 9; // z-mantissa + uint32_t e : 5; // shared exponent + }; + uint32_t v; + }; + + XMFLOAT3SE() = default; + + XMFLOAT3SE(const XMFLOAT3SE&) = default; + XMFLOAT3SE& operator=(const XMFLOAT3SE&) = default; + + XMFLOAT3SE(XMFLOAT3SE&&) = default; + XMFLOAT3SE& operator=(XMFLOAT3SE&&) = default; + + explicit constexpr XMFLOAT3SE(uint32_t Packed) noexcept : v(Packed) {} + XMFLOAT3SE(float _x, float _y, float _z) noexcept; + explicit XMFLOAT3SE(_In_reads_(3) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMFLOAT3SE& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 4D Vector; 16 bit floating point components +struct XMHALF4 { + union { + struct { + HALF x; + HALF y; + HALF z; + HALF w; + }; + uint64_t v; + }; + + XMHALF4() = default; + + XMHALF4(const XMHALF4&) = default; + XMHALF4& operator=(const XMHALF4&) = default; + + XMHALF4(XMHALF4&&) = default; + XMHALF4& operator=(XMHALF4&&) = default; + + explicit constexpr XMHALF4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMHALF4(_In_reads_(4) const HALF* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMHALF4(float _x, float _y, float _z, float _w) noexcept; + explicit XMHALF4(_In_reads_(4) const float* pArray) noexcept; + + XMHALF4& operator=(uint64_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 4D Vector; 16 bit signed normalized integer components +struct XMSHORTN4 { + union { + struct { + int16_t x; + int16_t y; + int16_t z; + int16_t w; + }; + uint64_t v; + }; + + XMSHORTN4() = default; + + XMSHORTN4(const XMSHORTN4&) = default; + XMSHORTN4& operator=(const XMSHORTN4&) = default; + + XMSHORTN4(XMSHORTN4&&) = default; + XMSHORTN4& operator=(XMSHORTN4&&) = default; + + explicit constexpr XMSHORTN4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMSHORTN4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMSHORTN4(_In_reads_(4) const int16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMSHORTN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMSHORTN4(_In_reads_(4) const float* pArray) noexcept; + + XMSHORTN4& operator=(uint64_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 16 bit signed integer components +struct XMSHORT4 { + union { + struct { + int16_t x; + int16_t y; + int16_t z; + int16_t w; + }; + uint64_t v; + }; + + XMSHORT4() = default; + + XMSHORT4(const XMSHORT4&) = default; + XMSHORT4& operator=(const XMSHORT4&) = default; + + XMSHORT4(XMSHORT4&&) = default; + XMSHORT4& operator=(XMSHORT4&&) = default; + + explicit constexpr XMSHORT4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMSHORT4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMSHORT4(_In_reads_(4) const int16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMSHORT4(float _x, float _y, float _z, float _w) noexcept; + explicit XMSHORT4(_In_reads_(4) const float* pArray) noexcept; + + XMSHORT4& operator=(uint64_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 16 bit unsigned normalized integer components +struct XMUSHORTN4 { + union { + struct { + uint16_t x; + uint16_t y; + uint16_t z; + uint16_t w; + }; + uint64_t v; + }; + + XMUSHORTN4() = default; + + XMUSHORTN4(const XMUSHORTN4&) = default; + XMUSHORTN4& operator=(const XMUSHORTN4&) = default; + + XMUSHORTN4(XMUSHORTN4&&) = default; + XMUSHORTN4& operator=(XMUSHORTN4&&) = default; + + explicit constexpr XMUSHORTN4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORTN4(uint16_t _x, uint16_t _y, uint16_t _z, + uint16_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUSHORTN4(_In_reads_(4) const uint16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUSHORTN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUSHORTN4(_In_reads_(4) const float* pArray) noexcept; + + XMUSHORTN4& operator=(uint64_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 16 bit unsigned integer components +struct XMUSHORT4 { + union { + struct { + uint16_t x; + uint16_t y; + uint16_t z; + uint16_t w; + }; + uint64_t v; + }; + + XMUSHORT4() = default; + + XMUSHORT4(const XMUSHORT4&) = default; + XMUSHORT4& operator=(const XMUSHORT4&) = default; + + XMUSHORT4(XMUSHORT4&&) = default; + XMUSHORT4& operator=(XMUSHORT4&&) = default; + + explicit constexpr XMUSHORT4(uint64_t Packed) noexcept : v(Packed) {} + constexpr XMUSHORT4(uint16_t _x, uint16_t _y, uint16_t _z, + uint16_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUSHORT4(_In_reads_(4) const uint16_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUSHORT4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUSHORT4(_In_reads_(4) const float* pArray) noexcept; + + XMUSHORT4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// normalized integer for the w component and 10 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +struct XMXDECN4 { + union { + struct { + int32_t x : 10; // -511/511 to 511/511 + int32_t y : 10; // -511/511 to 511/511 + int32_t z : 10; // -511/511 to 511/511 + uint32_t w : 2; // 0/3 to 3/3 + }; + uint32_t v; + }; + + XMXDECN4() = default; + + XMXDECN4(const XMXDECN4&) = default; + XMXDECN4& operator=(const XMXDECN4&) = default; + + XMXDECN4(XMXDECN4&&) = default; + XMXDECN4& operator=(XMXDECN4&&) = default; + + explicit constexpr XMXDECN4(uint32_t Packed) : v(Packed) {} + XMXDECN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMXDECN4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMXDECN4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned +// integer for the w component and 10 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +struct XM_DEPRECATED XMXDEC4 { + union { + struct { + int32_t x : 10; // -511 to 511 + int32_t y : 10; // -511 to 511 + int32_t z : 10; // -511 to 511 + uint32_t w : 2; // 0 to 3 + }; + uint32_t v; + }; + + XMXDEC4() = default; + + XMXDEC4(const XMXDEC4&) = default; + XMXDEC4& operator=(const XMXDEC4&) = default; + + XMXDEC4(XMXDEC4&&) = default; + XMXDEC4& operator=(XMXDEC4&&) = default; + + explicit constexpr XMXDEC4(uint32_t Packed) noexcept : v(Packed) {} + XMXDEC4(float _x, float _y, float _z, float _w) noexcept; + explicit XMXDEC4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMXDEC4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed, +// normalized integer for the w component and 10 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +struct XM_DEPRECATED XMDECN4 { + union { + struct { + int32_t x : 10; // -511/511 to 511/511 + int32_t y : 10; // -511/511 to 511/511 + int32_t z : 10; // -511/511 to 511/511 + int32_t w : 2; // -1/1 to 1/1 + }; + uint32_t v; + }; + + XMDECN4() = default; + + XMDECN4(const XMDECN4&) = default; + XMDECN4& operator=(const XMDECN4&) = default; + + XMDECN4(XMDECN4&&) = default; + XMDECN4& operator=(XMDECN4&&) = default; + + explicit constexpr XMDECN4(uint32_t Packed) noexcept : v(Packed) {} + XMDECN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMDECN4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMDECN4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The 4D Vector is packed into 32 bits as follows: a 2 bit signed, +// integer for the w component and 10 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +struct XM_DEPRECATED XMDEC4 { + union { + struct { + int32_t x : 10; // -511 to 511 + int32_t y : 10; // -511 to 511 + int32_t z : 10; // -511 to 511 + int32_t w : 2; // -1 to 1 + }; + uint32_t v; + }; + + XMDEC4() = default; + + XMDEC4(const XMDEC4&) = default; + XMDEC4& operator=(const XMDEC4&) = default; + + XMDEC4(XMDEC4&&) = default; + XMDEC4& operator=(XMDEC4&&) = default; + + explicit constexpr XMDEC4(uint32_t Packed) noexcept : v(Packed) {} + XMDEC4(float _x, float _y, float _z, float _w) noexcept; + explicit XMDEC4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMDEC4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// normalized integer for the w component and 10 bit unsigned, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +struct XMUDECN4 { + union { + struct { + uint32_t x : 10; // 0/1023 to 1023/1023 + uint32_t y : 10; // 0/1023 to 1023/1023 + uint32_t z : 10; // 0/1023 to 1023/1023 + uint32_t w : 2; // 0/3 to 3/3 + }; + uint32_t v; + }; + + XMUDECN4() = default; + + XMUDECN4(const XMUDECN4&) = default; + XMUDECN4& operator=(const XMUDECN4&) = default; + + XMUDECN4(XMUDECN4&&) = default; + XMUDECN4& operator=(XMUDECN4&&) = default; + + explicit constexpr XMUDECN4(uint32_t Packed) noexcept : v(Packed) {} + XMUDECN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUDECN4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMUDECN4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// integer for the w component and 10 bit unsigned integers +// for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +struct XMUDEC4 { + union { + struct { + uint32_t x : 10; // 0 to 1023 + uint32_t y : 10; // 0 to 1023 + uint32_t z : 10; // 0 to 1023 + uint32_t w : 2; // 0 to 3 + }; + uint32_t v; + }; + + XMUDEC4() = default; + + XMUDEC4(const XMUDEC4&) = default; + XMUDEC4& operator=(const XMUDEC4&) = default; + + XMUDEC4(XMUDEC4&&) = default; + XMUDEC4& operator=(XMUDEC4&&) = default; + + explicit constexpr XMUDEC4(uint32_t Packed) noexcept : v(Packed) {} + XMUDEC4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUDEC4(_In_reads_(4) const float* pArray) noexcept; + + operator uint32_t() const noexcept { return v; } + + XMUDEC4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 4D Vector; 8 bit signed normalized integer components +struct XMBYTEN4 { + union { + struct { + int8_t x; + int8_t y; + int8_t z; + int8_t w; + }; + uint32_t v; + }; + + XMBYTEN4() = default; + + XMBYTEN4(const XMBYTEN4&) = default; + XMBYTEN4& operator=(const XMBYTEN4&) = default; + + XMBYTEN4(XMBYTEN4&&) = default; + XMBYTEN4& operator=(XMBYTEN4&&) = default; + + constexpr XMBYTEN4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMBYTEN4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMBYTEN4(_In_reads_(4) const int8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMBYTEN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMBYTEN4(_In_reads_(4) const float* pArray) noexcept; + + XMBYTEN4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 8 bit signed integer components +struct XMBYTE4 { + union { + struct { + int8_t x; + int8_t y; + int8_t z; + int8_t w; + }; + uint32_t v; + }; + + XMBYTE4() = default; + + XMBYTE4(const XMBYTE4&) = default; + XMBYTE4& operator=(const XMBYTE4&) = default; + + XMBYTE4(XMBYTE4&&) = default; + XMBYTE4& operator=(XMBYTE4&&) = default; + + constexpr XMBYTE4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMBYTE4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMBYTE4(_In_reads_(4) const int8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMBYTE4(float _x, float _y, float _z, float _w) noexcept; + explicit XMBYTE4(_In_reads_(4) const float* pArray) noexcept; + + XMBYTE4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 8 bit unsigned normalized integer components +struct XMUBYTEN4 { + union { + struct { + uint8_t x; + uint8_t y; + uint8_t z; + uint8_t w; + }; + uint32_t v; + }; + + XMUBYTEN4() = default; + + XMUBYTEN4(const XMUBYTEN4&) = default; + XMUBYTEN4& operator=(const XMUBYTEN4&) = default; + + XMUBYTEN4(XMUBYTEN4&&) = default; + XMUBYTEN4& operator=(XMUBYTEN4&&) = default; + + constexpr XMUBYTEN4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMUBYTEN4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMUBYTEN4(_In_reads_(4) const uint8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUBYTEN4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUBYTEN4(_In_reads_(4) const float* pArray) noexcept; + + XMUBYTEN4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +// 4D Vector; 8 bit unsigned integer components +struct XMUBYTE4 { + union { + struct { + uint8_t x; + uint8_t y; + uint8_t z; + uint8_t w; + }; + uint32_t v; + }; + + XMUBYTE4() = default; + + XMUBYTE4(const XMUBYTE4&) = default; + XMUBYTE4& operator=(const XMUBYTE4&) = default; + + XMUBYTE4(XMUBYTE4&&) = default; + XMUBYTE4& operator=(XMUBYTE4&&) = default; + + constexpr XMUBYTE4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit constexpr XMUBYTE4(uint32_t Packed) noexcept : v(Packed) {} + explicit XMUBYTE4(_In_reads_(4) const uint8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUBYTE4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUBYTE4(_In_reads_(4) const float* pArray) noexcept; + + XMUBYTE4& operator=(uint32_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 4D vector; 4 bit unsigned integer components +struct XMUNIBBLE4 { + union { + struct { + uint16_t x : 4; // 0 to 15 + uint16_t y : 4; // 0 to 15 + uint16_t z : 4; // 0 to 15 + uint16_t w : 4; // 0 to 15 + }; + uint16_t v; + }; + + XMUNIBBLE4() = default; + + XMUNIBBLE4(const XMUNIBBLE4&) = default; + XMUNIBBLE4& operator=(const XMUNIBBLE4&) = default; + + XMUNIBBLE4(XMUNIBBLE4&&) = default; + XMUNIBBLE4& operator=(XMUNIBBLE4&&) = default; + + explicit constexpr XMUNIBBLE4(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMUNIBBLE4(uint8_t _x, uint8_t _y, uint8_t _z, + uint8_t _w) noexcept + : x(_x), y(_y), z(_z), w(_w) {} + explicit XMUNIBBLE4(_In_reads_(4) const uint8_t* pArray) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {} + XMUNIBBLE4(float _x, float _y, float _z, float _w) noexcept; + explicit XMUNIBBLE4(_In_reads_(4) const float* pArray) noexcept; + + operator uint16_t() const noexcept { return v; } + + XMUNIBBLE4& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +//------------------------------------------------------------------------------ +// 4D vector: 5/5/5/1 unsigned integer components +struct XMU555 { + union { + struct { + uint16_t x : 5; // 0 to 31 + uint16_t y : 5; // 0 to 31 + uint16_t z : 5; // 0 to 31 + uint16_t w : 1; // 0 or 1 + }; + uint16_t v; + }; + + XMU555() = default; + + XMU555(const XMU555&) = default; + XMU555& operator=(const XMU555&) = default; + + XMU555(XMU555&&) = default; + XMU555& operator=(XMU555&&) = default; + + explicit constexpr XMU555(uint16_t Packed) noexcept : v(Packed) {} + constexpr XMU555(uint8_t _x, uint8_t _y, uint8_t _z, bool _w) noexcept + : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {} + XMU555(_In_reads_(3) const uint8_t* pArray, _In_ bool _w) noexcept + : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(_w ? 0x1 : 0) {} + XMU555(float _x, float _y, float _z, bool _w) noexcept; + XMU555(_In_reads_(3) const float* pArray, _In_ bool _w) noexcept; + + operator uint16_t() const noexcept { return v; } + + XMU555& operator=(uint16_t Packed) noexcept { + v = Packed; + return *this; + } +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Data conversion operations + * + ****************************************************************************/ + +float XMConvertHalfToFloat(HALF Value) noexcept; +float* XMConvertHalfToFloatStream( + _Out_writes_bytes_(sizeof(float) + + OutputStride * (HalfCount - 1)) float* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(HALF) + InputStride * (HalfCount - 1)) + const HALF* pInputStream, + _In_ size_t InputStride, _In_ size_t HalfCount) noexcept; +HALF XMConvertFloatToHalf(float Value) noexcept; +HALF* XMConvertFloatToHalfStream( + _Out_writes_bytes_(sizeof(HALF) + OutputStride * (FloatCount - 1)) + HALF* pOutputStream, + _In_ size_t OutputStride, + _In_reads_bytes_(sizeof(float) + InputStride * (FloatCount - 1)) + const float* pInputStream, + _In_ size_t InputStride, _In_ size_t FloatCount) noexcept; + +/**************************************************************************** + * + * Load operations + * + ****************************************************************************/ + +XMVECTOR XM_CALLCONV XMLoadColor(_In_ const XMCOLOR* pSource) noexcept; + +XMVECTOR XM_CALLCONV XMLoadHalf2(_In_ const XMHALF2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadShortN2(_In_ const XMSHORTN2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadShort2(_In_ const XMSHORT2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUShortN2(_In_ const XMUSHORTN2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUShort2(_In_ const XMUSHORT2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadByteN2(_In_ const XMBYTEN2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadByte2(_In_ const XMBYTE2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUByteN2(_In_ const XMUBYTEN2* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUByte2(_In_ const XMUBYTE2* pSource) noexcept; + +XMVECTOR XM_CALLCONV XMLoadU565(_In_ const XMU565* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat3PK(_In_ const XMFLOAT3PK* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadFloat3SE(_In_ const XMFLOAT3SE* pSource) noexcept; + +XMVECTOR XM_CALLCONV XMLoadHalf4(_In_ const XMHALF4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadShortN4(_In_ const XMSHORTN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadShort4(_In_ const XMSHORT4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUShortN4(_In_ const XMUSHORTN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUShort4(_In_ const XMUSHORT4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadXDecN4(_In_ const XMXDECN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUDecN4(_In_ const XMUDECN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(_In_ const XMUDECN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUDec4(_In_ const XMUDEC4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadByteN4(_In_ const XMBYTEN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadByte4(_In_ const XMBYTE4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUByteN4(_In_ const XMUBYTEN4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUByte4(_In_ const XMUBYTE4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadUNibble4(_In_ const XMUNIBBLE4* pSource) noexcept; +XMVECTOR XM_CALLCONV XMLoadU555(_In_ const XMU555* pSource) noexcept; + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +XM_DEPRECATED +XMVECTOR XM_CALLCONV XMLoadDecN4(_In_ const XMDECN4* pSource) noexcept; + +XM_DEPRECATED +XMVECTOR XM_CALLCONV XMLoadDec4(_In_ const XMDEC4* pSource) noexcept; + +XM_DEPRECATED +XMVECTOR XM_CALLCONV XMLoadXDec4(_In_ const XMXDEC4* pSource) noexcept; + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Store operations + * + ****************************************************************************/ + +void XM_CALLCONV XMStoreColor(_Out_ XMCOLOR* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreHalf2(_Out_ XMHALF2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreShortN2(_Out_ XMSHORTN2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreShort2(_Out_ XMSHORT2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUShort2(_Out_ XMUSHORT2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreByteN2(_Out_ XMBYTEN2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreByte2(_Out_ XMBYTE2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUByteN2(_Out_ XMUBYTEN2* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUByte2(_Out_ XMUBYTE2* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreU565(_Out_ XMU565* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, + _In_ FXMVECTOR V) noexcept; + +void XM_CALLCONV XMStoreHalf4(_Out_ XMHALF4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreShortN4(_Out_ XMSHORTN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreShort4(_Out_ XMSHORT4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUShort4(_Out_ XMUSHORT4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreXDecN4(_Out_ XMXDECN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUDecN4(_Out_ XMUDECN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUDecN4_XR(_Out_ XMUDECN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUDec4(_Out_ XMUDEC4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreByteN4(_Out_ XMBYTEN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreByte4(_Out_ XMBYTE4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUByte4(_Out_ XMUBYTE4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, + _In_ FXMVECTOR V) noexcept; +void XM_CALLCONV XMStoreU555(_Out_ XMU555* pDestination, + _In_ FXMVECTOR V) noexcept; + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +XM_DEPRECATED +void XM_CALLCONV XMStoreDecN4(_Out_ XMDECN4* pDestination, + _In_ FXMVECTOR V) noexcept; + +XM_DEPRECATED +void XM_CALLCONV XMStoreDec4(_Out_ XMDEC4* pDestination, + _In_ FXMVECTOR V) noexcept; + +XM_DEPRECATED +void XM_CALLCONV XMStoreXDec4(_Out_ XMXDEC4* pDestination, + _In_ FXMVECTOR V) noexcept; + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * Implementation + * + ****************************************************************************/ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4068 4214 4204 4365 4616 6001 6101) +// C4068/4616: ignore unknown pragmas +// C4214/4204: nonstandard extension used +// C4365: Off by default noise +// C6001/6101: False positives +#endif + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") +#pragma prefast(disable : 26495, "Union initialization confuses /analyze") +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" +#endif + +#include "DirectXPackedVector.inl" + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif +} // namespace PackedVector + +} // namespace DirectX diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXPackedVector.inl b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXPackedVector.inl similarity index 97% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXPackedVector.inl rename to Minecraft.Client/Linux/Stubs/DirectXMath/DirectXPackedVector.inl index 59386d1fa..ccb07dd6c 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/DirectXPackedVector.inl +++ b/Minecraft.Client/Linux/Stubs/DirectXMath/DirectXPackedVector.inl @@ -1,4503 +1,4503 @@ -//------------------------------------------------------------------------------------- -// DirectXPackedVector.inl -- SIMD C++ Math library -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// -// http://go.microsoft.com/fwlink/?LinkID=615560 -//------------------------------------------------------------------------------------- - -#pragma once - -/**************************************************************************** - * - * Data conversion - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline float XMConvertHalfToFloat(HALF Value) noexcept -{ -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - __m128i V1 = _mm_cvtsi32_si128(static_cast(Value)); - __m128 V2 = _mm_cvtph_ps(V1); - return _mm_cvtss_f32(V2); -#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) - uint16x4_t vHalf = vdup_n_u16(Value); - float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); - return vgetq_lane_f32(vFloat, 0); -#else - auto Mantissa = static_cast(Value & 0x03FF); - - uint32_t Exponent = (Value & 0x7C00); - if (Exponent == 0x7C00) // INF/NAN - { - Exponent = 0x8f; - } - else if (Exponent != 0) // The value is normalized - { - Exponent = static_cast((static_cast(Value) >> 10) & 0x1F); - } - else if (Mantissa != 0) // The value is denormalized - { - // Normalize the value in the resulting float - Exponent = 1; - - do - { - Exponent--; - Mantissa <<= 1; - } - while ((Mantissa & 0x0400) == 0); - - Mantissa &= 0x03FF; - } - else // The value is zero - { - Exponent = static_cast(-112); - } - - uint32_t Result = - ((static_cast(Value) & 0x8000) << 16) // Sign - | ((Exponent + 112) << 23) // Exponent - | (Mantissa << 13); // Mantissa - - return reinterpret_cast(&Result)[0]; -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) -#endif - -_Use_decl_annotations_ -inline float* XMConvertHalfToFloatStream -( - float* pOutputStream, - size_t OutputStride, - const HALF* pInputStream, - size_t InputStride, - size_t HalfCount -) noexcept -{ - assert(pOutputStream); - assert(pInputStream); - - assert(InputStride >= sizeof(HALF)); - _Analysis_assume_(InputStride >= sizeof(HALF)); - - assert(OutputStride >= sizeof(float)); - _Analysis_assume_(OutputStride >= sizeof(float)); - -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - auto pHalf = reinterpret_cast(pInputStream); - auto pFloat = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = HalfCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(HALF)) - { - if (OutputStride == sizeof(float)) - { - if ((reinterpret_cast(pFloat) & 0xF) == 0) - { - // Packed input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); - pHalf += InputStride * 4; - - __m128 FV = _mm_cvtph_ps(HV); - - XM_STREAM_PS(reinterpret_cast(pFloat), FV); - pFloat += OutputStride * 4; - i += 4; - } - } - else - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); - pHalf += InputStride * 4; - - __m128 FV = _mm_cvtph_ps(HV); - - _mm_storeu_ps(reinterpret_cast(pFloat), FV); - pFloat += OutputStride * 4; - i += 4; - } - } - } - else - { - // Packed input, scattered output - for (size_t j = 0; j < four; ++j) - { - __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); - pHalf += InputStride * 4; - - __m128 FV = _mm_cvtph_ps(HV); - - _mm_store_ss(reinterpret_cast(pFloat), FV); - pFloat += OutputStride; - *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 1); - pFloat += OutputStride; - *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 2); - pFloat += OutputStride; - *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 3); - pFloat += OutputStride; - i += 4; - } - } - } - else if (OutputStride == sizeof(float)) - { - if ((reinterpret_cast(pFloat) & 0xF) == 0) - { - // Scattered input, aligned & packed output - for (size_t j = 0; j < four; ++j) - { - uint16_t H1 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H2 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H3 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H4 = *reinterpret_cast(pHalf); - pHalf += InputStride; - - __m128i HV = _mm_setzero_si128(); - HV = _mm_insert_epi16(HV, H1, 0); - HV = _mm_insert_epi16(HV, H2, 1); - HV = _mm_insert_epi16(HV, H3, 2); - HV = _mm_insert_epi16(HV, H4, 3); - __m128 FV = _mm_cvtph_ps(HV); - - XM_STREAM_PS(reinterpret_cast(pFloat), FV); - pFloat += OutputStride * 4; - i += 4; - } - } - else - { - // Scattered input, packed output - for (size_t j = 0; j < four; ++j) - { - uint16_t H1 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H2 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H3 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H4 = *reinterpret_cast(pHalf); - pHalf += InputStride; - - __m128i HV = _mm_setzero_si128(); - HV = _mm_insert_epi16(HV, H1, 0); - HV = _mm_insert_epi16(HV, H2, 1); - HV = _mm_insert_epi16(HV, H3, 2); - HV = _mm_insert_epi16(HV, H4, 3); - __m128 FV = _mm_cvtph_ps(HV); - - _mm_storeu_ps(reinterpret_cast(pFloat), FV); - pFloat += OutputStride * 4; - i += 4; - } - } - } - else - { - // Scattered input, scattered output - for (size_t j = 0; j < four; ++j) - { - uint16_t H1 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H2 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H3 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H4 = *reinterpret_cast(pHalf); - pHalf += InputStride; - - __m128i HV = _mm_setzero_si128(); - HV = _mm_insert_epi16(HV, H1, 0); - HV = _mm_insert_epi16(HV, H2, 1); - HV = _mm_insert_epi16(HV, H3, 2); - HV = _mm_insert_epi16(HV, H4, 3); - __m128 FV = _mm_cvtph_ps(HV); - - _mm_store_ss(reinterpret_cast(pFloat), FV); - pFloat += OutputStride; - *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 1); - pFloat += OutputStride; - *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 2); - pFloat += OutputStride; - *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 3); - pFloat += OutputStride; - i += 4; - } - } - } - - for (; i < HalfCount; ++i) - { - *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); - pHalf += InputStride; - pFloat += OutputStride; - } - - XM_SFENCE(); - - return pOutputStream; -#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) ||__aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) - auto pHalf = reinterpret_cast(pInputStream); - auto pFloat = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = HalfCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(HALF)) - { - if (OutputStride == sizeof(float)) - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - uint16x4_t vHalf = vld1_u16(reinterpret_cast(pHalf)); - pHalf += InputStride * 4; - - float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); - - vst1q_f32(reinterpret_cast(pFloat), vFloat); - pFloat += OutputStride * 4; - i += 4; - } - } - else - { - // Packed input, scattered output - for (size_t j = 0; j < four; ++j) - { - uint16x4_t vHalf = vld1_u16(reinterpret_cast(pHalf)); - pHalf += InputStride * 4; - - float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); - - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); - pFloat += OutputStride; - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); - pFloat += OutputStride; - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); - pFloat += OutputStride; - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); - pFloat += OutputStride; - i += 4; - } - } - } - else if (OutputStride == sizeof(float)) - { - // Scattered input, packed output - for (size_t j = 0; j < four; ++j) - { - uint16_t H1 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H2 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H3 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H4 = *reinterpret_cast(pHalf); - pHalf += InputStride; - - uint64_t iHalf = uint64_t(H1) | (uint64_t(H2) << 16) | (uint64_t(H3) << 32) | (uint64_t(H4) << 48); - uint16x4_t vHalf = vcreate_u16(iHalf); - - float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); - - vst1q_f32(reinterpret_cast(pFloat), vFloat); - pFloat += OutputStride * 4; - i += 4; - } - } - else - { - // Scattered input, scattered output - for (size_t j = 0; j < four; ++j) - { - uint16_t H1 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H2 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H3 = *reinterpret_cast(pHalf); - pHalf += InputStride; - uint16_t H4 = *reinterpret_cast(pHalf); - pHalf += InputStride; - - uint64_t iHalf = uint64_t(H1) | (uint64_t(H2) << 16) | (uint64_t(H3) << 32) | (uint64_t(H4) << 48); - uint16x4_t vHalf = vcreate_u16(iHalf); - - float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); - - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); - pFloat += OutputStride; - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); - pFloat += OutputStride; - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); - pFloat += OutputStride; - vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); - pFloat += OutputStride; - i += 4; - } - } - } - - for (; i < HalfCount; ++i) - { - *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); - pHalf += InputStride; - pFloat += OutputStride; - } - - return pOutputStream; -#else - auto pHalf = reinterpret_cast(pInputStream); - auto pFloat = reinterpret_cast(pOutputStream); - - for (size_t i = 0; i < HalfCount; i++) - { - *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); - pHalf += InputStride; - pFloat += OutputStride; - } - - return pOutputStream; -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ - -inline HALF XMConvertFloatToHalf(float Value) noexcept -{ -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - __m128 V1 = _mm_set_ss(Value); - __m128i V2 = _mm_cvtps_ph(V1, _MM_FROUND_TO_NEAREST_INT); - return static_cast(_mm_extract_epi16(V2, 0)); -#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) - float32x4_t vFloat = vdupq_n_f32(Value); - float16x4_t vHalf = vcvt_f16_f32(vFloat); - return vget_lane_u16(vreinterpret_u16_f16(vHalf), 0); -#else - uint32_t Result; - - auto IValue = reinterpret_cast(&Value)[0]; - uint32_t Sign = (IValue & 0x80000000U) >> 16U; - IValue = IValue & 0x7FFFFFFFU; // Hack off the sign - if (IValue >= 0x47800000 /*e+16*/) - { - // The number is too large to be represented as a half. Return infinity or NaN - Result = 0x7C00U | ((IValue > 0x7F800000) ? (0x200 | ((IValue >> 13U) & 0x3FFU)) : 0U); - } - else if (IValue <= 0x33000000U /*e-25*/) - { - Result = 0; - } - else if (IValue < 0x38800000U /*e-14*/) - { - // The number is too small to be represented as a normalized half. - // Convert it to a denormalized value. - uint32_t Shift = 125U - (IValue >> 23U); - IValue = 0x800000U | (IValue & 0x7FFFFFU); - Result = IValue >> (Shift + 1); - uint32_t s = (IValue & ((1U << Shift) - 1)) != 0; - Result += (Result | s) & ((IValue >> Shift) & 1U); - } - else - { - // Rebias the exponent to represent the value as a normalized half. - IValue += 0xC8000000U; - Result = ((IValue + 0x0FFFU + ((IValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; - } - return static_cast(Result | Sign); -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline HALF* XMConvertFloatToHalfStream -( - HALF* pOutputStream, - size_t OutputStride, - const float* pInputStream, - size_t InputStride, - size_t FloatCount -) noexcept -{ - assert(pOutputStream); - assert(pInputStream); - - assert(InputStride >= sizeof(float)); - _Analysis_assume_(InputStride >= sizeof(float)); - - assert(OutputStride >= sizeof(HALF)); - _Analysis_assume_(OutputStride >= sizeof(HALF)); - -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - auto pFloat = reinterpret_cast(pInputStream); - auto pHalf = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = FloatCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(float)) - { - if (OutputStride == sizeof(HALF)) - { - if ((reinterpret_cast(pFloat) & 0xF) == 0) - { - // Aligned and packed input, packed output - for (size_t j = 0; j < four; ++j) - { - __m128 FV = _mm_load_ps(reinterpret_cast(pFloat)); - pFloat += InputStride * 4; - - __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); - - _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); - pHalf += OutputStride * 4; - i += 4; - } - } - else - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - __m128 FV = _mm_loadu_ps(reinterpret_cast(pFloat)); - pFloat += InputStride * 4; - - __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); - - _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); - pHalf += OutputStride * 4; - i += 4; - } - } - } - else - { - if ((reinterpret_cast(pFloat) & 0xF) == 0) - { - // Aligned & packed input, scattered output - for (size_t j = 0; j < four; ++j) - { - __m128 FV = _mm_load_ps(reinterpret_cast(pFloat)); - pFloat += InputStride * 4; - - __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); - - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); - pHalf += OutputStride; - i += 4; - } - } - else - { - // Packed input, scattered output - for (size_t j = 0; j < four; ++j) - { - __m128 FV = _mm_loadu_ps(reinterpret_cast(pFloat)); - pFloat += InputStride * 4; - - __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); - - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); - pHalf += OutputStride; - i += 4; - } - } - } - } - else if (OutputStride == sizeof(HALF)) - { - // Scattered input, packed output - for (size_t j = 0; j < four; ++j) - { - __m128 FV1 = _mm_load_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV2 = _mm_broadcast_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV3 = _mm_broadcast_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV4 = _mm_broadcast_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV = _mm_blend_ps(FV1, FV2, 0x2); - __m128 FT = _mm_blend_ps(FV3, FV4, 0x8); - FV = _mm_blend_ps(FV, FT, 0xC); - - __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); - - _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); - pHalf += OutputStride * 4; - i += 4; - } - } - else - { - // Scattered input, scattered output - for (size_t j = 0; j < four; ++j) - { - __m128 FV1 = _mm_load_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV2 = _mm_broadcast_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV3 = _mm_broadcast_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV4 = _mm_broadcast_ss(reinterpret_cast(pFloat)); - pFloat += InputStride; - - __m128 FV = _mm_blend_ps(FV1, FV2, 0x2); - __m128 FT = _mm_blend_ps(FV3, FV4, 0x8); - FV = _mm_blend_ps(FV, FT, 0xC); - - __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); - - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); - pHalf += OutputStride; - *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); - pHalf += OutputStride; - i += 4; - } - } - } - - for (; i < FloatCount; ++i) - { - *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); - pFloat += InputStride; - pHalf += OutputStride; - } - - return pOutputStream; -#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) - auto pFloat = reinterpret_cast(pInputStream); - auto pHalf = reinterpret_cast(pOutputStream); - - size_t i = 0; - size_t four = FloatCount >> 2; - if (four > 0) - { - if (InputStride == sizeof(float)) - { - if (OutputStride == sizeof(HALF)) - { - // Packed input, packed output - for (size_t j = 0; j < four; ++j) - { - float32x4_t vFloat = vld1q_f32(reinterpret_cast(pFloat)); - pFloat += InputStride * 4; - - uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); - - vst1_u16(reinterpret_cast(pHalf), vHalf); - pHalf += OutputStride * 4; - i += 4; - } - } - else - { - // Packed input, scattered output - for (size_t j = 0; j < four; ++j) - { - float32x4_t vFloat = vld1q_f32(reinterpret_cast(pFloat)); - pFloat += InputStride * 4; - - uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); - - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 0); - pHalf += OutputStride; - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 1); - pHalf += OutputStride; - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 2); - pHalf += OutputStride; - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 3); - pHalf += OutputStride; - i += 4; - } - } - } - else if (OutputStride == sizeof(HALF)) - { - // Scattered input, packed output - for (size_t j = 0; j < four; ++j) - { - float32x4_t vFloat = vdupq_n_f32(0); - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); - pFloat += InputStride; - - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); - pFloat += InputStride; - - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); - pFloat += InputStride; - - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); - pFloat += InputStride; - - uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); - - vst1_u16(reinterpret_cast(pHalf), vHalf); - pHalf += OutputStride * 4; - i += 4; - } - } - else - { - // Scattered input, scattered output - for (size_t j = 0; j < four; ++j) - { - float32x4_t vFloat = vdupq_n_f32(0); - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); - pFloat += InputStride; - - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); - pFloat += InputStride; - - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); - pFloat += InputStride; - - vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); - pFloat += InputStride; - - uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); - - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 0); - pHalf += OutputStride; - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 1); - pHalf += OutputStride; - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 2); - pHalf += OutputStride; - vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 3); - pHalf += OutputStride; - i += 4; - } - } - } - - for (; i < FloatCount; ++i) - { - *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); - pFloat += InputStride; - pHalf += OutputStride; - } - - return pOutputStream; -#else - auto pFloat = reinterpret_cast(pInputStream); - auto pHalf = reinterpret_cast(pOutputStream); - - for (size_t i = 0; i < FloatCount; i++) - { - *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); - pFloat += InputStride; - pHalf += OutputStride; - } - return pOutputStream; -#endif // !_XM_F16C_INTRINSICS_ -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -/**************************************************************************** - * - * Vector and matrix load operations - * - ****************************************************************************/ - -#ifdef _PREFAST_ -#pragma prefast(push) -#pragma prefast(disable:28931, "PREfast noise: Esp:1266") -#endif - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadColor(const XMCOLOR* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - // int32_t -> Float conversions are done in one instruction. - // uint32_t -> Float calls a runtime function. Keep in int32_t - auto iColor = static_cast(pSource->c); - XMVECTORF32 vColor = { { { - static_cast((iColor >> 16) & 0xFF)* (1.0f / 255.0f), - static_cast((iColor >> 8) & 0xFF)* (1.0f / 255.0f), - static_cast(iColor & 0xFF)* (1.0f / 255.0f), - static_cast((iColor >> 24) & 0xFF)* (1.0f / 255.0f) - } } }; - return vColor.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32_t bgra = pSource->c; - uint32_t rgba = (bgra & 0xFF00FF00) | ((bgra >> 16) & 0xFF) | ((bgra << 16) & 0xFF0000); - uint32x2_t vInt8 = vdup_n_u32(rgba); - uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); - uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_n_f32(R, 1.0f / 255.0f); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the color in all four entries - __m128i vInt = _mm_set1_epi32(static_cast(pSource->c)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vInt = _mm_and_si128(vInt, g_XMMaskA8R8G8B8); - // a is unsigned! Flip the bit to convert the order to signed - vInt = _mm_xor_si128(vInt, g_XMFlipA8R8G8B8); - // Convert to floating point numbers - XMVECTOR vTemp = _mm_cvtepi32_ps(vInt); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMFixAA8R8G8B8); - // Convert 0-255 to 0.0f-1.0f - return _mm_mul_ps(vTemp, g_XMNormalizeA8R8G8B8); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadHalf2(const XMHALF2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - __m128 V = _mm_load_ss(reinterpret_cast(pSource)); - return _mm_cvtph_ps(_mm_castps_si128(V)); -#else - XMVECTORF32 vResult = { { { - XMConvertHalfToFloat(pSource->x), - XMConvertHalfToFloat(pSource->y), - 0.0f, - 0.0f - } } }; - return vResult.v; -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadShortN2(const XMSHORTN2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - (pSource->x == -32768) ? -1.f : (static_cast(pSource->x)* (1.0f / 32767.0f)), - (pSource->y == -32768) ? -1.f : (static_cast(pSource->y)* (1.0f / 32767.0f)), - 0.0f, - 0.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); - int32x4_t vInt = vmovl_s16(vreinterpret_s16_u32(vInt16)); - vInt = vandq_s32(vInt, g_XMMaskXY); - float32x4_t R = vcvtq_f32_s32(vInt); - R = vmulq_n_f32(R, 1.0f / 32767.0f); - return vmaxq_f32(R, vdupq_n_f32(-1.f)); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the two shorts in all four entries (WORD alignment okay, - // DWORD alignment preferred) - __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); - // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 - vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); - // x needs to be sign extended - vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x - 0x8000 to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16); - // Convert -1.0f - 1.0f - vTemp = _mm_mul_ps(vTemp, g_XMNormalizeX16Y16); - // Clamp result (for case of -32768) - return _mm_max_ps(vTemp, g_XMNegativeOne); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadShort2(const XMSHORT2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - 0.f, - 0.f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); - int32x4_t vInt = vmovl_s16(vreinterpret_s16_u32(vInt16)); - vInt = vandq_s32(vInt, g_XMMaskXY); - return vcvtq_f32_s32(vInt); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the two shorts in all four entries (WORD alignment okay, - // DWORD alignment preferred) - __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); - // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 - vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); - // x needs to be sign extended - vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x - 0x8000 to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16); - // Y is 65536 too large - return _mm_mul_ps(vTemp, g_XMFixupY16); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUShortN2(const XMUSHORTN2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x) / 65535.0f, - static_cast(pSource->y) / 65535.0f, - 0.f, - 0.f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); - uint32x4_t vInt = vmovl_u16(vreinterpret_u16_u32(vInt16)); - vInt = vandq_u32(vInt, g_XMMaskXY); - float32x4_t R = vcvtq_f32_u32(vInt); - R = vmulq_n_f32(R, 1.0f / 65535.0f); - return vmaxq_f32(R, vdupq_n_f32(-1.f)); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 FixupY16 = { { { 1.0f / 65535.0f, 1.0f / (65535.0f * 65536.0f), 0.0f, 0.0f } } }; - static const XMVECTORF32 FixaddY16 = { { { 0, 32768.0f * 65536.0f, 0, 0 } } }; - // Splat the two shorts in all four entries (WORD alignment okay, - // DWORD alignment preferred) - __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); - // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 - vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); - // y needs to be sign flipped - vTemp = _mm_xor_ps(vTemp, g_XMFlipY); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // y + 0x8000 to undo the signed order. - vTemp = _mm_add_ps(vTemp, FixaddY16); - // Y is 65536 times too large - vTemp = _mm_mul_ps(vTemp, FixupY16); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUShort2(const XMUSHORT2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - 0.f, - 0.f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); - uint32x4_t vInt = vmovl_u16(vreinterpret_u16_u32(vInt16)); - vInt = vandq_u32(vInt, g_XMMaskXY); - return vcvtq_f32_u32(vInt); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 FixaddY16 = { { { 0, 32768.0f, 0, 0 } } }; - // Splat the two shorts in all four entries (WORD alignment okay, - // DWORD alignment preferred) - __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); - // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 - vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); - // y needs to be sign flipped - vTemp = _mm_xor_ps(vTemp, g_XMFlipY); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // Y is 65536 times too large - vTemp = _mm_mul_ps(vTemp, g_XMFixupY16); - // y + 0x8000 to undo the signed order. - vTemp = _mm_add_ps(vTemp, FixaddY16); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadByteN2(const XMBYTEN2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - (pSource->x == -128) ? -1.f : (static_cast(pSource->x)* (1.0f / 127.0f)), - (pSource->y == -128) ? -1.f : (static_cast(pSource->y)* (1.0f / 127.0f)), - 0.0f, - 0.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); - int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u16(vInt8)); - int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); - vInt = vandq_s32(vInt, g_XMMaskXY); - float32x4_t R = vcvtq_f32_s32(vInt); - R = vmulq_n_f32(R, 1.0f / 127.0f); - return vmaxq_f32(R, vdupq_n_f32(-1.f)); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f / 127.0f, 1.0f / (127.0f * 256.0f), 0, 0 } } }; - static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; - // Splat the color in all four entries (x,z,y,w) - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask - vTemp = _mm_and_ps(vTemp, Mask); - // x,y and z are unsigned! Flip the bits to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x, y and z - 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddByte4); - // Fix y, z and w because they are too large - vTemp = _mm_mul_ps(vTemp, Scale); - // Clamp result (for case of -128) - return _mm_max_ps(vTemp, g_XMNegativeOne); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadByte2(const XMBYTE2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - 0.0f, - 0.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); - int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u16(vInt8)); - int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); - vInt = vandq_s32(vInt, g_XMMaskXY); - return vcvtq_f32_s32(vInt); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; - static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; - // Splat the color in all four entries (x,z,y,w) - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask - vTemp = _mm_and_ps(vTemp, Mask); - // x,y and z are unsigned! Flip the bits to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x, y and z - 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddByte4); - // Fix y, z and w because they are too large - return _mm_mul_ps(vTemp, Scale); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUByteN2(const XMUBYTEN2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x)* (1.0f / 255.0f), - static_cast(pSource->y)* (1.0f / 255.0f), - 0.0f, - 0.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); - uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u16(vInt8)); - uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); - vInt = vandq_u32(vInt, g_XMMaskXY); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_n_f32(R, 1.0f / 255.0f); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f / 255.0f, 1.0f / (255.0f * 256.0f), 0, 0 } } }; - static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; - // Splat the color in all four entries (x,z,y,w) - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask - vTemp = _mm_and_ps(vTemp, Mask); - // w is signed! Flip the bits to convert the order to unsigned - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // w + 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Fix y, z and w because they are too large - return _mm_mul_ps(vTemp, Scale); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUByte2(const XMUBYTE2* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - 0.0f, - 0.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); - uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u16(vInt8)); - uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); - vInt = vandq_u32(vInt, g_XMMaskXY); - return vcvtq_f32_u32(vInt); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f, 1.0f / 256.0f, 0, 0 } } }; - static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; - // Splat the color in all four entries (x,z,y,w) - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask - vTemp = _mm_and_ps(vTemp, Mask); - // w is signed! Flip the bits to convert the order to unsigned - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // w + 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Fix y, z and w because they are too large - return _mm_mul_ps(vTemp, Scale); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadU565(const XMU565* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - float(pSource->v & 0x1F), - float((pSource->v >> 5) & 0x3F), - float((pSource->v >> 11) & 0x1F), - 0.f, - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORI32 U565And = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; - static const XMVECTORF32 U565Mul = { { { 1.0f, 1.0f / 32.0f, 1.0f / 2048.f, 0 } } }; - uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); - uint32x4_t vInt = vmovl_u16(vInt16); - vInt = vandq_u32(vInt, U565And); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_f32(R, U565Mul); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORI32 U565And = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; - static const XMVECTORF32 U565Mul = { { { 1.0f, 1.0f / 32.0f, 1.0f / 2048.f, 0 } } }; - // Get the 16 bit value and splat it - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask off x, y and z - vResult = _mm_and_ps(vResult, U565And); - // Convert to float - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Normalize x, y, and z - vResult = _mm_mul_ps(vResult, U565Mul); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat3PK(const XMFLOAT3PK* pSource) noexcept -{ - assert(pSource); - - XM_ALIGNED_DATA(16) uint32_t Result[4]; - uint32_t Mantissa; - uint32_t Exponent; - - // X Channel (6-bit mantissa) - Mantissa = pSource->xm; - - if (pSource->xe == 0x1f) // INF or NAN - { - Result[0] = static_cast(0x7f800000 | (static_cast(pSource->xm) << 17)); - } - else - { - if (pSource->xe != 0) // The value is normalized - { - Exponent = pSource->xe; - } - else if (Mantissa != 0) // The value is denormalized - { - // Normalize the value in the resulting float - Exponent = 1; - - do - { - Exponent--; - Mantissa <<= 1; - } - while ((Mantissa & 0x40) == 0); - - Mantissa &= 0x3F; - } - else // The value is zero - { - Exponent = static_cast(-112); - } - - Result[0] = ((Exponent + 112) << 23) | (Mantissa << 17); - } - - // Y Channel (6-bit mantissa) - Mantissa = pSource->ym; - - if (pSource->ye == 0x1f) // INF or NAN - { - Result[1] = static_cast(0x7f800000 | (static_cast(pSource->ym) << 17)); - } - else - { - if (pSource->ye != 0) // The value is normalized - { - Exponent = pSource->ye; - } - else if (Mantissa != 0) // The value is denormalized - { - // Normalize the value in the resulting float - Exponent = 1; - - do - { - Exponent--; - Mantissa <<= 1; - } - while ((Mantissa & 0x40) == 0); - - Mantissa &= 0x3F; - } - else // The value is zero - { - Exponent = static_cast(-112); - } - - Result[1] = ((Exponent + 112) << 23) | (Mantissa << 17); - } - - // Z Channel (5-bit mantissa) - Mantissa = pSource->zm; - - if (pSource->ze == 0x1f) // INF or NAN - { - Result[2] = static_cast(0x7f800000 | (static_cast(pSource->zm) << 17)); - } - else - { - if (pSource->ze != 0) // The value is normalized - { - Exponent = pSource->ze; - } - else if (Mantissa != 0) // The value is denormalized - { - // Normalize the value in the resulting float - Exponent = 1; - - do - { - Exponent--; - Mantissa <<= 1; - } - while ((Mantissa & 0x20) == 0); - - Mantissa &= 0x1F; - } - else // The value is zero - { - Exponent = static_cast(-112); - } - - Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18); - } - - return XMLoadFloat3A(reinterpret_cast(&Result)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadFloat3SE(const XMFLOAT3SE* pSource) noexcept -{ - assert(pSource); - - union { float f; int32_t i; } fi; - fi.i = 0x33800000 + (pSource->e << 23); - float Scale = fi.f; - - XMVECTORF32 v = { { { - Scale * float(pSource->xm), - Scale * float(pSource->ym), - Scale * float(pSource->zm), - 1.0f } } }; - return v; -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadHalf4(const XMHALF4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - __m128i V = _mm_loadl_epi64(reinterpret_cast(pSource)); - return _mm_cvtph_ps(V); -#else - XMVECTORF32 vResult = { { { - XMConvertHalfToFloat(pSource->x), - XMConvertHalfToFloat(pSource->y), - XMConvertHalfToFloat(pSource->z), - XMConvertHalfToFloat(pSource->w) - } } }; - return vResult.v; -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadShortN4(const XMSHORTN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - (pSource->x == -32768) ? -1.f : (static_cast(pSource->x)* (1.0f / 32767.0f)), - (pSource->y == -32768) ? -1.f : (static_cast(pSource->y)* (1.0f / 32767.0f)), - (pSource->z == -32768) ? -1.f : (static_cast(pSource->z)* (1.0f / 32767.0f)), - (pSource->w == -32768) ? -1.f : (static_cast(pSource->w)* (1.0f / 32767.0f)) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int16x4_t vInt = vld1_s16(reinterpret_cast(pSource)); - int32x4_t V = vmovl_s16(vInt); - float32x4_t vResult = vcvtq_f32_s32(V); - vResult = vmulq_n_f32(vResult, 1.0f / 32767.0f); - return vmaxq_f32(vResult, vdupq_n_f32(-1.f)); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the color in all four entries (x,z,y,w) - __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); - // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 - __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); - // x and z are unsigned! Flip the bits to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16Z16W16); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x and z - 0x8000 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16Z16W16); - // Convert to -1.0f - 1.0f - vTemp = _mm_mul_ps(vTemp, g_XMNormalizeX16Y16Z16W16); - // Very important! The entries are x,z,y,w, flip it to x,y,z,w - vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); - // Clamp result (for case of -32768) - return _mm_max_ps(vTemp, g_XMNegativeOne); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadShort4(const XMSHORT4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - static_cast(pSource->z), - static_cast(pSource->w) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - int16x4_t vInt = vld1_s16(reinterpret_cast(pSource)); - int32x4_t V = vmovl_s16(vInt); - return vcvtq_f32_s32(V); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the color in all four entries (x,z,y,w) - __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); - // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 - __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); - // x and z are unsigned! Flip the bits to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16Z16W16); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x and z - 0x8000 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16Z16W16); - // Fix y and w because they are 65536 too large - vTemp = _mm_mul_ps(vTemp, g_XMFixupY16W16); - // Very important! The entries are x,z,y,w, flip it to x,y,z,w - return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUShortN4(const XMUSHORTN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x) / 65535.0f, - static_cast(pSource->y) / 65535.0f, - static_cast(pSource->z) / 65535.0f, - static_cast(pSource->w) / 65535.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint16x4_t vInt = vld1_u16(reinterpret_cast(pSource)); - uint32x4_t V = vmovl_u16(vInt); - float32x4_t vResult = vcvtq_f32_u32(V); - return vmulq_n_f32(vResult, 1.0f / 65535.0f); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 FixupY16W16 = { { { 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / (65535.0f * 65536.0f), 1.0f / (65535.0f * 65536.0f) } } }; - static const XMVECTORF32 FixaddY16W16 = { { { 0, 0, 32768.0f * 65536.0f, 32768.0f * 65536.0f } } }; - // Splat the color in all four entries (x,z,y,w) - __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); - // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 - __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); - // y and w are signed! Flip the bits to convert the order to unsigned - vTemp = _mm_xor_ps(vTemp, g_XMFlipZW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // y and w + 0x8000 to complete the conversion - vTemp = _mm_add_ps(vTemp, FixaddY16W16); - // Fix y and w because they are 65536 too large - vTemp = _mm_mul_ps(vTemp, FixupY16W16); - // Very important! The entries are x,z,y,w, flip it to x,y,z,w - return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUShort4(const XMUSHORT4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - static_cast(pSource->z), - static_cast(pSource->w) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint16x4_t vInt = vld1_u16(reinterpret_cast(pSource)); - uint32x4_t V = vmovl_u16(vInt); - return vcvtq_f32_u32(V); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 FixaddY16W16 = { { { 0, 0, 32768.0f, 32768.0f } } }; - // Splat the color in all four entries (x,z,y,w) - __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); - // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 - __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); - // y and w are signed! Flip the bits to convert the order to unsigned - vTemp = _mm_xor_ps(vTemp, g_XMFlipZW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // Fix y and w because they are 65536 too large - vTemp = _mm_mul_ps(vTemp, g_XMFixupY16W16); - // y and w + 0x8000 to complete the conversion - vTemp = _mm_add_ps(vTemp, FixaddY16W16); - // Very important! The entries are x,z,y,w, flip it to x,y,z,w - return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadXDecN4(const XMXDECN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; - - uint32_t ElementX = pSource->v & 0x3FF; - uint32_t ElementY = (pSource->v >> 10) & 0x3FF; - uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; - - XMVECTORF32 vResult = { { { - (ElementX == 0x200) ? -1.f : (static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])) / 511.0f), - (ElementY == 0x200) ? -1.f : (static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])) / 511.0f), - (ElementZ == 0x200) ? -1.f : (static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])) / 511.0f), - static_cast(pSource->v >> 30) / 3.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskA2B10G10R10); - vInt = veorq_u32(vInt, g_XMFlipA2B10G10R10); - float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); - R = vaddq_f32(R, g_XMFixAA2B10G10R10); - R = vmulq_f32(R, g_XMNormalizeA2B10G10R10); - return vmaxq_f32(R, vdupq_n_f32(-1.0f)); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the color in all four entries - __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskA2B10G10R10); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMFlipA2B10G10R10); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMFixAA2B10G10R10); - // Convert 0-255 to 0.0f-1.0f - vTemp = _mm_mul_ps(vTemp, g_XMNormalizeA2B10G10R10); - // Clamp result (for case of -512) - return _mm_max_ps(vTemp, g_XMNegativeOne); -#endif -} - -//------------------------------------------------------------------------------ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadXDec4(const XMXDEC4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; - - uint32_t ElementX = pSource->v & 0x3FF; - uint32_t ElementY = (pSource->v >> 10) & 0x3FF; - uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; - - XMVECTORF32 vResult = { { { - static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])), - static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])), - static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])), - static_cast(pSource->v >> 30) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORU32 XDec4Xor = { { { 0x200, 0x200 << 10, 0x200 << 20, 0x80000000 } } }; - static const XMVECTORF32 XDec4Add = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 32768 * 65536.0f } } }; - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskDec4); - vInt = veorq_u32(vInt, XDec4Xor); - float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); - R = vaddq_f32(R, XDec4Add); - return vmulq_f32(R, g_XMMulDec4); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORU32 XDec4Xor = { { { 0x200, 0x200 << 10, 0x200 << 20, 0x80000000 } } }; - static const XMVECTORF32 XDec4Add = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 32768 * 65536.0f } } }; - // Splat the color in all four entries - XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, XDec4Xor); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, XDec4Add); - // Convert 0-255 to 0.0f-1.0f - vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); - return vTemp; -#endif -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUDecN4(const XMUDECN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - uint32_t ElementX = pSource->v & 0x3FF; - uint32_t ElementY = (pSource->v >> 10) & 0x3FF; - uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; - - XMVECTORF32 vResult = { { { - static_cast(ElementX) / 1023.0f, - static_cast(ElementY) / 1023.0f, - static_cast(ElementZ) / 1023.0f, - static_cast(pSource->v >> 30) / 3.0f - } } }; - return vResult.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 UDecN4Mul = { { { 1.0f / 1023.0f, 1.0f / (1023.0f * 1024.0f), 1.0f / (1023.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskDec4); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_f32(R, UDecN4Mul); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 UDecN4Mul = { { { 1.0f / 1023.0f, 1.0f / (1023.0f * 1024.0f), 1.0f / (1023.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; - // Splat the color in all four entries - XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Convert 0-255 to 0.0f-1.0f - vTemp = _mm_mul_ps(vTemp, UDecN4Mul); - return vTemp; -#endif -} - - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(const XMUDECN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - - int32_t ElementX = pSource->v & 0x3FF; - int32_t ElementY = (pSource->v >> 10) & 0x3FF; - int32_t ElementZ = (pSource->v >> 20) & 0x3FF; - - XMVECTORF32 vResult = { { { - static_cast(ElementX - 0x180) / 510.0f, - static_cast(ElementY - 0x180) / 510.0f, - static_cast(ElementZ - 0x180) / 510.0f, - static_cast(pSource->v >> 30) / 3.0f - } } }; - - return vResult.v; - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 XRMul = { { { 1.0f / 510.0f, 1.0f / (510.0f * 1024.0f), 1.0f / (510.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; - static const XMVECTORI32 XRBias = { { { 0x180, 0x180 * 1024, 0x180 * 1024 * 1024, 0 } } }; - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskDec4); - int32x4_t vTemp = vsubq_s32(vreinterpretq_s32_u32(vInt), XRBias); - vTemp = veorq_s32(vTemp, g_XMFlipW); - float32x4_t R = vcvtq_f32_s32(vTemp); - R = vaddq_f32(R, g_XMAddUDec4); - return vmulq_f32(R, XRMul); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 XRMul = { { { 1.0f / 510.0f, 1.0f / (510.0f * 1024.0f), 1.0f / (510.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; - static const XMVECTORI32 XRBias = { { { 0x180, 0x180 * 1024, 0x180 * 1024 * 1024, 0 } } }; - // Splat the color in all four entries - XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Mask channels - vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); - // Subtract bias - vTemp = _mm_castsi128_ps(_mm_sub_epi32(_mm_castps_si128(vTemp), XRBias)); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Convert to 0.0f-1.0f - return _mm_mul_ps(vTemp, XRMul); -#endif -} - - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUDec4(const XMUDEC4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - uint32_t ElementX = pSource->v & 0x3FF; - uint32_t ElementY = (pSource->v >> 10) & 0x3FF; - uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; - - XMVECTORF32 vResult = { { { - static_cast(ElementX), - static_cast(ElementY), - static_cast(ElementZ), - static_cast(pSource->v >> 30) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskDec4); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_f32(R, g_XMMulDec4); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the color in all four entries - XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Convert 0-255 to 0.0f-1.0f - vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadDecN4(const XMDECN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; - static const uint32_t SignExtendW[] = { 0x00000000, 0xFFFFFFFC }; - - uint32_t ElementX = pSource->v & 0x3FF; - uint32_t ElementY = (pSource->v >> 10) & 0x3FF; - uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; - uint32_t ElementW = pSource->v >> 30; - - XMVECTORF32 vResult = { { { - (ElementX == 0x200) ? -1.f : (static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])) / 511.0f), - (ElementY == 0x200) ? -1.f : (static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])) / 511.0f), - (ElementZ == 0x200) ? -1.f : (static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])) / 511.0f), - (ElementW == 0x2) ? -1.f : static_cast(static_cast(ElementW | SignExtendW[(ElementW >> 1) & 1])) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 DecN4Mul = { { { 1.0f / 511.0f, 1.0f / (511.0f * 1024.0f), 1.0f / (511.0f * 1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskDec4); - vInt = veorq_u32(vInt, g_XMXorDec4); - float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); - R = vaddq_f32(R, g_XMAddDec4); - R = vmulq_f32(R, DecN4Mul); - return vmaxq_f32(R, vdupq_n_f32(-1.0f)); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 DecN4Mul = { { { 1.0f / 511.0f, 1.0f / (511.0f * 1024.0f), 1.0f / (511.0f * 1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; - // Splat the color in all four entries - XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMXorDec4); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMAddDec4); - // Convert 0-255 to 0.0f-1.0f - vTemp = _mm_mul_ps(vTemp, DecN4Mul); - // Clamp result (for case of -512/-1) - return _mm_max_ps(vTemp, g_XMNegativeOne); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadDec4(const XMDEC4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; - static const uint32_t SignExtendW[] = { 0x00000000, 0xFFFFFFFC }; - - uint32_t ElementX = pSource->v & 0x3FF; - uint32_t ElementY = (pSource->v >> 10) & 0x3FF; - uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; - uint32_t ElementW = pSource->v >> 30; - - XMVECTORF32 vResult = { { { - static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])), - static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])), - static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])), - static_cast(static_cast(ElementW | SignExtendW[ElementW >> 1])) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); - vInt = vandq_u32(vInt, g_XMMaskDec4); - vInt = veorq_u32(vInt, g_XMXorDec4); - float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); - R = vaddq_f32(R, g_XMAddDec4); - return vmulq_f32(R, g_XMMulDec4); -#elif defined(_XM_SSE_INTRINSICS_) - // Splat the color in all four entries - XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); - // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); - // a is unsigned! Flip the bit to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMXorDec4); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // RGB + 0, A + 0x80000000.f to undo the signed order. - vTemp = _mm_add_ps(vTemp, g_XMAddDec4); - // Convert 0-255 to 0.0f-1.0f - vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); - return vTemp; -#endif -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUByteN4(const XMUBYTEN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x) / 255.0f, - static_cast(pSource->y) / 255.0f, - static_cast(pSource->z) / 255.0f, - static_cast(pSource->w) / 255.0f - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); - uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); - uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_n_f32(R, 1.0f / 255.0f); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 LoadUByteN4Mul = { { { 1.0f / 255.0f, 1.0f / (255.0f * 256.0f), 1.0f / (255.0f * 65536.0f), 1.0f / (255.0f * 65536.0f * 256.0f) } } }; - // Splat the color in all four entries (x,z,y,w) - XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); - // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); - // w is signed! Flip the bits to convert the order to unsigned - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // w + 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Fix y, z and w because they are too large - vTemp = _mm_mul_ps(vTemp, LoadUByteN4Mul); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUByte4(const XMUBYTE4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - static_cast(pSource->z), - static_cast(pSource->w) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); - uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); - uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); - return vcvtq_f32_u32(vInt); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 LoadUByte4Mul = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; - // Splat the color in all four entries (x,z,y,w) - XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); - // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); - // w is signed! Flip the bits to convert the order to unsigned - vTemp = _mm_xor_ps(vTemp, g_XMFlipW); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // w + 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); - // Fix y, z and w because they are too large - vTemp = _mm_mul_ps(vTemp, LoadUByte4Mul); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadByteN4(const XMBYTEN4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - (pSource->x == -128) ? -1.f : (static_cast(pSource->x) / 127.0f), - (pSource->y == -128) ? -1.f : (static_cast(pSource->y) / 127.0f), - (pSource->z == -128) ? -1.f : (static_cast(pSource->z) / 127.0f), - (pSource->w == -128) ? -1.f : (static_cast(pSource->w) / 127.0f) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); - int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u32(vInt8)); - int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); - float32x4_t R = vcvtq_f32_s32(vInt); - R = vmulq_n_f32(R, 1.0f / 127.0f); - return vmaxq_f32(R, vdupq_n_f32(-1.f)); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 LoadByteN4Mul = { { { 1.0f / 127.0f, 1.0f / (127.0f * 256.0f), 1.0f / (127.0f * 65536.0f), 1.0f / (127.0f * 65536.0f * 256.0f) } } }; - // Splat the color in all four entries (x,z,y,w) - XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); - // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); - // x,y and z are unsigned! Flip the bits to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x, y and z - 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddByte4); - // Fix y, z and w because they are too large - vTemp = _mm_mul_ps(vTemp, LoadByteN4Mul); - // Clamp result (for case of -128) - return _mm_max_ps(vTemp, g_XMNegativeOne); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadByte4(const XMBYTE4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - static_cast(pSource->x), - static_cast(pSource->y), - static_cast(pSource->z), - static_cast(pSource->w) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); - int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u32(vInt8)); - int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); - return vcvtq_f32_s32(vInt); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 LoadByte4Mul = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; - // Splat the color in all four entries (x,z,y,w) - XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); - // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 - vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); - // x,y and z are unsigned! Flip the bits to convert the order to signed - vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); - // Convert to floating point numbers - vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); - // x, y and z - 0x80 to complete the conversion - vTemp = _mm_add_ps(vTemp, g_XMAddByte4); - // Fix y, z and w because they are too large - vTemp = _mm_mul_ps(vTemp, LoadByte4Mul); - return vTemp; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadUNibble4(const XMUNIBBLE4* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - float(pSource->v & 0xF), - float((pSource->v >> 4) & 0xF), - float((pSource->v >> 8) & 0xF), - float((pSource->v >> 12) & 0xF) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORI32 UNibble4And = { { { 0xF, 0xF0, 0xF00, 0xF000 } } }; - static const XMVECTORF32 UNibble4Mul = { { { 1.0f, 1.0f / 16.f, 1.0f / 256.f, 1.0f / 4096.f } } }; - uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); - uint32x4_t vInt = vmovl_u16(vInt16); - vInt = vandq_u32(vInt, UNibble4And); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_f32(R, UNibble4Mul); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORI32 UNibble4And = { { { 0xF, 0xF0, 0xF00, 0xF000 } } }; - static const XMVECTORF32 UNibble4Mul = { { { 1.0f, 1.0f / 16.f, 1.0f / 256.f, 1.0f / 4096.f } } }; - // Get the 16 bit value and splat it - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask off x, y and z - vResult = _mm_and_ps(vResult, UNibble4And); - // Convert to float - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Normalize x, y, and z - vResult = _mm_mul_ps(vResult, UNibble4Mul); - return vResult; -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMVECTOR XM_CALLCONV XMLoadU555(const XMU555* pSource) noexcept -{ - assert(pSource); -#if defined(_XM_NO_INTRINSICS_) - XMVECTORF32 vResult = { { { - float(pSource->v & 0x1F), - float((pSource->v >> 5) & 0x1F), - float((pSource->v >> 10) & 0x1F), - float((pSource->v >> 15) & 0x1) - } } }; - return vResult.v; -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORI32 U555And = { { { 0x1F, 0x1F << 5, 0x1F << 10, 0x8000 } } }; - static const XMVECTORF32 U555Mul = { { { 1.0f, 1.0f / 32.f, 1.0f / 1024.f, 1.0f / 32768.f } } }; - uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); - uint32x4_t vInt = vmovl_u16(vInt16); - vInt = vandq_u32(vInt, U555And); - float32x4_t R = vcvtq_f32_u32(vInt); - return vmulq_f32(R, U555Mul); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORI32 U555And = { { { 0x1F, 0x1F << 5, 0x1F << 10, 0x8000 } } }; - static const XMVECTORF32 U555Mul = { { { 1.0f, 1.0f / 32.f, 1.0f / 1024.f, 1.0f / 32768.f } } }; - // Get the 16bit value and splat it - __m128i vInt = XM_LOADU_SI16(&pSource->v); - XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); - // Mask off x, y and z - vResult = _mm_and_ps(vResult, U555And); - // Convert to float - vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); - // Normalize x, y, and z - vResult = _mm_mul_ps(vResult, U555Mul); - return vResult; -#endif -} - -#ifdef _PREFAST_ -#pragma prefast(pop) -#endif - -/**************************************************************************** - * - * Vector and matrix store operations - * - ****************************************************************************/ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreColor -( - XMCOLOR* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorSaturate(V); - N = XMVectorMultiply(N, g_UByteMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->c = (static_cast(tmp.w) << 24) | - (static_cast(tmp.x) << 16) | - (static_cast(tmp.y) << 8) | - static_cast(tmp.z); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 255.0f); - R = XMVectorRound(R); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); - uint32_t rgba = vget_lane_u32(vreinterpret_u32_u8(vInt8), 0); - pDestination->c = (rgba & 0xFF00FF00) | ((rgba >> 16) & 0xFF) | ((rgba << 16) & 0xFF0000); -#elif defined(_XM_SSE_INTRINSICS_) - // Set <0 to 0 - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - // Set>1 to 1 - vResult = _mm_min_ps(vResult, g_XMOne); - // Convert to 0-255 - vResult = _mm_mul_ps(vResult, g_UByteMax); - // Shuffle RGBA to ARGB - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); - // Convert to int - __m128i vInt = _mm_cvtps_epi32(vResult); - // Mash to shorts - vInt = _mm_packs_epi32(vInt, vInt); - // Mash to bytes - vInt = _mm_packus_epi16(vInt, vInt); - // Store the color - _mm_store_ss(reinterpret_cast(&pDestination->c), _mm_castsi128_ps(vInt)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreHalf2 -( - XMHALF2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - __m128i V1 = _mm_cvtps_ph(V, _MM_FROUND_TO_NEAREST_INT); - _mm_store_ss(reinterpret_cast(pDestination), _mm_castsi128_ps(V1)); -#else - pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); - pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreShortN2 -( - XMSHORTN2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); - N = XMVectorMultiply(N, g_ShortMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 32767.0f); - int32x4_t vInt32 = vcvtq_s32_f32(R); - int16x4_t vInt16 = vqmovn_s32(vInt32); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_s16(vInt16), 0); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); - vResult = _mm_min_ps(vResult, g_XMOne); - vResult = _mm_mul_ps(vResult, g_ShortMax); - __m128i vResulti = _mm_cvtps_epi32(vResult); - vResulti = _mm_packs_epi32(vResulti, vResulti); - _mm_store_ss(reinterpret_cast(&pDestination->x), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreShort2 -( - XMSHORT2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_ShortMin, g_ShortMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-32767.f)); - R = vminq_f32(R, vdupq_n_f32(32767.0f)); - int32x4_t vInt32 = vcvtq_s32_f32(R); - int16x4_t vInt16 = vqmovn_s32(vInt32); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_s16(vInt16), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_ShortMin); - vResult = _mm_min_ps(vResult, g_ShortMax); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // Pack the ints into shorts - vInt = _mm_packs_epi32(vInt, vInt); - _mm_store_ss(reinterpret_cast(&pDestination->x), _mm_castsi128_ps(vInt)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUShortN2 -( - XMUSHORTN2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorSaturate(V); - N = XMVectorMultiplyAdd(N, g_UShortMax, g_XMOneHalf.v); - N = XMVectorTruncate(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 65535.0f); - R = vaddq_f32(R, g_XMOneHalf); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_u16(vInt16), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_XMOne); - vResult = _mm_mul_ps(vResult, g_UShortMax); - vResult = _mm_add_ps(vResult, g_XMOneHalf); - // Convert to int - __m128i vInt = _mm_cvttps_epi32(vResult); - // Since the SSE pack instruction clamps using signed rules, - // manually extract the values to store them to memory - pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); - pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUShort2 -( - XMUSHORT2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UShortMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); - R = vminq_f32(R, vdupq_n_f32(65535.0f)); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_u16(vInt16), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_UShortMax); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // Since the SSE pack instruction clamps using signed rules, - // manually extract the values to store them to memory - pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); - pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreByteN2 -( - XMBYTEN2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); - N = XMVectorMultiply(N, g_ByteMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 127.0f); - int32x4_t vInt32 = vcvtq_s32_f32(R); - int16x4_t vInt16 = vqmovn_s32(vInt32); - int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); - vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_s8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, g_ByteMax); - // Convert to int by rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreByte2 -( - XMBYTE2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_ByteMin, g_ByteMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-127.f)); - R = vminq_f32(R, vdupq_n_f32(127.0f)); - int32x4_t vInt32 = vcvtq_s32_f32(R); - int16x4_t vInt16 = vqmovn_s32(vInt32); - int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); - vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_s8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_ByteMin); - vResult = _mm_min_ps(vResult, g_ByteMax); - // Convert to int by rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUByteN2 -( - XMUBYTEN2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorSaturate(V); - N = XMVectorMultiplyAdd(N, g_UByteMax, g_XMOneHalf.v); - N = XMVectorTruncate(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 255.0f); - R = vaddq_f32(R, g_XMOneHalf); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); - vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_u8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, g_UByteMax); - vResult = _mm_add_ps(vResult, g_XMOneHalf); - // Convert to int - __m128i vInt = _mm_cvttps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUByte2 -( - XMUBYTE2* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UByteMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); - R = vminq_f32(R, vdupq_n_f32(255.0f)); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); - vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_u8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_UByteMax); - // Convert to int by rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreU565 -( - XMU565* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 Max = { { { 31.0f, 63.0f, 31.0f, 0.0f } } }; - -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - ((static_cast(tmp.z) & 0x1F) << 11) - | ((static_cast(tmp.y) & 0x3F) << 5) - | ((static_cast(tmp.x) & 0x1F))); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f, 32.f, 32.f * 64.f, 0.f } } }; - static const XMVECTORU32 Mask = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); - vResult = vminq_f32(vResult, Max); - vResult = vmulq_f32(vResult, Scale); - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - vResulti = vandq_u32(vResulti, Mask); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vResulti); - uint32x2_t vhi = vget_high_u32(vResulti); - vTemp = vorr_u32(vTemp, vhi); - vTemp = vpadd_u32(vTemp, vTemp); - vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, Max); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - auto z = static_cast(_mm_extract_epi16(vInt, 4)); - pDestination->v = static_cast( - ((static_cast(z) & 0x1F) << 11) - | ((static_cast(y) & 0x3F) << 5) - | ((static_cast(x) & 0x1F))); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3PK -( - XMFLOAT3PK* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - - XM_ALIGNED_DATA(16) uint32_t IValue[4]; - XMStoreFloat3A(reinterpret_cast(&IValue), V); - - uint32_t Result[3]; - - // X & Y Channels (5-bit exponent, 6-bit mantissa) - for (uint32_t j = 0; j < 2; ++j) - { - uint32_t Sign = IValue[j] & 0x80000000; - uint32_t I = IValue[j] & 0x7FFFFFFF; - - if ((I & 0x7F800000) == 0x7F800000) - { - // INF or NAN - Result[j] = 0x7C0U; - if ((I & 0x7FFFFF) != 0) - { - Result[j] = 0x7FFU; - } - else if (Sign) - { - // -INF is clamped to 0 since 3PK is positive only - Result[j] = 0; - } - } - else if (Sign || I < 0x35800000) - { - // 3PK is positive only, so clamp to zero - Result[j] = 0; - } - else if (I > 0x477E0000U) - { - // The number is too large to be represented as a float11, set to max - Result[j] = 0x7BFU; - } - else - { - if (I < 0x38800000U) - { - // The number is too small to be represented as a normalized float11 - // Convert it to a denormalized value. - uint32_t Shift = 113U - (I >> 23U); - I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; - } - else - { - // Rebias the exponent to represent the value as a normalized float11 - I += 0xC8000000U; - } - - Result[j] = ((I + 0xFFFFU + ((I >> 17U) & 1U)) >> 17U) & 0x7ffU; - } - } - - // Z Channel (5-bit exponent, 5-bit mantissa) - uint32_t Sign = IValue[2] & 0x80000000; - uint32_t I = IValue[2] & 0x7FFFFFFF; - - if ((I & 0x7F800000) == 0x7F800000) - { - // INF or NAN - Result[2] = 0x3E0U; - if (I & 0x7FFFFF) - { - Result[2] = 0x3FFU; - } - else if (Sign || I < 0x36000000) - { - // -INF is clamped to 0 since 3PK is positive only - Result[2] = 0; - } - } - else if (Sign) - { - // 3PK is positive only, so clamp to zero - Result[2] = 0; - } - else if (I > 0x477C0000U) - { - // The number is too large to be represented as a float10, set to max - Result[2] = 0x3DFU; - } - else - { - if (I < 0x38800000U) - { - // The number is too small to be represented as a normalized float10 - // Convert it to a denormalized value. - uint32_t Shift = 113U - (I >> 23U); - I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; - } - else - { - // Rebias the exponent to represent the value as a normalized float10 - I += 0xC8000000U; - } - - Result[2] = ((I + 0x1FFFFU + ((I >> 18U) & 1U)) >> 18U) & 0x3ffU; - } - - // Pack Result into memory - pDestination->v = (Result[0] & 0x7ff) - | ((Result[1] & 0x7ff) << 11) - | ((Result[2] & 0x3ff) << 22); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreFloat3SE -( - XMFLOAT3SE* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - - XMFLOAT3A tmp; - XMStoreFloat3A(&tmp, V); - - static constexpr float maxf9 = float(0x1FF << 7); - static constexpr float minf9 = float(1.f / (1 << 16)); - - float x = (tmp.x >= 0.f) ? ((tmp.x > maxf9) ? maxf9 : tmp.x) : 0.f; - float y = (tmp.y >= 0.f) ? ((tmp.y > maxf9) ? maxf9 : tmp.y) : 0.f; - float z = (tmp.z >= 0.f) ? ((tmp.z > maxf9) ? maxf9 : tmp.z) : 0.f; - - const float max_xy = (x > y) ? x : y; - const float max_xyz = (max_xy > z) ? max_xy : z; - - const float maxColor = (max_xyz > minf9) ? max_xyz : minf9; - - union { float f; int32_t i; } fi; - fi.f = maxColor; - fi.i += 0x00004000; // round up leaving 9 bits in fraction (including assumed 1) - - auto exp = static_cast(fi.i) >> 23; - pDestination->e = exp - 0x6f; - - fi.i = static_cast(0x83000000 - (exp << 23)); - float ScaleR = fi.f; - - pDestination->xm = static_cast(MathInternal::round_to_nearest(x * ScaleR)); - pDestination->ym = static_cast(MathInternal::round_to_nearest(y * ScaleR)); - pDestination->zm = static_cast(MathInternal::round_to_nearest(z * ScaleR)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreHalf4 -( - XMHALF4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) - __m128i V1 = _mm_cvtps_ph(V, _MM_FROUND_TO_NEAREST_INT); - _mm_storel_epi64(reinterpret_cast<__m128i*>(pDestination), V1); -#else - XMFLOAT4A t; - XMStoreFloat4A(&t, V); - - pDestination->x = XMConvertFloatToHalf(t.x); - pDestination->y = XMConvertFloatToHalf(t.y); - pDestination->z = XMConvertFloatToHalf(t.z); - pDestination->w = XMConvertFloatToHalf(t.w); -#endif // !_XM_F16C_INTRINSICS_ -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreShortN4 -( - XMSHORTN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); - N = XMVectorMultiply(N, g_ShortMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(-1.f)); - vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); - vResult = vmulq_n_f32(vResult, 32767.0f); - int16x4_t vInt = vmovn_s32(vcvtq_s32_f32(vResult)); - vst1_s16(reinterpret_cast(pDestination), vInt); -#elif defined(_XM_SSE_INTRINSICS_) - XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); - vResult = _mm_min_ps(vResult, g_XMOne); - vResult = _mm_mul_ps(vResult, g_ShortMax); - __m128i vResulti = _mm_cvtps_epi32(vResult); - vResulti = _mm_packs_epi32(vResulti, vResulti); - _mm_store_sd(reinterpret_cast(&pDestination->x), _mm_castsi128_pd(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreShort4 -( - XMSHORT4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_ShortMin, g_ShortMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmaxq_f32(V, g_ShortMin); - vResult = vminq_f32(vResult, g_ShortMax); - int16x4_t vInt = vmovn_s32(vcvtq_s32_f32(vResult)); - vst1_s16(reinterpret_cast(pDestination), vInt); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_ShortMin); - vResult = _mm_min_ps(vResult, g_ShortMax); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // Pack the ints into shorts - vInt = _mm_packs_epi32(vInt, vInt); - _mm_store_sd(reinterpret_cast(&pDestination->x), _mm_castsi128_pd(vInt)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUShortN4 -( - XMUSHORTN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorSaturate(V); - N = XMVectorMultiplyAdd(N, g_UShortMax, g_XMOneHalf.v); - N = XMVectorTruncate(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); - vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); - vResult = vmulq_n_f32(vResult, 65535.0f); - vResult = vaddq_f32(vResult, g_XMOneHalf); - uint16x4_t vInt = vmovn_u32(vcvtq_u32_f32(vResult)); - vst1_u16(reinterpret_cast(pDestination), vInt); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_XMOne); - vResult = _mm_mul_ps(vResult, g_UShortMax); - vResult = _mm_add_ps(vResult, g_XMOneHalf); - // Convert to int - __m128i vInt = _mm_cvttps_epi32(vResult); - // Since the SSE pack instruction clamps using signed rules, - // manually extract the values to store them to memory - pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); - pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); - pDestination->z = static_cast(_mm_extract_epi16(vInt, 4)); - pDestination->w = static_cast(_mm_extract_epi16(vInt, 6)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUShort4 -( - XMUSHORT4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UShortMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); - vResult = vminq_f32(vResult, g_UShortMax); - uint16x4_t vInt = vmovn_u32(vcvtq_u32_f32(vResult)); - vst1_u16(reinterpret_cast(pDestination), vInt); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_UShortMax); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // Since the SSE pack instruction clamps using signed rules, - // manually extract the values to store them to memory - pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); - pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); - pDestination->z = static_cast(_mm_extract_epi16(vInt, 4)); - pDestination->w = static_cast(_mm_extract_epi16(vInt, 6)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreXDecN4 -( - XMXDECN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 Min = { { { -1.0f, -1.0f, -1.0f, 0.0f } } }; - -#if defined(_XM_NO_INTRINSICS_) - - static const XMVECTORF32 Scale = { { { 511.0f, 511.0f, 511.0f, 3.0f } } }; - - XMVECTOR N = XMVectorClamp(V, Min.v, g_XMOne.v); - N = XMVectorMultiply(N, Scale.v); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | (static_cast(tmp.x) & 0x3FF)); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1048576.0f, 3.0f * 536870912.0f } } }; - static const XMVECTORI32 ScaleMask = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 29 } } }; - float32x4_t vResult = vmaxq_f32(V, Min); - vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); - vResult = vmulq_f32(vResult, Scale); - int32x4_t vResulti = vcvtq_s32_f32(vResult); - vResulti = vandq_s32(vResulti, ScaleMask); - int32x4_t vResultw = vandq_s32(vResulti, g_XMMaskW); - vResulti = vaddq_s32(vResulti, vResultw); - // Do a horizontal or of all 4 entries - uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); - uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); - vTemp = vorr_u32(vTemp, vhi); - vTemp = vpadd_u32(vTemp, vTemp); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1048576.0f, 3.0f * 536870912.0f } } }; - static const XMVECTORI32 ScaleMask = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 29 } } }; - XMVECTOR vResult = _mm_max_ps(V, Min); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, Scale); - // Convert to int (W is unsigned) - __m128i vResulti = _mm_cvtps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, ScaleMask); - // To fix W, add itself to shift it up to <<30 instead of <<29 - __m128i vResultw = _mm_and_si128(vResulti, g_XMMaskW); - vResulti = _mm_add_epi32(vResulti, vResultw); - // Do a horizontal or of all 4 entries - vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vResulti), _MM_SHUFFLE(0, 3, 2, 1)); - vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 3, 2, 1)); - vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); - vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 3, 2, 1)); - vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreXDec4 -( - XMXDEC4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 MinXDec4 = { { { -511.0f, -511.0f, -511.0f, 0.0f } } }; - static const XMVECTORF32 MaxXDec4 = { { { 511.0f, 511.0f, 511.0f, 3.0f } } }; - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, MinXDec4, MaxXDec4); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | ((static_cast(tmp.x) & 0x3FF))); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 ScaleXDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; - static const XMVECTORI32 MaskXDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - float32x4_t vResult = vmaxq_f32(V, MinXDec4); - vResult = vminq_f32(vResult, MaxXDec4); - vResult = vmulq_f32(vResult, ScaleXDec4); - int32x4_t vResulti = vcvtq_s32_f32(vResult); - vResulti = vandq_s32(vResulti, MaskXDec4); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); - uint32x2_t vTemp2 = vget_high_u32(vreinterpretq_u32_s32(vResulti)); - vTemp = vorr_u32(vTemp, vTemp2); - // Perform a single bit left shift on y|w - vTemp2 = vdup_lane_u32(vTemp, 1); - vTemp2 = vadd_u32(vTemp2, vTemp2); - vTemp = vorr_u32(vTemp, vTemp2); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleXDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; - static const XMVECTORI32 MaskXDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, MinXDec4); - vResult = _mm_min_ps(vResult, MaxXDec4); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleXDec4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskXDec4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // Perform a single bit left shift on y|w - vResulti2 = _mm_add_epi32(vResulti2, vResulti2); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUDecN4 -( - XMUDECN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - static const XMVECTORF32 Scale = { { { 1023.0f, 1023.0f, 1023.0f, 3.0f } } }; - - XMVECTOR N = XMVectorSaturate(V); - N = XMVectorMultiply(N, Scale.v); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | ((static_cast(tmp.x) & 0x3FF))); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 ScaleUDecN4 = { { { 1023.0f, 1023.0f * 1024.0f * 0.5f, 1023.0f * 1024.0f * 1024.0f, 3.0f * 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; - static const XMVECTORI32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0.f)); - vResult = vminq_f32(vResult, vdupq_n_f32(1.f)); - vResult = vmulq_f32(vResult, ScaleUDecN4); - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - vResulti = vandq_u32(vResulti, MaskUDecN4); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vResulti); - uint32x2_t vTemp2 = vget_high_u32(vResulti); - vTemp = vorr_u32(vTemp, vTemp2); - // Perform a single bit left shift on y|w - vTemp2 = vdup_lane_u32(vTemp, 1); - vTemp2 = vadd_u32(vTemp2, vTemp2); - vTemp = vorr_u32(vTemp, vTemp2); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleUDecN4 = { { { 1023.0f, 1023.0f * 1024.0f * 0.5f, 1023.0f * 1024.0f * 1024.0f, 3.0f * 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; - static const XMVECTORI32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleUDecN4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskUDecN4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // Perform a left shift by one bit on y|w - vResulti2 = _mm_add_epi32(vResulti2, vResulti2); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUDecN4_XR -( - XMUDECN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 Scale = { { { 510.0f, 510.0f, 510.0f, 3.0f } } }; - static const XMVECTORF32 Bias = { { { 384.0f, 384.0f, 384.0f, 0.0f } } }; - static const XMVECTORF32 C = { { { 1023.f, 1023.f, 1023.f, 3.f } } }; - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorMultiplyAdd(V, Scale, Bias); - N = XMVectorClamp(N, g_XMZero, C); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | ((static_cast(tmp.x) & 0x3FF))); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Shift = { { { 1.0f, 1024.0f * 0.5f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; - static const XMVECTORU32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - float32x4_t vResult = vmlaq_f32(Bias, V, Scale); - vResult = vmaxq_f32(vResult, vdupq_n_f32(0.f)); - vResult = vminq_f32(vResult, C); - vResult = vmulq_f32(vResult, Shift); - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - vResulti = vandq_u32(vResulti, MaskUDecN4); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vResulti); - uint32x2_t vTemp2 = vget_high_u32(vResulti); - vTemp = vorr_u32(vTemp, vTemp2); - // Perform a single bit left shift on y|w - vTemp2 = vdup_lane_u32(vTemp, 1); - vTemp2 = vadd_u32(vTemp2, vTemp2); - vTemp = vorr_u32(vTemp, vTemp2); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 Shift = { { { 1.0f, 1024.0f * 0.5f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; - static const XMVECTORU32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - // Scale & bias - XMVECTOR vResult = XM_FMADD_PS(V, Scale, Bias); - // Clamp to bounds - vResult = _mm_max_ps(vResult, g_XMZero); - vResult = _mm_min_ps(vResult, C); - // Scale by shift values - vResult = _mm_mul_ps(vResult, Shift); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskUDecN4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // Perform a left shift by one bit on y|w - vResulti2 = _mm_add_epi32(vResulti2, vResulti2); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUDec4 -( - XMUDEC4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 MaxUDec4 = { { { 1023.0f, 1023.0f, 1023.0f, 3.0f } } }; - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), MaxUDec4); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | ((static_cast(tmp.x) & 0x3FF))); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 ScaleUDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; - static const XMVECTORI32 MaskUDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0.f)); - vResult = vminq_f32(vResult, MaxUDec4); - vResult = vmulq_f32(vResult, ScaleUDec4); - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - vResulti = vandq_u32(vResulti, MaskUDec4); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vResulti); - uint32x2_t vTemp2 = vget_high_u32(vResulti); - vTemp = vorr_u32(vTemp, vTemp2); - // Perform a single bit left shift on y|w - vTemp2 = vdup_lane_u32(vTemp, 1); - vTemp2 = vadd_u32(vTemp2, vTemp2); - vTemp = vorr_u32(vTemp, vTemp2); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleUDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; - static const XMVECTORI32 MaskUDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, MaxUDec4); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleUDec4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskUDec4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // Perform a left shift by one bit on y|w - vResulti2 = _mm_add_epi32(vResulti2, vResulti2); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreDecN4 -( - XMDECN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - static const XMVECTORF32 Scale = { { { 511.0f, 511.0f, 511.0f, 1.0f } } }; - - XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); - N = XMVectorMultiply(N, Scale.v); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | ((static_cast(tmp.x) & 0x3FF))); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 ScaleDecN4 = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1024.0f * 1024.0f, 1.0f * 1024.0f * 1024.0f * 1024.0f } } }; - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(-1.f)); - vResult = vminq_f32(vResult, vdupq_n_f32(1.f)); - vResult = vmulq_f32(vResult, ScaleDecN4); - int32x4_t vResulti = vcvtq_s32_f32(vResult); - vResulti = vandq_s32(vResulti, g_XMMaskDec4); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); - uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); - vTemp = vorr_u32(vTemp, vhi); - vTemp = vpadd_u32(vTemp, vTemp); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleDecN4 = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1024.0f * 1024.0f, 1.0f * 1024.0f * 1024.0f * 1024.0f } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleDecN4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, g_XMMaskDec4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreDec4 -( - XMDEC4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 MinDec4 = { { { -511.0f, -511.0f, -511.0f, -1.0f } } }; - static const XMVECTORF32 MaxDec4 = { { { 511.0f, 511.0f, 511.0f, 1.0f } } }; - -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, MinDec4, MaxDec4); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - (static_cast(tmp.w) << 30) - | ((static_cast(tmp.z) & 0x3FF) << 20) - | ((static_cast(tmp.y) & 0x3FF) << 10) - | ((static_cast(tmp.x) & 0x3FF))); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 ScaleDec4 = { { { 1.0f, 1024.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f } } }; - float32x4_t vResult = vmaxq_f32(V, MinDec4); - vResult = vminq_f32(vResult, MaxDec4); - vResult = vmulq_f32(vResult, ScaleDec4); - int32x4_t vResulti = vcvtq_s32_f32(vResult); - vResulti = vandq_s32(vResulti, g_XMMaskDec4); - // Do a horizontal or of all 4 entries - uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); - uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); - vTemp = vorr_u32(vTemp, vhi); - vTemp = vpadd_u32(vTemp, vTemp); - vst1_lane_u32(&pDestination->v, vTemp, 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleDec4 = { { { 1.0f, 1024.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, MinDec4); - vResult = _mm_min_ps(vResult, MaxDec4); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleDec4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, g_XMMaskDec4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUByteN4 -( - XMUBYTEN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorSaturate(V); - N = XMVectorMultiply(N, g_UByteMax); - N = XMVectorTruncate(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 255.0f); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_u8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleUByteN4 = { { { 255.0f, 255.0f * 256.0f * 0.5f, 255.0f * 256.0f * 256.0f, 255.0f * 256.0f * 256.0f * 256.0f * 0.5f } } }; - static const XMVECTORI32 MaskUByteN4 = { { { 0xFF, 0xFF << (8 - 1), 0xFF << 16, 0xFF << (24 - 1) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleUByteN4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskUByteN4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // Perform a single bit left shift to fix y|w - vResulti2 = _mm_add_epi32(vResulti2, vResulti2); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUByte4 -( - XMUBYTE4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UByteMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); - R = vminq_f32(R, vdupq_n_f32(255.0f)); - uint32x4_t vInt32 = vcvtq_u32_f32(R); - uint16x4_t vInt16 = vqmovn_u32(vInt32); - uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_u8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleUByte4 = { { { 1.0f, 256.0f * 0.5f, 256.0f * 256.0f, 256.0f * 256.0f * 256.0f * 0.5f } } }; - static const XMVECTORI32 MaskUByte4 = { { { 0xFF, 0xFF << (8 - 1), 0xFF << 16, 0xFF << (24 - 1) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, g_UByteMax); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleUByte4); - // Convert to int by rounding - __m128i vResulti = _mm_cvtps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskUByte4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // Perform a single bit left shift to fix y|w - vResulti2 = _mm_add_epi32(vResulti2, vResulti2); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreByteN4 -( - XMBYTEN4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); - N = XMVectorMultiply(N, g_ByteMax); - N = XMVectorTruncate(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); - R = vminq_f32(R, vdupq_n_f32(1.0f)); - R = vmulq_n_f32(R, 127.0f); - int32x4_t vInt32 = vcvtq_s32_f32(R); - int16x4_t vInt16 = vqmovn_s32(vInt32); - int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_s8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleByteN4 = { { { 127.0f, 127.0f * 256.0f, 127.0f * 256.0f * 256.0f, 127.0f * 256.0f * 256.0f * 256.0f } } }; - static const XMVECTORI32 MaskByteN4 = { { { 0xFF, 0xFF << 8, 0xFF << 16, static_cast(0xFF000000) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); - vResult = _mm_min_ps(vResult, g_XMOne); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleByteN4); - // Convert to int - __m128i vResulti = _mm_cvttps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskByteN4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreByte4 -( - XMBYTE4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, g_ByteMin, g_ByteMax); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->x = static_cast(tmp.x); - pDestination->y = static_cast(tmp.y); - pDestination->z = static_cast(tmp.z); - pDestination->w = static_cast(tmp.w); - -#elif defined(_XM_ARM_NEON_INTRINSICS_) - float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-127.f)); - R = vminq_f32(R, vdupq_n_f32(127.f)); - int32x4_t vInt32 = vcvtq_s32_f32(R); - int16x4_t vInt16 = vqmovn_s32(vInt32); - int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); - vst1_lane_u32(&pDestination->v, vreinterpret_u32_s8(vInt8), 0); -#elif defined(_XM_SSE_INTRINSICS_) - static const XMVECTORF32 ScaleByte4 = { { { 1.0f, 256.0f, 256.0f * 256.0f, 256.0f * 256.0f * 256.0f } } }; - static const XMVECTORI32 MaskByte4 = { { { 0xFF, 0xFF << 8, 0xFF << 16, static_cast(0xFF000000) } } }; - // Clamp to bounds - XMVECTOR vResult = _mm_max_ps(V, g_ByteMin); - vResult = _mm_min_ps(vResult, g_ByteMax); - // Scale by multiplication - vResult = _mm_mul_ps(vResult, ScaleByte4); - // Convert to int by rounding - __m128i vResulti = _mm_cvtps_epi32(vResult); - // Mask off any fraction - vResulti = _mm_and_si128(vResulti, MaskByte4); - // Do a horizontal or of 4 entries - __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); - // x = x|z, y = y|w - vResulti = _mm_or_si128(vResulti, vResulti2); - // Move Z to the x position - vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); - // i = x|y|z|w - vResulti = _mm_or_si128(vResulti, vResulti2); - _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreUNibble4 -( - XMUNIBBLE4* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 Max = { { { 15.0f, 15.0f, 15.0f, 15.0f } } }; -#if defined(_XM_NO_INTRINSICS_) - - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - ((static_cast(tmp.w) & 0xF) << 12) - | ((static_cast(tmp.z) & 0xF) << 8) - | ((static_cast(tmp.y) & 0xF) << 4) - | (static_cast(tmp.x) & 0xF)); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f, 16.f, 16.f * 16.f, 16.f * 16.f * 16.f } } }; - static const XMVECTORU32 Mask = { { { 0xF, 0xF << 4, 0xF << 8, 0xF << 12 } } }; - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); - vResult = vminq_f32(vResult, Max); - vResult = vmulq_f32(vResult, Scale); - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - vResulti = vandq_u32(vResulti, Mask); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vResulti); - uint32x2_t vhi = vget_high_u32(vResulti); - vTemp = vorr_u32(vTemp, vhi); - vTemp = vpadd_u32(vTemp, vTemp); - vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, Max); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - auto z = static_cast(_mm_extract_epi16(vInt, 4)); - auto w = static_cast(_mm_extract_epi16(vInt, 6)); - pDestination->v = static_cast( - ((static_cast(w) & 0xF) << 12) - | ((static_cast(z) & 0xF) << 8) - | ((static_cast(y) & 0xF) << 4) - | ((static_cast(x) & 0xF))); -#endif -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline void XM_CALLCONV XMStoreU555 -( - XMU555* pDestination, - FXMVECTOR V -) noexcept -{ - assert(pDestination); - static const XMVECTORF32 Max = { { { 31.0f, 31.0f, 31.0f, 1.0f } } }; - -#if defined(_XM_NO_INTRINSICS_) - XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); - N = XMVectorRound(N); - - XMFLOAT4A tmp; - XMStoreFloat4A(&tmp, N); - - pDestination->v = static_cast( - ((tmp.w > 0.f) ? 0x8000 : 0) - | ((static_cast(tmp.z) & 0x1F) << 10) - | ((static_cast(tmp.y) & 0x1F) << 5) - | (static_cast(tmp.x) & 0x1F)); -#elif defined(_XM_ARM_NEON_INTRINSICS_) - static const XMVECTORF32 Scale = { { { 1.0f, 32.f / 2.f, 32.f * 32.f, 32.f * 32.f * 32.f / 2.f } } }; - static const XMVECTORU32 Mask = { { { 0x1F, 0x1F << (5 - 1), 0x1F << 10, 0x1 << (15 - 1) } } }; - float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); - vResult = vminq_f32(vResult, Max); - vResult = vmulq_f32(vResult, Scale); - uint32x4_t vResulti = vcvtq_u32_f32(vResult); - vResulti = vandq_u32(vResulti, Mask); - // Do a horizontal or of 4 entries - uint32x2_t vTemp = vget_low_u32(vResulti); - uint32x2_t vTemp2 = vget_high_u32(vResulti); - vTemp = vorr_u32(vTemp, vTemp2); - // Perform a single bit left shift on y|w - vTemp2 = vdup_lane_u32(vTemp, 1); - vTemp2 = vadd_u32(vTemp2, vTemp2); - vTemp = vorr_u32(vTemp, vTemp2); - vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); -#elif defined(_XM_SSE_INTRINSICS_) - // Bounds check - XMVECTOR vResult = _mm_max_ps(V, g_XMZero); - vResult = _mm_min_ps(vResult, Max); - // Convert to int with rounding - __m128i vInt = _mm_cvtps_epi32(vResult); - // No SSE operations will write to 16-bit values, so we have to extract them manually - auto x = static_cast(_mm_extract_epi16(vInt, 0)); - auto y = static_cast(_mm_extract_epi16(vInt, 2)); - auto z = static_cast(_mm_extract_epi16(vInt, 4)); - auto w = static_cast(_mm_extract_epi16(vInt, 6)); - pDestination->v = static_cast( - (static_cast(w) ? 0x8000 : 0) - | ((static_cast(z) & 0x1F) << 10) - | ((static_cast(y) & 0x1F) << 5) - | ((static_cast(x) & 0x1F))); -#endif -} - - -/**************************************************************************** - * - * XMCOLOR operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMCOLOR::XMCOLOR -( - float _r, - float _g, - float _b, - float _a -) noexcept -{ - XMStoreColor(this, XMVectorSet(_r, _g, _b, _a)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMCOLOR::XMCOLOR(const float* pArray) noexcept -{ - XMStoreColor(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMHALF2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMHALF2::XMHALF2 -( - float _x, - float _y -) noexcept -{ - x = XMConvertFloatToHalf(_x); - y = XMConvertFloatToHalf(_y); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMHALF2::XMHALF2(const float* pArray) noexcept -{ - assert(pArray != nullptr); - x = XMConvertFloatToHalf(pArray[0]); - y = XMConvertFloatToHalf(pArray[1]); -} - -/**************************************************************************** - * - * XMSHORTN2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMSHORTN2::XMSHORTN2 -( - float _x, - float _y -) noexcept -{ - XMStoreShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMSHORTN2::XMSHORTN2(const float* pArray) noexcept -{ - XMStoreShortN2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMSHORT2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMSHORT2::XMSHORT2 -( - float _x, - float _y -) noexcept -{ - XMStoreShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMSHORT2::XMSHORT2(const float* pArray) noexcept -{ - XMStoreShort2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUSHORTN2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUSHORTN2::XMUSHORTN2 -( - float _x, - float _y -) noexcept -{ - XMStoreUShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUSHORTN2::XMUSHORTN2(const float* pArray) noexcept -{ - XMStoreUShortN2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUSHORT2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUSHORT2::XMUSHORT2 -( - float _x, - float _y -) noexcept -{ - XMStoreUShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUSHORT2::XMUSHORT2(const float* pArray) noexcept -{ - XMStoreUShort2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMBYTEN2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMBYTEN2::XMBYTEN2 -( - float _x, - float _y -) noexcept -{ - XMStoreByteN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMBYTEN2::XMBYTEN2(const float* pArray) noexcept -{ - XMStoreByteN2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMBYTE2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMBYTE2::XMBYTE2 -( - float _x, - float _y -) noexcept -{ - XMStoreByte2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMBYTE2::XMBYTE2(const float* pArray) noexcept -{ - XMStoreByte2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUBYTEN2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUBYTEN2::XMUBYTEN2 -( - float _x, - float _y -) noexcept -{ - XMStoreUByteN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUBYTEN2::XMUBYTEN2(const float* pArray) noexcept -{ - XMStoreUByteN2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUBYTE2 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUBYTE2::XMUBYTE2 -( - float _x, - float _y -) noexcept -{ - XMStoreUByte2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUBYTE2::XMUBYTE2(const float* pArray) noexcept -{ - XMStoreUByte2(this, XMLoadFloat2(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMU565 operators - * - ****************************************************************************/ - -inline XMU565::XMU565 -( - float _x, - float _y, - float _z -) noexcept -{ - XMStoreU565(this, XMVectorSet(_x, _y, _z, 0.0f)); -} - -_Use_decl_annotations_ -inline XMU565::XMU565(const float* pArray) noexcept -{ - XMStoreU565(this, XMLoadFloat3(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMFLOAT3PK operators - * - ****************************************************************************/ - -inline XMFLOAT3PK::XMFLOAT3PK -( - float _x, - float _y, - float _z -) noexcept -{ - XMStoreFloat3PK(this, XMVectorSet(_x, _y, _z, 0.0f)); -} - -_Use_decl_annotations_ -inline XMFLOAT3PK::XMFLOAT3PK(const float* pArray) noexcept -{ - XMStoreFloat3PK(this, XMLoadFloat3(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMFLOAT3SE operators - * - ****************************************************************************/ - -inline XMFLOAT3SE::XMFLOAT3SE -( - float _x, - float _y, - float _z -) noexcept -{ - XMStoreFloat3SE(this, XMVectorSet(_x, _y, _z, 0.0f)); -} - -_Use_decl_annotations_ -inline XMFLOAT3SE::XMFLOAT3SE(const float* pArray) noexcept -{ - XMStoreFloat3SE(this, XMLoadFloat3(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMHALF4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMHALF4::XMHALF4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - x = XMConvertFloatToHalf(_x); - y = XMConvertFloatToHalf(_y); - z = XMConvertFloatToHalf(_z); - w = XMConvertFloatToHalf(_w); -} - -//------------------------------------------------------------------------------ - -_Use_decl_annotations_ -inline XMHALF4::XMHALF4(const float* pArray) noexcept -{ - XMConvertFloatToHalfStream(&x, sizeof(HALF), pArray, sizeof(float), 4); -} - -/**************************************************************************** - * - * XMSHORTN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMSHORTN4::XMSHORTN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreShortN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMSHORTN4::XMSHORTN4(const float* pArray) noexcept -{ - XMStoreShortN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMSHORT4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMSHORT4::XMSHORT4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreShort4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMSHORT4::XMSHORT4(const float* pArray) noexcept -{ - XMStoreShort4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUSHORTN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUSHORTN4::XMUSHORTN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUShortN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUSHORTN4::XMUSHORTN4(const float* pArray) noexcept -{ - XMStoreUShortN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUSHORT4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUSHORT4::XMUSHORT4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUShort4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUSHORT4::XMUSHORT4(const float* pArray) noexcept -{ - XMStoreUShort4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMXDECN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMXDECN4::XMXDECN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreXDecN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMXDECN4::XMXDECN4(const float* pArray) noexcept -{ - XMStoreXDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMXDEC4 operators - * - ****************************************************************************/ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -// C4996: ignore deprecation warning -#endif - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -//------------------------------------------------------------------------------ - -inline XMXDEC4::XMXDEC4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreXDec4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMXDEC4::XMXDEC4(const float* pArray) noexcept -{ - XMStoreXDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMDECN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMDECN4::XMDECN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreDecN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMDECN4::XMDECN4(const float* pArray) noexcept -{ - XMStoreDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMDEC4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMDEC4::XMDEC4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreDec4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMDEC4::XMDEC4(const float* pArray) noexcept -{ - XMStoreDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -/**************************************************************************** - * - * XMUDECN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUDECN4::XMUDECN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUDecN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUDECN4::XMUDECN4(const float* pArray) noexcept -{ - XMStoreUDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUDEC4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUDEC4::XMUDEC4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUDec4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUDEC4::XMUDEC4(const float* pArray) noexcept -{ - XMStoreUDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMBYTEN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMBYTEN4::XMBYTEN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreByteN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMBYTEN4::XMBYTEN4(const float* pArray) noexcept -{ - XMStoreByteN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMBYTE4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMBYTE4::XMBYTE4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreByte4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMBYTE4::XMBYTE4(const float* pArray) noexcept -{ - XMStoreByte4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUBYTEN4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUBYTEN4::XMUBYTEN4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUByteN4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUBYTEN4::XMUBYTEN4(const float* pArray) noexcept -{ - XMStoreUByteN4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUBYTE4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUBYTE4::XMUBYTE4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUByte4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUBYTE4::XMUBYTE4(const float* pArray) noexcept -{ - XMStoreUByte4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMUNIBBLE4 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMUNIBBLE4::XMUNIBBLE4 -( - float _x, - float _y, - float _z, - float _w -) noexcept -{ - XMStoreUNibble4(this, XMVectorSet(_x, _y, _z, _w)); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMUNIBBLE4::XMUNIBBLE4(const float* pArray) noexcept -{ - XMStoreUNibble4(this, XMLoadFloat4(reinterpret_cast(pArray))); -} - -/**************************************************************************** - * - * XMU555 operators - * - ****************************************************************************/ - -//------------------------------------------------------------------------------ - -inline XMU555::XMU555 -( - float _x, - float _y, - float _z, - bool _w -) noexcept -{ - XMStoreU555(this, XMVectorSet(_x, _y, _z, ((_w) ? 1.0f : 0.0f))); -} - -//------------------------------------------------------------------------------ -_Use_decl_annotations_ -inline XMU555::XMU555 -( - const float* pArray, - bool _w -) noexcept -{ - XMVECTOR V = XMLoadFloat3(reinterpret_cast(pArray)); - XMStoreU555(this, XMVectorSetW(V, ((_w) ? 1.0f : 0.0f))); -} - +//------------------------------------------------------------------------------------- +// DirectXPackedVector.inl -- SIMD C++ Math library +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkID=615560 +//------------------------------------------------------------------------------------- + +#pragma once + +/**************************************************************************** + * + * Data conversion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline float XMConvertHalfToFloat(HALF Value) noexcept +{ +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V1 = _mm_cvtsi32_si128(static_cast(Value)); + __m128 V2 = _mm_cvtph_ps(V1); + return _mm_cvtss_f32(V2); +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + uint16x4_t vHalf = vdup_n_u16(Value); + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + return vgetq_lane_f32(vFloat, 0); +#else + auto Mantissa = static_cast(Value & 0x03FF); + + uint32_t Exponent = (Value & 0x7C00); + if (Exponent == 0x7C00) // INF/NAN + { + Exponent = 0x8f; + } + else if (Exponent != 0) // The value is normalized + { + Exponent = static_cast((static_cast(Value) >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } + while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + uint32_t Result = + ((static_cast(Value) & 0x8000) << 16) // Sign + | ((Exponent + 112) << 23) // Exponent + | (Mantissa << 13); // Mantissa + + return reinterpret_cast(&Result)[0]; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable : 26015 26019, "PREfast noise: Esp:1307" ) +#endif + +_Use_decl_annotations_ +inline float* XMConvertHalfToFloatStream +( + float* pOutputStream, + size_t OutputStride, + const HALF* pInputStream, + size_t InputStride, + size_t HalfCount +) noexcept +{ + assert(pOutputStream); + assert(pInputStream); + + assert(InputStride >= sizeof(HALF)); + _Analysis_assume_(InputStride >= sizeof(HALF)); + + assert(OutputStride >= sizeof(float)); + _Analysis_assume_(OutputStride >= sizeof(float)); + +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + auto pHalf = reinterpret_cast(pInputStream); + auto pFloat = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = HalfCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(HALF)) + { + if (OutputStride == sizeof(float)) + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Packed input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + __m128 FV = _mm_cvtph_ps(HV); + + XM_STREAM_PS(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + __m128 FV = _mm_cvtph_ps(HV); + + _mm_storeu_ps(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128i HV = _mm_loadl_epi64(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + __m128 FV = _mm_cvtph_ps(HV); + + _mm_store_ss(reinterpret_cast(pFloat), FV); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 1); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 2); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 3); + pFloat += OutputStride; + i += 4; + } + } + } + else if (OutputStride == sizeof(float)) + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Scattered input, aligned & packed output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + __m128i HV = _mm_setzero_si128(); + HV = _mm_insert_epi16(HV, H1, 0); + HV = _mm_insert_epi16(HV, H2, 1); + HV = _mm_insert_epi16(HV, H3, 2); + HV = _mm_insert_epi16(HV, H4, 3); + __m128 FV = _mm_cvtph_ps(HV); + + XM_STREAM_PS(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + __m128i HV = _mm_setzero_si128(); + HV = _mm_insert_epi16(HV, H1, 0); + HV = _mm_insert_epi16(HV, H2, 1); + HV = _mm_insert_epi16(HV, H3, 2); + HV = _mm_insert_epi16(HV, H4, 3); + __m128 FV = _mm_cvtph_ps(HV); + + _mm_storeu_ps(reinterpret_cast(pFloat), FV); + pFloat += OutputStride * 4; + i += 4; + } + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + __m128i HV = _mm_setzero_si128(); + HV = _mm_insert_epi16(HV, H1, 0); + HV = _mm_insert_epi16(HV, H2, 1); + HV = _mm_insert_epi16(HV, H3, 2); + HV = _mm_insert_epi16(HV, H4, 3); + __m128 FV = _mm_cvtph_ps(HV); + + _mm_store_ss(reinterpret_cast(pFloat), FV); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 1); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 2); + pFloat += OutputStride; + *reinterpret_cast(pFloat) = _mm_extract_ps(FV, 3); + pFloat += OutputStride; + i += 4; + } + } + } + + for (; i < HalfCount; ++i) + { + *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); + pHalf += InputStride; + pFloat += OutputStride; + } + + XM_SFENCE(); + + return pOutputStream; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) ||__aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + auto pHalf = reinterpret_cast(pInputStream); + auto pFloat = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = HalfCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(HALF)) + { + if (OutputStride == sizeof(float)) + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + uint16x4_t vHalf = vld1_u16(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_f32(reinterpret_cast(pFloat), vFloat); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + uint16x4_t vHalf = vld1_u16(reinterpret_cast(pHalf)); + pHalf += InputStride * 4; + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += OutputStride; + i += 4; + } + } + } + else if (OutputStride == sizeof(float)) + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + uint64_t iHalf = uint64_t(H1) | (uint64_t(H2) << 16) | (uint64_t(H3) << 32) | (uint64_t(H4) << 48); + uint16x4_t vHalf = vcreate_u16(iHalf); + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_f32(reinterpret_cast(pFloat), vFloat); + pFloat += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + uint16_t H1 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H2 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H3 = *reinterpret_cast(pHalf); + pHalf += InputStride; + uint16_t H4 = *reinterpret_cast(pHalf); + pHalf += InputStride; + + uint64_t iHalf = uint64_t(H1) | (uint64_t(H2) << 16) | (uint64_t(H3) << 32) | (uint64_t(H4) << 48); + uint16x4_t vHalf = vcreate_u16(iHalf); + + float32x4_t vFloat = vcvt_f32_f16(vreinterpret_f16_u16(vHalf)); + + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += OutputStride; + vst1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += OutputStride; + i += 4; + } + } + } + + for (; i < HalfCount; ++i) + { + *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); + pHalf += InputStride; + pFloat += OutputStride; + } + + return pOutputStream; +#else + auto pHalf = reinterpret_cast(pInputStream); + auto pFloat = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < HalfCount; i++) + { + *reinterpret_cast(pFloat) = XMConvertHalfToFloat(reinterpret_cast(pHalf)[0]); + pHalf += InputStride; + pFloat += OutputStride; + } + + return pOutputStream; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +inline HALF XMConvertFloatToHalf(float Value) noexcept +{ +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128 V1 = _mm_set_ss(Value); + __m128i V2 = _mm_cvtps_ph(V1, _MM_FROUND_TO_NEAREST_INT); + return static_cast(_mm_extract_epi16(V2, 0)); +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + float32x4_t vFloat = vdupq_n_f32(Value); + float16x4_t vHalf = vcvt_f16_f32(vFloat); + return vget_lane_u16(vreinterpret_u16_f16(vHalf), 0); +#else + uint32_t Result; + + auto IValue = reinterpret_cast(&Value)[0]; + uint32_t Sign = (IValue & 0x80000000U) >> 16U; + IValue = IValue & 0x7FFFFFFFU; // Hack off the sign + if (IValue >= 0x47800000 /*e+16*/) + { + // The number is too large to be represented as a half. Return infinity or NaN + Result = 0x7C00U | ((IValue > 0x7F800000) ? (0x200 | ((IValue >> 13U) & 0x3FFU)) : 0U); + } + else if (IValue <= 0x33000000U /*e-25*/) + { + Result = 0; + } + else if (IValue < 0x38800000U /*e-14*/) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + uint32_t Shift = 125U - (IValue >> 23U); + IValue = 0x800000U | (IValue & 0x7FFFFFU); + Result = IValue >> (Shift + 1); + uint32_t s = (IValue & ((1U << Shift) - 1)) != 0; + Result += (Result | s) & ((IValue >> Shift) & 1U); + } + else + { + // Rebias the exponent to represent the value as a normalized half. + IValue += 0xC8000000U; + Result = ((IValue + 0x0FFFU + ((IValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; + } + return static_cast(Result | Sign); +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline HALF* XMConvertFloatToHalfStream +( + HALF* pOutputStream, + size_t OutputStride, + const float* pInputStream, + size_t InputStride, + size_t FloatCount +) noexcept +{ + assert(pOutputStream); + assert(pInputStream); + + assert(InputStride >= sizeof(float)); + _Analysis_assume_(InputStride >= sizeof(float)); + + assert(OutputStride >= sizeof(HALF)); + _Analysis_assume_(OutputStride >= sizeof(HALF)); + +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + auto pFloat = reinterpret_cast(pInputStream); + auto pHalf = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = FloatCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(float)) + { + if (OutputStride == sizeof(HALF)) + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Aligned and packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_load_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_loadu_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); + pHalf += OutputStride * 4; + i += 4; + } + } + } + else + { + if ((reinterpret_cast(pFloat) & 0xF) == 0) + { + // Aligned & packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_load_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); + pHalf += OutputStride; + i += 4; + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128 FV = _mm_loadu_ps(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); + pHalf += OutputStride; + i += 4; + } + } + } + } + else if (OutputStride == sizeof(HALF)) + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + __m128 FV1 = _mm_load_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV2 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV3 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV4 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV = _mm_blend_ps(FV1, FV2, 0x2); + __m128 FT = _mm_blend_ps(FV3, FV4, 0x8); + FV = _mm_blend_ps(FV, FT, 0xC); + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + _mm_storel_epi64(reinterpret_cast<__m128i*>(pHalf), HV); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + __m128 FV1 = _mm_load_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV2 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV3 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV4 = _mm_broadcast_ss(reinterpret_cast(pFloat)); + pFloat += InputStride; + + __m128 FV = _mm_blend_ps(FV1, FV2, 0x2); + __m128 FT = _mm_blend_ps(FV3, FV4, 0x8); + FV = _mm_blend_ps(FV, FT, 0xC); + + __m128i HV = _mm_cvtps_ph(FV, _MM_FROUND_TO_NEAREST_INT); + + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 0)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 1)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 2)); + pHalf += OutputStride; + *reinterpret_cast(pHalf) = static_cast(_mm_extract_epi16(HV, 3)); + pHalf += OutputStride; + i += 4; + } + } + } + + for (; i < FloatCount; ++i) + { + *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); + pFloat += InputStride; + pHalf += OutputStride; + } + + return pOutputStream; +#elif defined(_XM_ARM_NEON_INTRINSICS_) && (defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __aarch64__) && !defined(_XM_NO_INTRINSICS_) && (!defined(__GNUC__) || (__ARM_FP & 2)) + auto pFloat = reinterpret_cast(pInputStream); + auto pHalf = reinterpret_cast(pOutputStream); + + size_t i = 0; + size_t four = FloatCount >> 2; + if (four > 0) + { + if (InputStride == sizeof(float)) + { + if (OutputStride == sizeof(HALF)) + { + // Packed input, packed output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vld1q_f32(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_u16(reinterpret_cast(pHalf), vHalf); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Packed input, scattered output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vld1q_f32(reinterpret_cast(pFloat)); + pFloat += InputStride * 4; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 0); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 1); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 2); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 3); + pHalf += OutputStride; + i += 4; + } + } + } + else if (OutputStride == sizeof(HALF)) + { + // Scattered input, packed output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vdupq_n_f32(0); + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += InputStride; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_u16(reinterpret_cast(pHalf), vHalf); + pHalf += OutputStride * 4; + i += 4; + } + } + else + { + // Scattered input, scattered output + for (size_t j = 0; j < four; ++j) + { + float32x4_t vFloat = vdupq_n_f32(0); + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 0); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 1); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 2); + pFloat += InputStride; + + vFloat = vld1q_lane_f32(reinterpret_cast(pFloat), vFloat, 3); + pFloat += InputStride; + + uint16x4_t vHalf = vreinterpret_u16_f16(vcvt_f16_f32(vFloat)); + + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 0); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 1); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 2); + pHalf += OutputStride; + vst1_lane_u16(reinterpret_cast(pHalf), vHalf, 3); + pHalf += OutputStride; + i += 4; + } + } + } + + for (; i < FloatCount; ++i) + { + *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); + pFloat += InputStride; + pHalf += OutputStride; + } + + return pOutputStream; +#else + auto pFloat = reinterpret_cast(pInputStream); + auto pHalf = reinterpret_cast(pOutputStream); + + for (size_t i = 0; i < FloatCount; i++) + { + *reinterpret_cast(pHalf) = XMConvertFloatToHalf(reinterpret_cast(pFloat)[0]); + pFloat += InputStride; + pHalf += OutputStride; + } + return pOutputStream; +#endif // !_XM_F16C_INTRINSICS_ +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * Vector and matrix load operations + * + ****************************************************************************/ + +#ifdef _PREFAST_ +#pragma prefast(push) +#pragma prefast(disable:28931, "PREfast noise: Esp:1266") +#endif + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadColor(const XMCOLOR* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + // int32_t -> Float conversions are done in one instruction. + // uint32_t -> Float calls a runtime function. Keep in int32_t + auto iColor = static_cast(pSource->c); + XMVECTORF32 vColor = { { { + static_cast((iColor >> 16) & 0xFF)* (1.0f / 255.0f), + static_cast((iColor >> 8) & 0xFF)* (1.0f / 255.0f), + static_cast(iColor & 0xFF)* (1.0f / 255.0f), + static_cast((iColor >> 24) & 0xFF)* (1.0f / 255.0f) + } } }; + return vColor.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32_t bgra = pSource->c; + uint32_t rgba = (bgra & 0xFF00FF00) | ((bgra >> 16) & 0xFF) | ((bgra << 16) & 0xFF0000); + uint32x2_t vInt8 = vdup_n_u32(rgba); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_n_f32(R, 1.0f / 255.0f); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + __m128i vInt = _mm_set1_epi32(static_cast(pSource->c)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vInt = _mm_and_si128(vInt, g_XMMaskA8R8G8B8); + // a is unsigned! Flip the bit to convert the order to signed + vInt = _mm_xor_si128(vInt, g_XMFlipA8R8G8B8); + // Convert to floating point numbers + XMVECTOR vTemp = _mm_cvtepi32_ps(vInt); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixAA8R8G8B8); + // Convert 0-255 to 0.0f-1.0f + return _mm_mul_ps(vTemp, g_XMNormalizeA8R8G8B8); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadHalf2(const XMHALF2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128 V = _mm_load_ss(reinterpret_cast(pSource)); + return _mm_cvtph_ps(_mm_castps_si128(V)); +#else + XMVECTORF32 vResult = { { { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + 0.0f, + 0.0f + } } }; + return vResult.v; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShortN2(const XMSHORTN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -32768) ? -1.f : (static_cast(pSource->x)* (1.0f / 32767.0f)), + (pSource->y == -32768) ? -1.f : (static_cast(pSource->y)* (1.0f / 32767.0f)), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + int32x4_t vInt = vmovl_s16(vreinterpret_s16_u32(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_s32(vInt); + R = vmulq_n_f32(R, 1.0f / 32767.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16); + // Convert -1.0f - 1.0f + vTemp = _mm_mul_ps(vTemp, g_XMNormalizeX16Y16); + // Clamp result (for case of -32768) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShort2(const XMSHORT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.f, + 0.f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + int32x4_t vInt = vmovl_s16(vreinterpret_s16_u32(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + return vcvtq_f32_s32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16); + // Y is 65536 too large + return _mm_mul_ps(vTemp, g_XMFixupY16); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShortN2(const XMUSHORTN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x) / 65535.0f, + static_cast(pSource->y) / 65535.0f, + 0.f, + 0.f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vreinterpret_u16_u32(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_u32(vInt); + R = vmulq_n_f32(R, 1.0f / 65535.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixupY16 = { { { 1.0f / 65535.0f, 1.0f / (65535.0f * 65536.0f), 0.0f, 0.0f } } }; + static const XMVECTORF32 FixaddY16 = { { { 0, 32768.0f * 65536.0f, 0, 0 } } }; + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp, g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, FixaddY16); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp, FixupY16); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShort2(const XMUSHORT2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.f, + 0.f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt16 = vld1_dup_u32(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vreinterpret_u16_u32(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + return vcvtq_f32_u32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixaddY16 = { { { 0, 32768.0f, 0, 0 } } }; + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp, g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp, g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp, g_XMFixupY16); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp, FixaddY16); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByteN2(const XMBYTEN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -128) ? -1.f : (static_cast(pSource->x)* (1.0f / 127.0f)), + (pSource->y == -128) ? -1.f : (static_cast(pSource->y)* (1.0f / 127.0f)), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u16(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_s32(vInt); + R = vmulq_n_f32(R, 1.0f / 127.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f / 127.0f, 1.0f / (127.0f * 256.0f), 0, 0 } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, Scale); + // Clamp result (for case of -128) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByte2(const XMBYTE2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u16(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + vInt = vandq_s32(vInt, g_XMMaskXY); + return vcvtq_f32_s32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + return _mm_mul_ps(vTemp, Scale); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByteN2(const XMUBYTEN2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x)* (1.0f / 255.0f), + static_cast(pSource->y)* (1.0f / 255.0f), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u16(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_n_f32(R, 1.0f / 255.0f); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f / 255.0f, 1.0f / (255.0f * 256.0f), 0, 0 } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + return _mm_mul_ps(vTemp, Scale); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByte2(const XMUBYTE2* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + 0.0f, + 0.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt8 = vld1_dup_u16(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u16(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + vInt = vandq_u32(vInt, g_XMMaskXY); + return vcvtq_f32_u32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 1.0f / 256.0f, 0, 0 } } }; + static const XMVECTORU32 Mask = { { { 0xFF, 0xFF00, 0, 0 } } }; + // Splat the color in all four entries (x,z,y,w) + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vTemp = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask + vTemp = _mm_and_ps(vTemp, Mask); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + return _mm_mul_ps(vTemp, Scale); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadU565(const XMU565* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + float(pSource->v & 0x1F), + float((pSource->v >> 5) & 0x3F), + float((pSource->v >> 11) & 0x1F), + 0.f, + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORI32 U565And = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; + static const XMVECTORF32 U565Mul = { { { 1.0f, 1.0f / 32.0f, 1.0f / 2048.f, 0 } } }; + uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vInt16); + vInt = vandq_u32(vInt, U565And); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, U565Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORI32 U565And = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; + static const XMVECTORF32 U565Mul = { { { 1.0f, 1.0f / 32.0f, 1.0f / 2048.f, 0 } } }; + // Get the 16 bit value and splat it + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult, U565And); + // Convert to float + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult, U565Mul); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3PK(const XMFLOAT3PK* pSource) noexcept +{ + assert(pSource); + + XM_ALIGNED_DATA(16) uint32_t Result[4]; + uint32_t Mantissa; + uint32_t Exponent; + + // X Channel (6-bit mantissa) + Mantissa = pSource->xm; + + if (pSource->xe == 0x1f) // INF or NAN + { + Result[0] = static_cast(0x7f800000 | (static_cast(pSource->xm) << 17)); + } + else + { + if (pSource->xe != 0) // The value is normalized + { + Exponent = pSource->xe; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } + while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result[0] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Y Channel (6-bit mantissa) + Mantissa = pSource->ym; + + if (pSource->ye == 0x1f) // INF or NAN + { + Result[1] = static_cast(0x7f800000 | (static_cast(pSource->ym) << 17)); + } + else + { + if (pSource->ye != 0) // The value is normalized + { + Exponent = pSource->ye; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } + while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result[1] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Z Channel (5-bit mantissa) + Mantissa = pSource->zm; + + if (pSource->ze == 0x1f) // INF or NAN + { + Result[2] = static_cast(0x7f800000 | (static_cast(pSource->zm) << 17)); + } + else + { + if (pSource->ze != 0) // The value is normalized + { + Exponent = pSource->ze; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } + while ((Mantissa & 0x20) == 0); + + Mantissa &= 0x1F; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18); + } + + return XMLoadFloat3A(reinterpret_cast(&Result)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadFloat3SE(const XMFLOAT3SE* pSource) noexcept +{ + assert(pSource); + + union { float f; int32_t i; } fi; + fi.i = 0x33800000 + (pSource->e << 23); + float Scale = fi.f; + + XMVECTORF32 v = { { { + Scale * float(pSource->xm), + Scale * float(pSource->ym), + Scale * float(pSource->zm), + 1.0f } } }; + return v; +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadHalf4(const XMHALF4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V = _mm_loadl_epi64(reinterpret_cast(pSource)); + return _mm_cvtph_ps(V); +#else + XMVECTORF32 vResult = { { { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + XMConvertHalfToFloat(pSource->z), + XMConvertHalfToFloat(pSource->w) + } } }; + return vResult.v; +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShortN4(const XMSHORTN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -32768) ? -1.f : (static_cast(pSource->x)* (1.0f / 32767.0f)), + (pSource->y == -32768) ? -1.f : (static_cast(pSource->y)* (1.0f / 32767.0f)), + (pSource->z == -32768) ? -1.f : (static_cast(pSource->z)* (1.0f / 32767.0f)), + (pSource->w == -32768) ? -1.f : (static_cast(pSource->w)* (1.0f / 32767.0f)) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int16x4_t vInt = vld1_s16(reinterpret_cast(pSource)); + int32x4_t V = vmovl_s16(vInt); + float32x4_t vResult = vcvtq_f32_s32(V); + vResult = vmulq_n_f32(vResult, 1.0f / 32767.0f); + return vmaxq_f32(vResult, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16Z16W16); + // Convert to -1.0f - 1.0f + vTemp = _mm_mul_ps(vTemp, g_XMNormalizeX16Y16Z16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + vTemp = XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); + // Clamp result (for case of -32768) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadShort4(const XMSHORT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + int16x4_t vInt = vld1_s16(reinterpret_cast(pSource)); + int32x4_t V = vmovl_s16(vInt); + return vcvtq_f32_s32(V); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMFixX16Y16Z16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp, g_XMFixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShortN4(const XMUSHORTN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x) / 65535.0f, + static_cast(pSource->y) / 65535.0f, + static_cast(pSource->z) / 65535.0f, + static_cast(pSource->w) / 65535.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt = vld1_u16(reinterpret_cast(pSource)); + uint32x4_t V = vmovl_u16(vInt); + float32x4_t vResult = vcvtq_f32_u32(V); + return vmulq_n_f32(vResult, 1.0f / 65535.0f); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixupY16W16 = { { { 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / (65535.0f * 65536.0f), 1.0f / (65535.0f * 65536.0f) } } }; + static const XMVECTORF32 FixaddY16W16 = { { { 0, 0, 32768.0f * 65536.0f, 32768.0f * 65536.0f } } }; + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, FixaddY16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp, FixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUShort4(const XMUSHORT4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint16x4_t vInt = vld1_u16(reinterpret_cast(pSource)); + uint32x4_t V = vmovl_u16(vInt); + return vcvtq_f32_u32(V); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixaddY16W16 = { { { 0, 0, 32768.0f, 32768.0f } } }; + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(_mm_castpd_ps(vIntd), g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp, g_XMFixupY16W16); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp, FixaddY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return XM_PERMUTE_PS(vTemp, _MM_SHUFFLE(3, 1, 2, 0)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadXDecN4(const XMXDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + (ElementX == 0x200) ? -1.f : (static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])) / 511.0f), + (ElementY == 0x200) ? -1.f : (static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])) / 511.0f), + (ElementZ == 0x200) ? -1.f : (static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])) / 511.0f), + static_cast(pSource->v >> 30) / 3.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskA2B10G10R10); + vInt = veorq_u32(vInt, g_XMFlipA2B10G10R10); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, g_XMFixAA2B10G10R10); + R = vmulq_f32(R, g_XMNormalizeA2B10G10R10); + return vmaxq_f32(R, vdupq_n_f32(-1.0f)); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskA2B10G10R10); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipA2B10G10R10); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMFixAA2B10G10R10); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMNormalizeA2B10G10R10); + // Clamp result (for case of -512) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadXDec4(const XMXDEC4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])), + static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])), + static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])), + static_cast(pSource->v >> 30) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORU32 XDec4Xor = { { { 0x200, 0x200 << 10, 0x200 << 20, 0x80000000 } } }; + static const XMVECTORF32 XDec4Add = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 32768 * 65536.0f } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + vInt = veorq_u32(vInt, XDec4Xor); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, XDec4Add); + return vmulq_f32(R, g_XMMulDec4); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORU32 XDec4Xor = { { { 0x200, 0x200 << 10, 0x200 << 20, 0x80000000 } } }; + static const XMVECTORF32 XDec4Add = { { { -512.0f, -512.0f * 1024.0f, -512.0f * 1024.0f * 1024.0f, 32768 * 65536.0f } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, XDec4Xor); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, XDec4Add); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); + return vTemp; +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUDecN4(const XMUDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(ElementX) / 1023.0f, + static_cast(ElementY) / 1023.0f, + static_cast(ElementZ) / 1023.0f, + static_cast(pSource->v >> 30) / 3.0f + } } }; + return vResult.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 UDecN4Mul = { { { 1.0f / 1023.0f, 1.0f / (1023.0f * 1024.0f), 1.0f / (1023.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, UDecN4Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 UDecN4Mul = { { { 1.0f / 1023.0f, 1.0f / (1023.0f * 1024.0f), 1.0f / (1023.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, UDecN4Mul); + return vTemp; +#endif +} + + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(const XMUDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + + int32_t ElementX = pSource->v & 0x3FF; + int32_t ElementY = (pSource->v >> 10) & 0x3FF; + int32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(ElementX - 0x180) / 510.0f, + static_cast(ElementY - 0x180) / 510.0f, + static_cast(ElementZ - 0x180) / 510.0f, + static_cast(pSource->v >> 30) / 3.0f + } } }; + + return vResult.v; + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 XRMul = { { { 1.0f / 510.0f, 1.0f / (510.0f * 1024.0f), 1.0f / (510.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + static const XMVECTORI32 XRBias = { { { 0x180, 0x180 * 1024, 0x180 * 1024 * 1024, 0 } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + int32x4_t vTemp = vsubq_s32(vreinterpretq_s32_u32(vInt), XRBias); + vTemp = veorq_s32(vTemp, g_XMFlipW); + float32x4_t R = vcvtq_f32_s32(vTemp); + R = vaddq_f32(R, g_XMAddUDec4); + return vmulq_f32(R, XRMul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 XRMul = { { { 1.0f / 510.0f, 1.0f / (510.0f * 1024.0f), 1.0f / (510.0f * 1024.0f * 1024.0f), 1.0f / (3.0f * 1024.0f * 1024.0f * 1024.0f) } } }; + static const XMVECTORI32 XRBias = { { { 0x180, 0x180 * 1024, 0x180 * 1024 * 1024, 0 } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask channels + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // Subtract bias + vTemp = _mm_castsi128_ps(_mm_sub_epi32(_mm_castps_si128(vTemp), XRBias)); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Convert to 0.0f-1.0f + return _mm_mul_ps(vTemp, XRMul); +#endif +} + + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUDec4(const XMUDEC4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + + XMVECTORF32 vResult = { { { + static_cast(ElementX), + static_cast(ElementY), + static_cast(ElementZ), + static_cast(pSource->v >> 30) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, g_XMMulDec4); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadDecN4(const XMDECN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + static const uint32_t SignExtendW[] = { 0x00000000, 0xFFFFFFFC }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + uint32_t ElementW = pSource->v >> 30; + + XMVECTORF32 vResult = { { { + (ElementX == 0x200) ? -1.f : (static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])) / 511.0f), + (ElementY == 0x200) ? -1.f : (static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])) / 511.0f), + (ElementZ == 0x200) ? -1.f : (static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])) / 511.0f), + (ElementW == 0x2) ? -1.f : static_cast(static_cast(ElementW | SignExtendW[(ElementW >> 1) & 1])) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 DecN4Mul = { { { 1.0f / 511.0f, 1.0f / (511.0f * 1024.0f), 1.0f / (511.0f * 1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + vInt = veorq_u32(vInt, g_XMXorDec4); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, g_XMAddDec4); + R = vmulq_f32(R, DecN4Mul); + return vmaxq_f32(R, vdupq_n_f32(-1.0f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 DecN4Mul = { { { 1.0f / 511.0f, 1.0f / (511.0f * 1024.0f), 1.0f / (511.0f * 1024.0f * 1024.0f), 1.0f / (1024.0f * 1024.0f * 1024.0f) } } }; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, DecN4Mul); + // Clamp result (for case of -512/-1) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadDec4(const XMDEC4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + static const uint32_t SignExtend[] = { 0x00000000, 0xFFFFFC00 }; + static const uint32_t SignExtendW[] = { 0x00000000, 0xFFFFFFFC }; + + uint32_t ElementX = pSource->v & 0x3FF; + uint32_t ElementY = (pSource->v >> 10) & 0x3FF; + uint32_t ElementZ = (pSource->v >> 20) & 0x3FF; + uint32_t ElementW = pSource->v >> 30; + + XMVECTORF32 vResult = { { { + static_cast(static_cast(ElementX | SignExtend[ElementX >> 9])), + static_cast(static_cast(ElementY | SignExtend[ElementY >> 9])), + static_cast(static_cast(ElementZ | SignExtend[ElementZ >> 9])), + static_cast(static_cast(ElementW | SignExtendW[ElementW >> 1])) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x4_t vInt = vld1q_dup_u32(reinterpret_cast(pSource)); + vInt = vandq_u32(vInt, g_XMMaskDec4); + vInt = veorq_u32(vInt, g_XMXorDec4); + float32x4_t R = vcvtq_f32_s32(vreinterpretq_s32_u32(vInt)); + R = vaddq_f32(R, g_XMAddDec4); + return vmulq_f32(R, g_XMMulDec4); +#elif defined(_XM_SSE_INTRINSICS_) + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp, g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp, g_XMMulDec4); + return vTemp; +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByteN4(const XMUBYTEN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x) / 255.0f, + static_cast(pSource->y) / 255.0f, + static_cast(pSource->z) / 255.0f, + static_cast(pSource->w) / 255.0f + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_n_f32(R, 1.0f / 255.0f); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByteN4Mul = { { { 1.0f / 255.0f, 1.0f / (255.0f * 256.0f), 1.0f / (255.0f * 65536.0f), 1.0f / (255.0f * 65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadUByteN4Mul); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUByte4(const XMUBYTE4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + uint16x8_t vInt16 = vmovl_u8(vreinterpret_u8_u32(vInt8)); + uint32x4_t vInt = vmovl_u16(vget_low_u16(vInt16)); + return vcvtq_f32_u32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByte4Mul = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp, g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadUByte4Mul); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByteN4(const XMBYTEN4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + (pSource->x == -128) ? -1.f : (static_cast(pSource->x) / 127.0f), + (pSource->y == -128) ? -1.f : (static_cast(pSource->y) / 127.0f), + (pSource->z == -128) ? -1.f : (static_cast(pSource->z) / 127.0f), + (pSource->w == -128) ? -1.f : (static_cast(pSource->w) / 127.0f) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u32(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + float32x4_t R = vcvtq_f32_s32(vInt); + R = vmulq_n_f32(R, 1.0f / 127.0f); + return vmaxq_f32(R, vdupq_n_f32(-1.f)); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByteN4Mul = { { { 1.0f / 127.0f, 1.0f / (127.0f * 256.0f), 1.0f / (127.0f * 65536.0f), 1.0f / (127.0f * 65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadByteN4Mul); + // Clamp result (for case of -128) + return _mm_max_ps(vTemp, g_XMNegativeOne); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadByte4(const XMBYTE4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + static_cast(pSource->x), + static_cast(pSource->y), + static_cast(pSource->z), + static_cast(pSource->w) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + uint32x2_t vInt8 = vld1_dup_u32(reinterpret_cast(pSource)); + int16x8_t vInt16 = vmovl_s8(vreinterpret_s8_u32(vInt8)); + int32x4_t vInt = vmovl_s16(vget_low_s16(vInt16)); + return vcvtq_f32_s32(vInt); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByte4Mul = { { { 1.0f, 1.0f / 256.0f, 1.0f / 65536.0f, 1.0f / (65536.0f * 256.0f) } } }; + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp, g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp, g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(_mm_castps_si128(vTemp)); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp, g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp, LoadByte4Mul); + return vTemp; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadUNibble4(const XMUNIBBLE4* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + float(pSource->v & 0xF), + float((pSource->v >> 4) & 0xF), + float((pSource->v >> 8) & 0xF), + float((pSource->v >> 12) & 0xF) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORI32 UNibble4And = { { { 0xF, 0xF0, 0xF00, 0xF000 } } }; + static const XMVECTORF32 UNibble4Mul = { { { 1.0f, 1.0f / 16.f, 1.0f / 256.f, 1.0f / 4096.f } } }; + uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vInt16); + vInt = vandq_u32(vInt, UNibble4And); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, UNibble4Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORI32 UNibble4And = { { { 0xF, 0xF0, 0xF00, 0xF000 } } }; + static const XMVECTORF32 UNibble4Mul = { { { 1.0f, 1.0f / 16.f, 1.0f / 256.f, 1.0f / 4096.f } } }; + // Get the 16 bit value and splat it + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult, UNibble4And); + // Convert to float + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult, UNibble4Mul); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMVECTOR XM_CALLCONV XMLoadU555(const XMU555* pSource) noexcept +{ + assert(pSource); +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = { { { + float(pSource->v & 0x1F), + float((pSource->v >> 5) & 0x1F), + float((pSource->v >> 10) & 0x1F), + float((pSource->v >> 15) & 0x1) + } } }; + return vResult.v; +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORI32 U555And = { { { 0x1F, 0x1F << 5, 0x1F << 10, 0x8000 } } }; + static const XMVECTORF32 U555Mul = { { { 1.0f, 1.0f / 32.f, 1.0f / 1024.f, 1.0f / 32768.f } } }; + uint16x4_t vInt16 = vld1_dup_u16(reinterpret_cast(pSource)); + uint32x4_t vInt = vmovl_u16(vInt16); + vInt = vandq_u32(vInt, U555And); + float32x4_t R = vcvtq_f32_u32(vInt); + return vmulq_f32(R, U555Mul); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORI32 U555And = { { { 0x1F, 0x1F << 5, 0x1F << 10, 0x8000 } } }; + static const XMVECTORF32 U555Mul = { { { 1.0f, 1.0f / 32.f, 1.0f / 1024.f, 1.0f / 32768.f } } }; + // Get the 16bit value and splat it + __m128i vInt = XM_LOADU_SI16(&pSource->v); + XMVECTOR vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vInt), _MM_SHUFFLE(0, 0, 0, 0)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult, U555And); + // Convert to float + vResult = _mm_cvtepi32_ps(_mm_castps_si128(vResult)); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult, U555Mul); + return vResult; +#endif +} + +#ifdef _PREFAST_ +#pragma prefast(pop) +#endif + +/**************************************************************************** + * + * Vector and matrix store operations + * + ****************************************************************************/ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreColor +( + XMCOLOR* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiply(N, g_UByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->c = (static_cast(tmp.w) << 24) | + (static_cast(tmp.x) << 16) | + (static_cast(tmp.y) << 8) | + static_cast(tmp.z); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 255.0f); + R = XMVectorRound(R); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + uint32_t rgba = vget_lane_u32(vreinterpret_u32_u8(vInt8), 0); + pDestination->c = (rgba & 0xFF00FF00) | ((rgba >> 16) & 0xFF) | ((rgba << 16) & 0xFF0000); +#elif defined(_XM_SSE_INTRINSICS_) + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + // Set>1 to 1 + vResult = _mm_min_ps(vResult, g_XMOne); + // Convert to 0-255 + vResult = _mm_mul_ps(vResult, g_UByteMax); + // Shuffle RGBA to ARGB + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(3, 0, 1, 2)); + // Convert to int + __m128i vInt = _mm_cvtps_epi32(vResult); + // Mash to shorts + vInt = _mm_packs_epi32(vInt, vInt); + // Mash to bytes + vInt = _mm_packus_epi16(vInt, vInt); + // Store the color + _mm_store_ss(reinterpret_cast(&pDestination->c), _mm_castsi128_ps(vInt)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreHalf2 +( + XMHALF2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V1 = _mm_cvtps_ph(V, _MM_FROUND_TO_NEAREST_INT); + _mm_store_ss(reinterpret_cast(pDestination), _mm_castsi128_ps(V1)); +#else + pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); + pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShortN2 +( + XMSHORTN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 32767.0f); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_ShortMax); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti, vResulti); + _mm_store_ss(reinterpret_cast(&pDestination->x), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShort2 +( + XMSHORT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ShortMin, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-32767.f)); + R = vminq_f32(R, vdupq_n_f32(32767.0f)); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_ShortMin); + vResult = _mm_min_ps(vResult, g_ShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt, vInt); + _mm_store_ss(reinterpret_cast(&pDestination->x), _mm_castsi128_ps(vInt)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShortN2 +( + XMUSHORTN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiplyAdd(N, g_UShortMax, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 65535.0f); + R = vaddq_f32(R, g_XMOneHalf); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_UShortMax); + vResult = _mm_add_ps(vResult, g_XMOneHalf); + // Convert to int + __m128i vInt = _mm_cvttps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShort2 +( + XMUSHORT2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(65535.0f)); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u16(vInt16), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByteN2 +( + XMBYTEN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 127.0f); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, g_ByteMax); + // Convert to int by rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByte2 +( + XMBYTE2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ByteMin, g_ByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-127.f)); + R = vminq_f32(R, vdupq_n_f32(127.0f)); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_ByteMin); + vResult = _mm_min_ps(vResult, g_ByteMax); + // Convert to int by rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByteN2 +( + XMUBYTEN2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiplyAdd(N, g_UByteMax, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 255.0f); + R = vaddq_f32(R, g_XMOneHalf); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, g_UByteMax); + vResult = _mm_add_ps(vResult, g_XMOneHalf); + // Convert to int + __m128i vInt = _mm_cvttps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByte2 +( + XMUBYTE2* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0.f)); + R = vminq_f32(R, vdupq_n_f32(255.0f)); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u16(reinterpret_cast(pDestination), vreinterpret_u16_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UByteMax); + // Convert to int by rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->v = static_cast(((static_cast(y) & 0xFF) << 8) | (static_cast(x) & 0xFF)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreU565 +( + XMU565* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Max = { { { 31.0f, 63.0f, 31.0f, 0.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + ((static_cast(tmp.z) & 0x1F) << 11) + | ((static_cast(tmp.y) & 0x3F) << 5) + | ((static_cast(tmp.x) & 0x1F))); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 32.f, 32.f * 64.f, 0.f } } }; + static const XMVECTORU32 Mask = { { { 0x1F, 0x3F << 5, 0x1F << 11, 0 } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, Max); + vResult = vmulq_f32(vResult, Scale); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, Mask); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vhi = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + auto z = static_cast(_mm_extract_epi16(vInt, 4)); + pDestination->v = static_cast( + ((static_cast(z) & 0x1F) << 11) + | ((static_cast(y) & 0x3F) << 5) + | ((static_cast(x) & 0x1F))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3PK +( + XMFLOAT3PK* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + + XM_ALIGNED_DATA(16) uint32_t IValue[4]; + XMStoreFloat3A(reinterpret_cast(&IValue), V); + + uint32_t Result[3]; + + // X & Y Channels (5-bit exponent, 6-bit mantissa) + for (uint32_t j = 0; j < 2; ++j) + { + uint32_t Sign = IValue[j] & 0x80000000; + uint32_t I = IValue[j] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[j] = 0x7C0U; + if ((I & 0x7FFFFF) != 0) + { + Result[j] = 0x7FFU; + } + else if (Sign) + { + // -INF is clamped to 0 since 3PK is positive only + Result[j] = 0; + } + } + else if (Sign || I < 0x35800000) + { + // 3PK is positive only, so clamp to zero + Result[j] = 0; + } + else if (I > 0x477E0000U) + { + // The number is too large to be represented as a float11, set to max + Result[j] = 0x7BFU; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + uint32_t Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + I += 0xC8000000U; + } + + Result[j] = ((I + 0xFFFFU + ((I >> 17U) & 1U)) >> 17U) & 0x7ffU; + } + } + + // Z Channel (5-bit exponent, 5-bit mantissa) + uint32_t Sign = IValue[2] & 0x80000000; + uint32_t I = IValue[2] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[2] = 0x3E0U; + if (I & 0x7FFFFF) + { + Result[2] = 0x3FFU; + } + else if (Sign || I < 0x36000000) + { + // -INF is clamped to 0 since 3PK is positive only + Result[2] = 0; + } + } + else if (Sign) + { + // 3PK is positive only, so clamp to zero + Result[2] = 0; + } + else if (I > 0x477C0000U) + { + // The number is too large to be represented as a float10, set to max + Result[2] = 0x3DFU; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float10 + // Convert it to a denormalized value. + uint32_t Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float10 + I += 0xC8000000U; + } + + Result[2] = ((I + 0x1FFFFU + ((I >> 18U) & 1U)) >> 18U) & 0x3ffU; + } + + // Pack Result into memory + pDestination->v = (Result[0] & 0x7ff) + | ((Result[1] & 0x7ff) << 11) + | ((Result[2] & 0x3ff) << 22); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreFloat3SE +( + XMFLOAT3SE* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + + XMFLOAT3A tmp; + XMStoreFloat3A(&tmp, V); + + static constexpr float maxf9 = float(0x1FF << 7); + static constexpr float minf9 = float(1.f / (1 << 16)); + + float x = (tmp.x >= 0.f) ? ((tmp.x > maxf9) ? maxf9 : tmp.x) : 0.f; + float y = (tmp.y >= 0.f) ? ((tmp.y > maxf9) ? maxf9 : tmp.y) : 0.f; + float z = (tmp.z >= 0.f) ? ((tmp.z > maxf9) ? maxf9 : tmp.z) : 0.f; + + const float max_xy = (x > y) ? x : y; + const float max_xyz = (max_xy > z) ? max_xy : z; + + const float maxColor = (max_xyz > minf9) ? max_xyz : minf9; + + union { float f; int32_t i; } fi; + fi.f = maxColor; + fi.i += 0x00004000; // round up leaving 9 bits in fraction (including assumed 1) + + auto exp = static_cast(fi.i) >> 23; + pDestination->e = exp - 0x6f; + + fi.i = static_cast(0x83000000 - (exp << 23)); + float ScaleR = fi.f; + + pDestination->xm = static_cast(MathInternal::round_to_nearest(x * ScaleR)); + pDestination->ym = static_cast(MathInternal::round_to_nearest(y * ScaleR)); + pDestination->zm = static_cast(MathInternal::round_to_nearest(z * ScaleR)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreHalf4 +( + XMHALF4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_F16C_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + __m128i V1 = _mm_cvtps_ph(V, _MM_FROUND_TO_NEAREST_INT); + _mm_storel_epi64(reinterpret_cast<__m128i*>(pDestination), V1); +#else + XMFLOAT4A t; + XMStoreFloat4A(&t, V); + + pDestination->x = XMConvertFloatToHalf(t.x); + pDestination->y = XMConvertFloatToHalf(t.y); + pDestination->z = XMConvertFloatToHalf(t.z); + pDestination->w = XMConvertFloatToHalf(t.w); +#endif // !_XM_F16C_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShortN4 +( + XMSHORTN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(-1.f)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); + vResult = vmulq_n_f32(vResult, 32767.0f); + int16x4_t vInt = vmovn_s32(vcvtq_s32_f32(vResult)); + vst1_s16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_ShortMax); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti, vResulti); + _mm_store_sd(reinterpret_cast(&pDestination->x), _mm_castsi128_pd(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreShort4 +( + XMSHORT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ShortMin, g_ShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, g_ShortMin); + vResult = vminq_f32(vResult, g_ShortMax); + int16x4_t vInt = vmovn_s32(vcvtq_s32_f32(vResult)); + vst1_s16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_ShortMin); + vResult = _mm_min_ps(vResult, g_ShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt, vInt); + _mm_store_sd(reinterpret_cast(&pDestination->x), _mm_castsi128_pd(vInt)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShortN4 +( + XMUSHORTN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiplyAdd(N, g_UShortMax, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); + vResult = vmulq_n_f32(vResult, 65535.0f); + vResult = vaddq_f32(vResult, g_XMOneHalf); + uint16x4_t vInt = vmovn_u32(vcvtq_u32_f32(vResult)); + vst1_u16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + vResult = _mm_mul_ps(vResult, g_UShortMax); + vResult = _mm_add_ps(vResult, g_XMOneHalf); + // Convert to int + __m128i vInt = _mm_cvttps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt, 4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt, 6)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUShort4 +( + XMUSHORT4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UShortMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, g_UShortMax); + uint16x4_t vInt = vmovn_u32(vcvtq_u32_f32(vResult)); + vst1_u16(reinterpret_cast(pDestination), vInt); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UShortMax); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt, 0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt, 2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt, 4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt, 6)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreXDecN4 +( + XMXDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Min = { { { -1.0f, -1.0f, -1.0f, 0.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f, 511.0f, 3.0f } } }; + + XMVECTOR N = XMVectorClamp(V, Min.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | (static_cast(tmp.x) & 0x3FF)); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1048576.0f, 3.0f * 536870912.0f } } }; + static const XMVECTORI32 ScaleMask = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 29 } } }; + float32x4_t vResult = vmaxq_f32(V, Min); + vResult = vminq_f32(vResult, vdupq_n_f32(1.0f)); + vResult = vmulq_f32(vResult, Scale); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, ScaleMask); + int32x4_t vResultw = vandq_s32(vResulti, g_XMMaskW); + vResulti = vaddq_s32(vResulti, vResultw); + // Do a horizontal or of all 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1048576.0f, 3.0f * 536870912.0f } } }; + static const XMVECTORI32 ScaleMask = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 29 } } }; + XMVECTOR vResult = _mm_max_ps(V, Min); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, Scale); + // Convert to int (W is unsigned) + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, ScaleMask); + // To fix W, add itself to shift it up to <<30 instead of <<29 + __m128i vResultw = _mm_and_si128(vResulti, g_XMMaskW); + vResulti = _mm_add_epi32(vResulti, vResultw); + // Do a horizontal or of all 4 entries + vResult = XM_PERMUTE_PS(_mm_castsi128_ps(vResulti), _MM_SHUFFLE(0, 3, 2, 1)); + vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 3, 2, 1)); + vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); + vResult = XM_PERMUTE_PS(vResult, _MM_SHUFFLE(0, 3, 2, 1)); + vResulti = _mm_or_si128(vResulti, _mm_castps_si128(vResult)); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreXDec4 +( + XMXDEC4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 MinXDec4 = { { { -511.0f, -511.0f, -511.0f, 0.0f } } }; + static const XMVECTORF32 MaxXDec4 = { { { 511.0f, 511.0f, 511.0f, 3.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, MinXDec4, MaxXDec4); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleXDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskXDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, MinXDec4); + vResult = vminq_f32(vResult, MaxXDec4); + vResult = vmulq_f32(vResult, ScaleXDec4); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, MaskXDec4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vTemp2 = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleXDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskXDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, MinXDec4); + vResult = _mm_min_ps(vResult, MaxXDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleXDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskXDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a single bit left shift on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUDecN4 +( + XMUDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 Scale = { { { 1023.0f, 1023.0f, 1023.0f, 3.0f } } }; + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiply(N, Scale.v); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleUDecN4 = { { { 1023.0f, 1023.0f * 1024.0f * 0.5f, 1023.0f * 1024.0f * 1024.0f, 3.0f * 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORI32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0.f)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.f)); + vResult = vmulq_f32(vResult, ScaleUDecN4); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUDecN4 = { { { 1023.0f, 1023.0f * 1024.0f * 0.5f, 1023.0f * 1024.0f * 1024.0f, 3.0f * 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORI32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUDecN4_XR +( + XMUDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Scale = { { { 510.0f, 510.0f, 510.0f, 3.0f } } }; + static const XMVECTORF32 Bias = { { { 384.0f, 384.0f, 384.0f, 0.0f } } }; + static const XMVECTORF32 C = { { { 1023.f, 1023.f, 1023.f, 3.f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorMultiplyAdd(V, Scale, Bias); + N = XMVectorClamp(N, g_XMZero, C); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Shift = { { { 1.0f, 1024.0f * 0.5f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORU32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmlaq_f32(Bias, V, Scale); + vResult = vmaxq_f32(vResult, vdupq_n_f32(0.f)); + vResult = vminq_f32(vResult, C); + vResult = vmulq_f32(vResult, Shift); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Shift = { { { 1.0f, 1024.0f * 0.5f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f * 0.5f } } }; + static const XMVECTORU32 MaskUDecN4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Scale & bias + XMVECTOR vResult = XM_FMADD_PS(V, Scale, Bias); + // Clamp to bounds + vResult = _mm_max_ps(vResult, g_XMZero); + vResult = _mm_min_ps(vResult, C); + // Scale by shift values + vResult = _mm_mul_ps(vResult, Shift); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUDec4 +( + XMUDEC4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 MaxUDec4 = { { { 1023.0f, 1023.0f, 1023.0f, 3.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), MaxUDec4); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleUDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskUDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0.f)); + vResult = vminq_f32(vResult, MaxUDec4); + vResult = vmulq_f32(vResult, ScaleUDec4); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, MaskUDec4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUDec4 = { { { 1.0f, 1024.0f / 2.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f / 2.0f } } }; + static const XMVECTORI32 MaskUDec4 = { { { 0x3FF, 0x3FF << (10 - 1), 0x3FF << 20, 0x3 << (30 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, MaxUDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreDecN4 +( + XMDECN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + static const XMVECTORF32 Scale = { { { 511.0f, 511.0f, 511.0f, 1.0f } } }; + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleDecN4 = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1024.0f * 1024.0f, 1.0f * 1024.0f * 1024.0f * 1024.0f } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(-1.f)); + vResult = vminq_f32(vResult, vdupq_n_f32(1.f)); + vResult = vmulq_f32(vResult, ScaleDecN4); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, g_XMMaskDec4); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleDecN4 = { { { 511.0f, 511.0f * 1024.0f, 511.0f * 1024.0f * 1024.0f, 1.0f * 1024.0f * 1024.0f * 1024.0f } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, g_XMMaskDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreDec4 +( + XMDEC4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 MinDec4 = { { { -511.0f, -511.0f, -511.0f, -1.0f } } }; + static const XMVECTORF32 MaxDec4 = { { { 511.0f, 511.0f, 511.0f, 1.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, MinDec4, MaxDec4); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + (static_cast(tmp.w) << 30) + | ((static_cast(tmp.z) & 0x3FF) << 20) + | ((static_cast(tmp.y) & 0x3FF) << 10) + | ((static_cast(tmp.x) & 0x3FF))); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 ScaleDec4 = { { { 1.0f, 1024.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f } } }; + float32x4_t vResult = vmaxq_f32(V, MinDec4); + vResult = vminq_f32(vResult, MaxDec4); + vResult = vmulq_f32(vResult, ScaleDec4); + int32x4_t vResulti = vcvtq_s32_f32(vResult); + vResulti = vandq_s32(vResulti, g_XMMaskDec4); + // Do a horizontal or of all 4 entries + uint32x2_t vTemp = vget_low_u32(vreinterpretq_u32_s32(vResulti)); + uint32x2_t vhi = vget_high_u32(vreinterpretq_u32_s32(vResulti)); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u32(&pDestination->v, vTemp, 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleDec4 = { { { 1.0f, 1024.0f, 1024.0f * 1024.0f, 1024.0f * 1024.0f * 1024.0f } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, MinDec4); + vResult = _mm_min_ps(vResult, MaxDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, g_XMMaskDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByteN4 +( + XMUBYTEN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorSaturate(V); + N = XMVectorMultiply(N, g_UByteMax); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 255.0f); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUByteN4 = { { { 255.0f, 255.0f * 256.0f * 0.5f, 255.0f * 256.0f * 256.0f, 255.0f * 256.0f * 256.0f * 256.0f * 0.5f } } }; + static const XMVECTORI32 MaskUByteN4 = { { { 0xFF, 0xFF << (8 - 1), 0xFF << 16, 0xFF << (24 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUByte4 +( + XMUBYTE4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), g_UByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(0)); + R = vminq_f32(R, vdupq_n_f32(255.0f)); + uint32x4_t vInt32 = vcvtq_u32_f32(R); + uint16x4_t vInt16 = vqmovn_u32(vInt32); + uint8x8_t vInt8 = vqmovn_u16(vcombine_u16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_u8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleUByte4 = { { { 1.0f, 256.0f * 0.5f, 256.0f * 256.0f, 256.0f * 256.0f * 256.0f * 0.5f } } }; + static const XMVECTORI32 MaskUByte4 = { { { 0xFF, 0xFF << (8 - 1), 0xFF << 16, 0xFF << (24 - 1) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, g_UByteMax); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleUByte4); + // Convert to int by rounding + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskUByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2, vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByteN4 +( + XMBYTEN4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, g_ByteMax); + N = XMVectorTruncate(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-1.f)); + R = vminq_f32(R, vdupq_n_f32(1.0f)); + R = vmulq_n_f32(R, 127.0f); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleByteN4 = { { { 127.0f, 127.0f * 256.0f, 127.0f * 256.0f * 256.0f, 127.0f * 256.0f * 256.0f * 256.0f } } }; + static const XMVECTORI32 MaskByteN4 = { { { 0xFF, 0xFF << 8, 0xFF << 16, static_cast(0xFF000000) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_XMNegativeOne); + vResult = _mm_min_ps(vResult, g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreByte4 +( + XMBYTE4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, g_ByteMin, g_ByteMax); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->x = static_cast(tmp.x); + pDestination->y = static_cast(tmp.y); + pDestination->z = static_cast(tmp.z); + pDestination->w = static_cast(tmp.w); + +#elif defined(_XM_ARM_NEON_INTRINSICS_) + float32x4_t R = vmaxq_f32(V, vdupq_n_f32(-127.f)); + R = vminq_f32(R, vdupq_n_f32(127.f)); + int32x4_t vInt32 = vcvtq_s32_f32(R); + int16x4_t vInt16 = vqmovn_s32(vInt32); + int8x8_t vInt8 = vqmovn_s16(vcombine_s16(vInt16, vInt16)); + vst1_lane_u32(&pDestination->v, vreinterpret_u32_s8(vInt8), 0); +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 ScaleByte4 = { { { 1.0f, 256.0f, 256.0f * 256.0f, 256.0f * 256.0f * 256.0f } } }; + static const XMVECTORI32 MaskByte4 = { { { 0xFF, 0xFF << 8, 0xFF << 16, static_cast(0xFF000000) } } }; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V, g_ByteMin); + vResult = _mm_min_ps(vResult, g_ByteMax); + // Scale by multiplication + vResult = _mm_mul_ps(vResult, ScaleByte4); + // Convert to int by rounding + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti, MaskByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(3, 2, 3, 2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti, vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti, _MM_SHUFFLE(1, 1, 1, 1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti, vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v), _mm_castsi128_ps(vResulti)); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreUNibble4 +( + XMUNIBBLE4* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Max = { { { 15.0f, 15.0f, 15.0f, 15.0f } } }; +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + ((static_cast(tmp.w) & 0xF) << 12) + | ((static_cast(tmp.z) & 0xF) << 8) + | ((static_cast(tmp.y) & 0xF) << 4) + | (static_cast(tmp.x) & 0xF)); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 16.f, 16.f * 16.f, 16.f * 16.f * 16.f } } }; + static const XMVECTORU32 Mask = { { { 0xF, 0xF << 4, 0xF << 8, 0xF << 12 } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, Max); + vResult = vmulq_f32(vResult, Scale); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, Mask); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vhi = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vhi); + vTemp = vpadd_u32(vTemp, vTemp); + vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + auto z = static_cast(_mm_extract_epi16(vInt, 4)); + auto w = static_cast(_mm_extract_epi16(vInt, 6)); + pDestination->v = static_cast( + ((static_cast(w) & 0xF) << 12) + | ((static_cast(z) & 0xF) << 8) + | ((static_cast(y) & 0xF) << 4) + | ((static_cast(x) & 0xF))); +#endif +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline void XM_CALLCONV XMStoreU555 +( + XMU555* pDestination, + FXMVECTOR V +) noexcept +{ + assert(pDestination); + static const XMVECTORF32 Max = { { { 31.0f, 31.0f, 31.0f, 1.0f } } }; + +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + XMFLOAT4A tmp; + XMStoreFloat4A(&tmp, N); + + pDestination->v = static_cast( + ((tmp.w > 0.f) ? 0x8000 : 0) + | ((static_cast(tmp.z) & 0x1F) << 10) + | ((static_cast(tmp.y) & 0x1F) << 5) + | (static_cast(tmp.x) & 0x1F)); +#elif defined(_XM_ARM_NEON_INTRINSICS_) + static const XMVECTORF32 Scale = { { { 1.0f, 32.f / 2.f, 32.f * 32.f, 32.f * 32.f * 32.f / 2.f } } }; + static const XMVECTORU32 Mask = { { { 0x1F, 0x1F << (5 - 1), 0x1F << 10, 0x1 << (15 - 1) } } }; + float32x4_t vResult = vmaxq_f32(V, vdupq_n_f32(0)); + vResult = vminq_f32(vResult, Max); + vResult = vmulq_f32(vResult, Scale); + uint32x4_t vResulti = vcvtq_u32_f32(vResult); + vResulti = vandq_u32(vResulti, Mask); + // Do a horizontal or of 4 entries + uint32x2_t vTemp = vget_low_u32(vResulti); + uint32x2_t vTemp2 = vget_high_u32(vResulti); + vTemp = vorr_u32(vTemp, vTemp2); + // Perform a single bit left shift on y|w + vTemp2 = vdup_lane_u32(vTemp, 1); + vTemp2 = vadd_u32(vTemp2, vTemp2); + vTemp = vorr_u32(vTemp, vTemp2); + vst1_lane_u16(&pDestination->v, vreinterpret_u16_u32(vTemp), 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Bounds check + XMVECTOR vResult = _mm_max_ps(V, g_XMZero); + vResult = _mm_min_ps(vResult, Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + auto x = static_cast(_mm_extract_epi16(vInt, 0)); + auto y = static_cast(_mm_extract_epi16(vInt, 2)); + auto z = static_cast(_mm_extract_epi16(vInt, 4)); + auto w = static_cast(_mm_extract_epi16(vInt, 6)); + pDestination->v = static_cast( + (static_cast(w) ? 0x8000 : 0) + | ((static_cast(z) & 0x1F) << 10) + | ((static_cast(y) & 0x1F) << 5) + | ((static_cast(x) & 0x1F))); +#endif +} + + +/**************************************************************************** + * + * XMCOLOR operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMCOLOR::XMCOLOR +( + float _r, + float _g, + float _b, + float _a +) noexcept +{ + XMStoreColor(this, XMVectorSet(_r, _g, _b, _a)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMCOLOR::XMCOLOR(const float* pArray) noexcept +{ + XMStoreColor(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMHALF2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMHALF2::XMHALF2 +( + float _x, + float _y +) noexcept +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMHALF2::XMHALF2(const float* pArray) noexcept +{ + assert(pArray != nullptr); + x = XMConvertFloatToHalf(pArray[0]); + y = XMConvertFloatToHalf(pArray[1]); +} + +/**************************************************************************** + * + * XMSHORTN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMSHORTN2::XMSHORTN2 +( + float _x, + float _y +) noexcept +{ + XMStoreShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORTN2::XMSHORTN2(const float* pArray) noexcept +{ + XMStoreShortN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMSHORT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMSHORT2::XMSHORT2 +( + float _x, + float _y +) noexcept +{ + XMStoreShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORT2::XMSHORT2(const float* pArray) noexcept +{ + XMStoreShort2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORTN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUSHORTN2::XMUSHORTN2 +( + float _x, + float _y +) noexcept +{ + XMStoreUShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORTN2::XMUSHORTN2(const float* pArray) noexcept +{ + XMStoreUShortN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUSHORT2::XMUSHORT2 +( + float _x, + float _y +) noexcept +{ + XMStoreUShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORT2::XMUSHORT2(const float* pArray) noexcept +{ + XMStoreUShort2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTEN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMBYTEN2::XMBYTEN2 +( + float _x, + float _y +) noexcept +{ + XMStoreByteN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTEN2::XMBYTEN2(const float* pArray) noexcept +{ + XMStoreByteN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTE2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMBYTE2::XMBYTE2 +( + float _x, + float _y +) noexcept +{ + XMStoreByte2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTE2::XMBYTE2(const float* pArray) noexcept +{ + XMStoreByte2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTEN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUBYTEN2::XMUBYTEN2 +( + float _x, + float _y +) noexcept +{ + XMStoreUByteN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTEN2::XMUBYTEN2(const float* pArray) noexcept +{ + XMStoreUByteN2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTE2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUBYTE2::XMUBYTE2 +( + float _x, + float _y +) noexcept +{ + XMStoreUByte2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTE2::XMUBYTE2(const float* pArray) noexcept +{ + XMStoreUByte2(this, XMLoadFloat2(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMU565 operators + * + ****************************************************************************/ + +inline XMU565::XMU565 +( + float _x, + float _y, + float _z +) noexcept +{ + XMStoreU565(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +_Use_decl_annotations_ +inline XMU565::XMU565(const float* pArray) noexcept +{ + XMStoreU565(this, XMLoadFloat3(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMFLOAT3PK operators + * + ****************************************************************************/ + +inline XMFLOAT3PK::XMFLOAT3PK +( + float _x, + float _y, + float _z +) noexcept +{ + XMStoreFloat3PK(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +_Use_decl_annotations_ +inline XMFLOAT3PK::XMFLOAT3PK(const float* pArray) noexcept +{ + XMStoreFloat3PK(this, XMLoadFloat3(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMFLOAT3SE operators + * + ****************************************************************************/ + +inline XMFLOAT3SE::XMFLOAT3SE +( + float _x, + float _y, + float _z +) noexcept +{ + XMStoreFloat3SE(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +_Use_decl_annotations_ +inline XMFLOAT3SE::XMFLOAT3SE(const float* pArray) noexcept +{ + XMStoreFloat3SE(this, XMLoadFloat3(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMHALF4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMHALF4::XMHALF4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); + z = XMConvertFloatToHalf(_z); + w = XMConvertFloatToHalf(_w); +} + +//------------------------------------------------------------------------------ + +_Use_decl_annotations_ +inline XMHALF4::XMHALF4(const float* pArray) noexcept +{ + XMConvertFloatToHalfStream(&x, sizeof(HALF), pArray, sizeof(float), 4); +} + +/**************************************************************************** + * + * XMSHORTN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMSHORTN4::XMSHORTN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORTN4::XMSHORTN4(const float* pArray) noexcept +{ + XMStoreShortN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMSHORT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMSHORT4::XMSHORT4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMSHORT4::XMSHORT4(const float* pArray) noexcept +{ + XMStoreShort4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORTN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUSHORTN4::XMUSHORTN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORTN4::XMUSHORTN4(const float* pArray) noexcept +{ + XMStoreUShortN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUSHORT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUSHORT4::XMUSHORT4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUSHORT4::XMUSHORT4(const float* pArray) noexcept +{ + XMStoreUShort4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMXDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMXDECN4::XMXDECN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreXDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMXDECN4::XMXDECN4(const float* pArray) noexcept +{ + XMStoreXDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMXDEC4 operators + * + ****************************************************************************/ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +// C4996: ignore deprecation warning +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +//------------------------------------------------------------------------------ + +inline XMXDEC4::XMXDEC4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreXDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMXDEC4::XMXDEC4(const float* pArray) noexcept +{ + XMStoreXDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMDECN4::XMDECN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMDECN4::XMDECN4(const float* pArray) noexcept +{ + XMStoreDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMDEC4::XMDEC4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMDEC4::XMDEC4(const float* pArray) noexcept +{ + XMStoreDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/**************************************************************************** + * + * XMUDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUDECN4::XMUDECN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUDECN4::XMUDECN4(const float* pArray) noexcept +{ + XMStoreUDecN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUDEC4::XMUDEC4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUDEC4::XMUDEC4(const float* pArray) noexcept +{ + XMStoreUDec4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTEN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMBYTEN4::XMBYTEN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTEN4::XMBYTEN4(const float* pArray) noexcept +{ + XMStoreByteN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMBYTE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMBYTE4::XMBYTE4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMBYTE4::XMBYTE4(const float* pArray) noexcept +{ + XMStoreByte4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTEN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUBYTEN4::XMUBYTEN4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTEN4::XMUBYTEN4(const float* pArray) noexcept +{ + XMStoreUByteN4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUBYTE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUBYTE4::XMUBYTE4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUBYTE4::XMUBYTE4(const float* pArray) noexcept +{ + XMStoreUByte4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMUNIBBLE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMUNIBBLE4::XMUNIBBLE4 +( + float _x, + float _y, + float _z, + float _w +) noexcept +{ + XMStoreUNibble4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMUNIBBLE4::XMUNIBBLE4(const float* pArray) noexcept +{ + XMStoreUNibble4(this, XMLoadFloat4(reinterpret_cast(pArray))); +} + +/**************************************************************************** + * + * XMU555 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +inline XMU555::XMU555 +( + float _x, + float _y, + float _z, + bool _w +) noexcept +{ + XMStoreU555(this, XMVectorSet(_x, _y, _z, ((_w) ? 1.0f : 0.0f))); +} + +//------------------------------------------------------------------------------ +_Use_decl_annotations_ +inline XMU555::XMU555 +( + const float* pArray, + bool _w +) noexcept +{ + XMVECTOR V = XMLoadFloat3(reinterpret_cast(pArray)); + XMStoreU555(this, XMVectorSetW(V, ((_w) ? 1.0f : 0.0f))); +} + diff --git a/Minecraft.Client/Platform/Linux/Stubs/DirectXMath/sal.h b/Minecraft.Client/Linux/Stubs/DirectXMath/sal.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Stubs/DirectXMath/sal.h rename to Minecraft.Client/Linux/Stubs/DirectXMath/sal.h diff --git a/Minecraft.Client/Platform/Linux/Stubs/LinuxStubs.h b/Minecraft.Client/Linux/Stubs/LinuxStubs.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Stubs/LinuxStubs.h rename to Minecraft.Client/Linux/Stubs/LinuxStubs.h diff --git a/Minecraft.Client/Platform/Linux/Stubs/d3d11_stubs.h b/Minecraft.Client/Linux/Stubs/d3d11_stubs.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Stubs/d3d11_stubs.h rename to Minecraft.Client/Linux/Stubs/d3d11_stubs.h diff --git a/Minecraft.Client/Platform/Linux/Stubs/iggy_stubs.h b/Minecraft.Client/Linux/Stubs/iggy_stubs.h similarity index 99% rename from Minecraft.Client/Platform/Linux/Stubs/iggy_stubs.h rename to Minecraft.Client/Linux/Stubs/iggy_stubs.h index fdd493302..6ba9dc3f0 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/iggy_stubs.h +++ b/Minecraft.Client/Linux/Stubs/iggy_stubs.h @@ -3,7 +3,7 @@ #pragma once -#include "../Iggy/include/iggy.h" +#include "../../../Windows64/Iggy/include/iggy.h" #define STUBBED \ { \ diff --git a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h b/Minecraft.Client/Linux/Stubs/winapi_stubs.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h rename to Minecraft.Client/Linux/Stubs/winapi_stubs.h diff --git a/Minecraft.Client/Platform/Linux/Stubs/xbox_stubs.h b/Minecraft.Client/Linux/Stubs/xbox_stubs.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Stubs/xbox_stubs.h rename to Minecraft.Client/Linux/Stubs/xbox_stubs.h diff --git a/Minecraft.Client/Platform/Linux/linux_game_stubs.cpp b/Minecraft.Client/Linux/linux_game_stubs.cpp similarity index 74% rename from Minecraft.Client/Platform/Linux/linux_game_stubs.cpp rename to Minecraft.Client/Linux/linux_game_stubs.cpp index 2c52c1f1d..cb0a1c947 100644 --- a/Minecraft.Client/Platform/Linux/linux_game_stubs.cpp +++ b/Minecraft.Client/Linux/linux_game_stubs.cpp @@ -6,13 +6,13 @@ #include #include "Stubs/LinuxStubs.h" -#include "../Common/Consoles_App.h" +#include "../../Common/Consoles_App.h" void Display::update() {} int CMinecraftApp::GetTPConfigVal(wchar_t* pwchDataFile) { return 0; } -#include "../../Minecraft.World/Platform/x64headers/extraX64.h" +#include "../../../Minecraft.World/x64headers/extraX64.h" void PIXSetMarkerDeprecated(int a, const char* b, ...) {} diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGameRules.h b/Minecraft.Client/Platform/Common/GameRules/ConsoleGameRules.h deleted file mode 100644 index 41c5e5572..000000000 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleGameRules.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#include "ConsoleGameRulesConstants.h" - -#include "GameRuleManager.h" - -#include "GameRule.h" - -#include "GameRuleDefinition.h" - -#include "LevelRuleset.h" -#include "NamedAreaRuleDefinition.h" - -#include "CollectItemRuleDefinition.h" -#include "CompleteAllRuleDefinition.h" -#include "CompoundGameRuleDefinition.h" -#include "UseTileRuleDefinition.h" -#include "UpdatePlayerRuleDefinition.h" -#include "AddItemRuleDefinition.h" -#include "AddEnchantmentRuleDefinition.h" - -#include "LevelGenerationOptions.h" -#include "ApplySchematicRuleDefinition.h" -#include "ConsoleGenerateStructure.h" -#include "ConsoleGenerateStructureAction.h" -#include "XboxStructureActionGenerateBox.h" -#include "XboxStructureActionPlaceBlock.h" -#include "XboxStructureActionPlaceContainer.h" -#include "XboxStructureActionPlaceSpawner.h" -#include "BiomeOverride.h" -#include "StartFeature.h" - -#include "GameRulesInstance.h" diff --git a/Minecraft.Client/Platform/Common/Minecraft_Macros.h b/Minecraft.Client/Platform/Common/Minecraft_Macros.h deleted file mode 100644 index 4642d9781..000000000 --- a/Minecraft.Client/Platform/Common/Minecraft_Macros.h +++ /dev/null @@ -1,62 +0,0 @@ - -#pragma once - -#include - -// 3 bit user index -// 5 bits alpha -// 1 bit decoration -// 3 bits poptime -// 8 bits unused // was 11 bits aux val but needed 15 bits for potions so moved -// to item bitmask 6 bits count 6 bits scale - -// uiCount is up to 64, but can't ever be 0, so to make it 6 bits, subtract one -// from the packing, and add one on the unpacking -#define MAKE_SLOTDISPLAY_DATA_BITMASK(uiUserIndex, uiAlpha, bDecorations, \ - uiCount, uiScale, uiPopTime) \ - ((((uiUserIndex & 0x7) << 29) | (uiAlpha & 0x1F) << 24) | \ - (bDecorations ? 0x800000 : 0) | ((uiPopTime & 0x7) << 20) | \ - ((uiCount - 1) << 6) | (uiScale & 0x3F)) - -#define GET_SLOTDISPLAY_USERINDEX_FROM_DATA_BITMASK(uiBitmask) \ - ((((unsigned int)uiBitmask) >> 29) & 0x7) -#define GET_SLOTDISPLAY_ALPHA_FROM_DATA_BITMASK(uiBitmask) \ - ((((unsigned int)uiBitmask) >> 24) & 0x1F) -#define GET_SLOTDISPLAY_DECORATIONS_FROM_DATA_BITMASK(uiBitmask) \ - ((((unsigned int)uiBitmask) & 0x800000) ? true : false) -// #define GET_SLOTDISPLAY_AUXVAL_FROM_DATA_BITMASK(uiBitmask) -// ((((unsigned long)uiBitmask)>>12)&0x7FF) -#define GET_SLOTDISPLAY_COUNT_FROM_DATA_BITMASK(uiBitmask) \ - (((((unsigned int)uiBitmask) >> 6) & 0x3F) + 1) -#define GET_SLOTDISPLAY_SCALE_FROM_DATA_BITMASK(uiBitmask) \ - (((unsigned int)uiBitmask) & 0x3F) -#define GET_SLOTDISPLAY_POPTIME_FROM_DATA_BITMASK(uiBitmask) \ - ((((unsigned int)uiBitmask) >> 20) & 0x7) - -// 16 bits for id (either item id or xzp icon id) -// 15 bits for aux value -// 1 bit for foil -#define MAKE_SLOTDISPLAY_ITEM_BITMASK(uiId, uiAuxValue, bFoil) \ - ((uiId & 0xFFFF) | ((uiAuxValue & 0x7FFF) << 16) | (bFoil ? 0x80000000 : 0)) - -#define GET_SLOTDISPLAY_ID_FROM_ITEM_BITMASK(uiBitmask) \ - (((unsigned int)uiBitmask) & 0xFFFF) -#define GET_SLOTDISPLAY_AUXVAL_FROM_ITEM_BITMASK(uiBitmask) \ - ((((unsigned int)uiBitmask) >> 16) & 0x7FFF) -#define GET_SLOTDISPLAY_FOIL_FROM_ITEM_BITMASK(uiBitmask) \ - ((((unsigned int)uiBitmask) & 0x80000000) ? true : false) - -// For encoding the players skin selection in their profile -// bDlcSkin = false is a players skin, bDlcSkin = true is a DLC skin -#define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) \ - ((bDlcSkin ? 0x80000000 : 0) | (dwSkinId & 0x7FFFFFFF)) -#define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF) - -#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) \ - (static_cast(uiBitmask) & 0x7FFFFFFF) -#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) \ - (static_cast(uiBitmask) & 0x7FFFFFE0) -#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) \ - (static_cast(uiBitmask) & 0x0000001F) -#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) \ - ((static_cast(uiBitmask) & 0x80000000) ? true : false) diff --git a/Minecraft.Client/Platform/Common/Network/NetworkPlayerQNet.cpp b/Minecraft.Client/Platform/Common/Network/NetworkPlayerQNet.cpp deleted file mode 100644 index 735ef40ca..000000000 --- a/Minecraft.Client/Platform/Common/Network/NetworkPlayerQNet.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "../../../../Minecraft.World/Platform/stdafx.h" -#include "NetworkPlayerQNet.h" - -NetworkPlayerQNet::NetworkPlayerQNet(IQNetPlayer* qnetPlayer) { - m_qnetPlayer = qnetPlayer; - m_pSocket = nullptr; -} - -unsigned char NetworkPlayerQNet::GetSmallId() { - return m_qnetPlayer->GetSmallId(); -} - -void NetworkPlayerQNet::SendData(INetworkPlayer* player, const void* pvData, - int dataSize, bool lowPriority, bool ack) { - uint32_t flags; - flags = QNET_SENDDATA_RELIABLE | QNET_SENDDATA_SEQUENTIAL; - if (lowPriority) - flags |= QNET_SENDDATA_LOW_PRIORITY | QNET_SENDDATA_SECONDARY; - m_qnetPlayer->SendData( - static_cast(player)->m_qnetPlayer, pvData, dataSize, - flags); -} - -int NetworkPlayerQNet::GetOutstandingAckCount() { return 0; } - -bool NetworkPlayerQNet::IsSameSystem(INetworkPlayer* player) { - return (m_qnetPlayer->IsSameSystem( - static_cast(player)->m_qnetPlayer) == true); -} - -int NetworkPlayerQNet::GetSendQueueSizeBytes(INetworkPlayer* player, - bool lowPriority) { - uint32_t flags = QNET_GETSENDQUEUESIZE_BYTES; - if (lowPriority) flags |= QNET_GETSENDQUEUESIZE_SECONDARY_TYPE; - return m_qnetPlayer->GetSendQueueSize( - player ? static_cast(player)->m_qnetPlayer - : nullptr, - flags); -} - -int NetworkPlayerQNet::GetSendQueueSizeMessages(INetworkPlayer* player, - bool lowPriority) { - uint32_t flags = QNET_GETSENDQUEUESIZE_MESSAGES; - if (lowPriority) flags |= QNET_GETSENDQUEUESIZE_SECONDARY_TYPE; - return m_qnetPlayer->GetSendQueueSize( - player ? static_cast(player)->m_qnetPlayer - : nullptr, - flags); -} - -int NetworkPlayerQNet::GetCurrentRtt() { return m_qnetPlayer->GetCurrentRtt(); } - -bool NetworkPlayerQNet::IsHost() { return (m_qnetPlayer->IsHost() == true); } - -bool NetworkPlayerQNet::IsGuest() { return (m_qnetPlayer->IsGuest() == true); } - -bool NetworkPlayerQNet::IsLocal() { return (m_qnetPlayer->IsLocal() == true); } - -int NetworkPlayerQNet::GetSessionIndex() { - return m_qnetPlayer->GetSessionIndex(); -} - -bool NetworkPlayerQNet::IsTalking() { - return (m_qnetPlayer->IsTalking() == true); -} - -bool NetworkPlayerQNet::IsMutedByLocalUser(int userIndex) { - return (m_qnetPlayer->IsMutedByLocalUser(userIndex) == true); -} - -bool NetworkPlayerQNet::HasVoice() { - return (m_qnetPlayer->HasVoice() == true); -} - -bool NetworkPlayerQNet::HasCamera() { - return (m_qnetPlayer->HasCamera() == true); -} - -int NetworkPlayerQNet::GetUserIndex() { return m_qnetPlayer->GetUserIndex(); } - -void NetworkPlayerQNet::SetSocket(Socket* pSocket) { m_pSocket = pSocket; } - -Socket* NetworkPlayerQNet::GetSocket() { return m_pSocket; } - -PlayerUID NetworkPlayerQNet::GetUID() { return m_qnetPlayer->GetXuid(); } - -const wchar_t* NetworkPlayerQNet::GetOnlineName() { - return m_qnetPlayer->GetGamertag(); -} - -std::wstring NetworkPlayerQNet::GetDisplayName() { - return m_qnetPlayer->GetGamertag(); -} - -IQNetPlayer* NetworkPlayerQNet::GetQNetPlayer() { return m_qnetPlayer; } - -void NetworkPlayerQNet::SentChunkPacket() { - m_lastChunkPacketTime = System::currentTimeMillis(); -} - -int NetworkPlayerQNet::GetTimeSinceLastChunkPacket_ms() { - // If we haven't ever sent a packet, return maximum - if (m_lastChunkPacketTime == 0) { - return INT_MAX; - } - - const int64_t currentTime = System::currentTimeMillis(); - return static_cast(currentTime - m_lastChunkPacketTime); -} diff --git a/Minecraft.Client/Platform/Common/Network/NetworkPlayerQNet.h b/Minecraft.Client/Platform/Common/Network/NetworkPlayerQNet.h deleted file mode 100644 index 62dbd59d0..000000000 --- a/Minecraft.Client/Platform/Common/Network/NetworkPlayerQNet.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include "NetworkPlayerInterface.h" - -// This is an implementation of the INetworkPlayer interface for the supported -// QNet-backed path. It -// effectively wraps the IQNetPlayer class in a non-platform-specific way. It is -// managed by PlatformNetworkManagerStub. - -class NetworkPlayerQNet : public INetworkPlayer { -public: - // Common player interface - NetworkPlayerQNet(IQNetPlayer* qnetPlayer); - virtual unsigned char GetSmallId(); - virtual void SendData(INetworkPlayer* player, const void* pvData, - int dataSize, bool lowPriority, bool ack); - virtual bool IsSameSystem(INetworkPlayer* player); - virtual int GetOutstandingAckCount(); - virtual int GetSendQueueSizeBytes(INetworkPlayer* player, bool lowPriority); - virtual int GetSendQueueSizeMessages(INetworkPlayer* player, - bool lowPriority); - virtual int GetCurrentRtt(); - virtual bool IsHost(); - virtual bool IsGuest(); - virtual bool IsLocal(); - virtual int GetSessionIndex(); - virtual bool IsTalking(); - virtual bool IsMutedByLocalUser(int userIndex); - virtual bool HasVoice(); - virtual bool HasCamera(); - virtual int GetUserIndex(); - virtual void SetSocket(Socket* pSocket); - virtual Socket* GetSocket(); - virtual const wchar_t* GetOnlineName(); - virtual std::wstring GetDisplayName(); - virtual PlayerUID GetUID(); - virtual void SentChunkPacket(); - virtual int GetTimeSinceLastChunkPacket_ms(); - - IQNetPlayer* GetQNetPlayer(); - -private: - IQNetPlayer* m_qnetPlayer; - Socket* m_pSocket; - int64_t m_lastChunkPacketTime; -}; diff --git a/Minecraft.Client/Platform/Common/UI/UI.h b/Minecraft.Client/Platform/Common/UI/UI.h deleted file mode 100644 index 80adb1f43..000000000 --- a/Minecraft.Client/Platform/Common/UI/UI.h +++ /dev/null @@ -1,119 +0,0 @@ -#pragma once - -#include "UIEnums.h" -#include "UIStructs.h" - -#include "UIBitmapFont.h" -#include "UITTFFont.h" - -#include "UIScene.h" -#include "UILayer.h" -#include "UIGroup.h" -#include "UIController.h" - -#include "UIControl.h" -#include "UIControl_Base.h" -#include "UIControl_Button.h" -#include "UIControl_CheckBox.h" -#include "UIControl_Slider.h" -#include "UIControl_Label.h" -#include "UIControl_TextInput.h" -#include "UIControl_SlotList.h" -#include "UIControl_Cursor.h" -#include "UIControl_ButtonList.h" -#include "UIControl_Progress.h" -#include "UIControl_TexturePackList.h" -#include "UIControl_LeaderboardList.h" -#include "UIControl_SaveList.h" -#include "UIControl_PlayerList.h" -#include "UIControl_BitmapIcon.h" -#include "UIControl_DLCList.h" -#include "UIControl_HTMLLabel.h" -#include "UIControl_DynamicLabel.h" -#include "UIControl_MinecraftPlayer.h" -#include "UIControl_MinecraftHorse.h" -#include "UIControl_PlayerSkinPreview.h" -#include "UIControl_EnchantmentButton.h" -#include "UIControl_EnchantmentBook.h" -#include "UIControl_SpaceIndicatorBar.h" -#include "UIControl_BeaconEffectButton.h" - -#include "UIScene_HUD.h" -#include "UIComponent_Panorama.h" -#include "UIComponent_Logo.h" -#include "UIComponent_Tooltips.h" -#include "UIComponent_TutorialPopup.h" -#include "UIComponent_Chat.h" -#include "UIComponent_PressStartToPlay.h" -#include "UIComponent_MenuBackground.h" - -#include "UIScene_QuadrantSignin.h" -#include "UIScene_MessageBox.h" -#include "UIScene_Timer.h" -#include "UIScene_Keyboard.h" - -#include "UIScene_DebugOverlay.h" -#include "UIScene_DebugOptions.h" -#include "UIComponent_DebugUIConsole.h" -#include "UIComponent_DebugUIMarketingGuide.h" -#include "UIScene_DebugSetCamera.h" -#include "UIScene_DebugCreateSchematic.h" - -#include "UIScene_TrialExitUpsell.h" -#include "UIScene_Intro.h" -#include "UIScene_SaveMessage.h" -#include "UIScene_MainMenu.h" -#include "UIScene_LoadMenu.h" -#include "UIScene_JoinMenu.h" -#include "UIScene_LoadOrJoinMenu.h" -#include "UIScene_CreateWorldMenu.h" -#include "UIScene_LaunchMoreOptionsMenu.h" -#include "UIScene_FullscreenProgress.h" -#include "UIScene_LeaderboardsMenu.h" -#include "UIScene_DLCMainMenu.h" -#include "UIScene_DLCOffersMenu.h" -#include "UIScene_ReinstallMenu.h" - -#include "UIScene_HelpAndOptionsMenu.h" -#include "UIScene_SettingsMenu.h" -#include "UIScene_SettingsOptionsMenu.h" -#include "UIScene_SettingsAudioMenu.h" -#include "UIScene_SettingsControlMenu.h" -#include "UIScene_SettingsGraphicsMenu.h" -#include "UIScene_SettingsUIMenu.h" -#include "UIScene_SkinSelectMenu.h" -#include "UIScene_HowToPlayMenu.h" -#include "UIScene_LanguageSelector.h" -#include "UIScene_HowToPlay.h" -#include "UIScene_ControlsMenu.h" -#include "UIScene_Credits.h" - -#include "UIScene_PauseMenu.h" - -#include "UIScene_AbstractContainerMenu.h" -#include "UIScene_BrewingStandMenu.h" -#include "UIScene_ContainerMenu.h" -#include "UIScene_DispenserMenu.h" -#include "UIScene_EnchantingMenu.h" -#include "UIScene_InventoryMenu.h" -#include "UIScene_FurnaceMenu.h" -#include "UIScene_CreativeMenu.h" -#include "UIScene_TradingMenu.h" -#include "UIScene_AnvilMenu.h" -#include "UIScene_HorseInventoryMenu.h" -#include "UIScene_HopperMenu.h" -#include "UIScene_BeaconMenu.h" -#include "UIScene_FireworksMenu.h" - -#include "UIScene_CraftingMenu.h" -#include "UIScene_SignEntryMenu.h" - -#include "UIScene_ConnectingProgress.h" -#include "UIScene_DeathMenu.h" -#include "UIScene_InGameInfoMenu.h" -#include "UIScene_InGameHostOptionsMenu.h" -#include "UIScene_InGamePlayerOptionsMenu.h" -#include "UIScene_TeleportMenu.h" -#include "UIScene_EndPoem.h" -#include "UIScene_EULA.h" -#include "UIScene_NewUpdateMessage.h" \ No newline at end of file diff --git a/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.gameconfig b/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.gameconfig deleted file mode 100644 index 14885d535..000000000 Binary files a/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.gameconfig and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.spa b/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.spa deleted file mode 100644 index ff87b0c6d..000000000 Binary files a/Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.spa and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/GameHDD/20140401093851/saveData.ms b/Minecraft.Client/Platform/Windows64/GameHDD/20140401093851/saveData.ms deleted file mode 100644 index c227422d8..000000000 Binary files a/Minecraft.Client/Platform/Windows64/GameHDD/20140401093851/saveData.ms and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp deleted file mode 100644 index d8727b35c..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.cpp +++ /dev/null @@ -1,2390 +0,0 @@ -// gdraw_d3d.cpp - author: Sean Barrett - copyright 2009-2011 RAD Game Tools -// -// This implements the Iggy graphics driver layer for Direct3D 9. - -// GDraw consists of several components that interact fairly loosely with each -// other; e.g. the resource management, drawing and filtering parts are all -// fairly independent of each other. If you want to modify some aspect of GDraw -// - say the texture allocation logic - your best bet is usually to just look -// for one of the related entry points, e.g. MakeTextureBegin, and take it from -// there. There's a bunch of code in this file, but none of it is really -// complicated. -// -// The one bit you might want to change that's not that localized is to -// integrate GDraw with an existing state caching system. The following bits all -// modify D3D state in some way: -// - The rendering helpers (set_viewport_raw, set_projection_raw, -// set_*_renderstate) -// - RenderTile*/TextureDrawBuffer* may change the active rendertarget and -// depth/stencil surface, -// as do D3D_NoMoreGDrawThisFrame and set_render_target -// - set_texture -// - set_renderstate and set_renderstate_full. These are the main places where -// render state changes occur; -// you should probably start here. -// - DrawIndexedTriangles sets the active vertex/index buffers and vertex -// declaration -// - Most of the functions in the "filter effects" section modify D3D state, -// mostly -// pixel shader constants and textures - -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include - -// We temporarily disable this warning for the shared interface portions -#pragma warning(push) -#pragma warning(disable \ - : 4201) // nonstandard extension used : nameless struct/union - -#include "../include/gdraw.h" -#include "../include/iggy.h" -#include "gdraw_d3d.h" - -// The native handle type holds resource handles and a coarse description. -typedef union { - // handle that is a texture - struct { - IDirect3DTexture9* d3d; - IDirect3DTexture9* d3d_msaa; - U32 w, h; - } tex; - - // handle that is a vertex buffer - struct { - IDirect3DVertexBuffer9* base; - IDirect3DIndexBuffer9* indices; - } vbuf; -} GDrawNativeHandle; - -#define GDRAW_D3D // this controls the next include so the cache gets declared - // with the correct types, which makes it typesafe -#include "gdraw_shared.inl" - -#pragma warning(pop) - -// max rendertarget stack depth. this depends on the extent to which you -// use filters and non-standard blend modes, and how nested they are. -#define MAX_RENDER_STACK_DEPTH \ - 8 // Iggy is hardcoded to a limit of 16... probably 1-3 is realistic -#define AATEX_SAMPLER 7 // sampler that aa_tex gets set in -#define QUAD_IB_COUNT 2048 // quad index buffer has indices for this many quads - -#define ASSERT_COUNT(a, b) ((a) == (b) ? (b) : -1) - -static GDrawFunctions gdraw_funcs; - -// render target state -typedef struct { - GDrawHandle* color_buffer; - S32 base_x, base_y, width, height; - U32 flags; - rrbool cached; -} GDrawFramebufferState; - -struct ProgramWithCachedVariableLocations { - DWORD* bytecode; - union { - IDirect3DPixelShader9* pshader; - IDirect3DVertexShader9* vshader; - }; - int vars[MAX_VARS]; // it's unsigned in d3d, but we want an 'undefined' - // value -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// GDraw data structure -// -// -// This is the primary rendering abstraction, which hides all -// the platform-specific rendering behavior from Iggy. It is -// full of platform-specific graphics state, and also general -// graphics state so that it doesn't have to callback into Iggy -// to get at that graphics state. - -typedef struct { - IDirect3DDevice9* d3d_device; - - // fragment shaders - ProgramWithCachedVariableLocations fprog[GDRAW_TEXTURE__count][3]; - ProgramWithCachedVariableLocations - exceptional_blend[GDRAW_BLENDSPECIAL__count]; - ProgramWithCachedVariableLocations filter_prog[2][16]; - ProgramWithCachedVariableLocations blur_prog[MAX_TAPS + 1]; - ProgramWithCachedVariableLocations colormatrix; - ProgramWithCachedVariableLocations manual_clear; - - // vertex declarations - IDirect3DVertexDeclaration9* vdec[GDRAW_vformat__count]; - - // vertex shaders - ProgramWithCachedVariableLocations vert[GDRAW_vformat__count]; // [format] - - // render targets - GDrawHandleCache rendertargets; - GDrawHandle - rendertarget_handles[MAX_RENDER_STACK_DEPTH]; // not -1, because we use - // +1 to initialize - - gswf_recti rt_valid[MAX_RENDER_STACK_DEPTH + - 1]; // valid rect for texture clamping - - // size of our render targets - S32 frametex_width, frametex_height; - - // viewport setting (in pixels) for current frame - S32 vx, vy; - S32 fw, fh; // full width/height of virtual display - S32 tw, th; // actual width/height of current tile - S32 tpw, tph; // width/height of padded version of tile - - S32 tx0, ty0; - S32 tx0p, ty0p; - rrbool in_blur; - - F32 projection[4]; // scalex,scaley,transx,transy - rrbool use_3d; - F32 xform_3d[3][4]; - - IDirect3DSurface9* main_framebuffer; - IDirect3DSurface9* main_depthbuffer; - IDirect3DSurface9* rt_depthbuffer; // non-multisampled rendertarget depth - // buffer. only used when MSAA is on! - rrbool main_msaa; // does main framebuffer have MSAA enabled? - - IDirect3DTexture9* aa_tex; - - // scale factors converting worldspace to viewspace <0,0>.. - F32 world_to_pixel[2]; - - // cached state - U32 scissor_state; // ~0 if unknown, otherwise 0 or 1 - int blend_mode; // -1 if unknown, otherwise GDRAW_BLEND_* - U32 stencil_key; // field built from stencil test flags. 0=no stencil, ~0 - // is used for "unknown state" - U32 z_key; // same for z-writes/z-test - rrbool last_was_3d; - - // render-state stack described above for 'temporary' rendering - GDrawFramebufferState frame[MAX_RENDER_STACK_DEPTH]; - GDrawFramebufferState* cur; - - // texture and vertex buffer pools - GDrawHandleCache* texturecache; - GDrawHandleCache* vbufcache; - - // mipmapping - GDrawMipmapContext mipmap; - rrbool conditional_nonpow2; - - // stat tracking - rrbool frame_done; - U64 frame_counter; - - // error reporting - void(__cdecl* error_handler)(HRESULT hr); -} GDraw; - -static GDraw* gdraw; - -// not a real index buffer because we only get quads via user pointer -static U16 quad_ib[QUAD_IB_COUNT * 6]; - -//////////////////////////////////////////////////////////////////////// -// -// Error handling -// - -static void report_d3d_error(HRESULT hr, char* call, char* context) { - if (hr == E_OUTOFMEMORY) - IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, - context); - else - IggyGDrawSendWarning(NULL, "GDraw D3D error in %s%s: 0x%08x", call, - context, hr); -} - -//////////////////////////////////////////////////////////////////////// -// -// General resource management for both textures and vertex buffers -// - -template -static void safe_release(T*& p) { - if (p) { - p->Release(); - p = NULL; - } -} - -static void unbind_resources(void) { - IDirect3DDevice9* d3d = gdraw->d3d_device; - S32 i; - - // unset active textures and vertex/index buffers, - // to make sure there are no dangling refs - for (i = 0; i < 3; ++i) d3d->SetTexture(i, NULL); - - d3d->SetStreamSource(0, NULL, 0, 0); - d3d->SetIndices(NULL); -} - -static void api_free_resource(GDrawHandle* r) { - unbind_resources(); - if (r->state != GDRAW_HANDLE_STATE_user_owned) { - if (!r->cache->is_vertex) { - safe_release(r->handle.tex.d3d); - } else { - safe_release(r->handle.vbuf.base); - safe_release(r->handle.vbuf.indices); - } - } -} - -static void RADLINK gdraw_UnlockHandles(GDrawStats* /*stats*/) { - gdraw_HandleCacheUnlockAll(gdraw->texturecache); - gdraw_HandleCacheUnlockAll(gdraw->vbufcache); -} - -//////////////////////////////////////////////////////////////////////// -// -// Texture creation/updating/deletion -// - -extern GDrawTexture* gdraw_D3D_WrappedTextureCreate( - IDirect3DTexture9* texhandle) { - GDrawStats stats = {0}; - GDrawHandle* p = gdraw_res_alloc_begin( - gdraw->texturecache, 0, - &stats); // it may need to free one item to give us a handle - p->handle.tex.d3d = texhandle; - p->handle.tex.w = 1; - p->handle.tex.h = 1; - gdraw_HandleCacheAllocateEnd(p, 0, NULL, GDRAW_HANDLE_STATE_user_owned); - return (GDrawTexture*)p; -} - -extern void gdraw_D3D_WrappedTextureChange(GDrawTexture* tex, - IDirect3DTexture9* texhandle) { - GDrawHandle* p = (GDrawHandle*)tex; - p->handle.tex.d3d = texhandle; -} - -extern void gdraw_D3D_WrappedTextureDestroy(GDrawTexture* tex) { - GDrawStats stats = {0}; - gdraw_res_free((GDrawHandle*)tex, &stats); -} - -static void RADLINK gdraw_SetTextureUniqueID(GDrawTexture* tex, void* old_id, - void* new_id) { - GDrawHandle* p = (GDrawHandle*)tex; - // if this is still the handle it's thought to be, change the owner; - // if the owner *doesn't* match, then they're changing a stale handle, so - // ignore - if (p->owner == old_id) p->owner = new_id; -} - -static rrbool RADLINK gdraw_MakeTextureBegin( - void* owner, S32 width, S32 height, gdraw_texture_format format, U32 flags, - GDraw_MakeTexture_ProcessingInfo* p, GDrawStats* stats) { - GDrawHandle* t = NULL; - D3DFORMAT d3dfmt; - S32 bpp; - - if (format == GDRAW_TEXTURE_FORMAT_rgba32) { - d3dfmt = D3DFMT_A8R8G8B8; - bpp = 4; - } else { - d3dfmt = D3DFMT_A8; - bpp = 1; - } - - // compute estimated size of texture in video memory - S32 size = width * height * bpp; - if (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) - size = size * 4 / 3; // not correct for non-square - - // allocate a handle and make room in the cache for this much data - t = gdraw_res_alloc_begin(gdraw->texturecache, size, stats); - if (!t) return NULL; - - HRESULT hr = gdraw->d3d_device->CreateTexture( - width, height, (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) ? 0 : 1, 0, - d3dfmt, D3DPOOL_MANAGED, &t->handle.tex.d3d, NULL); - - if (FAILED(hr)) { - gdraw_HandleCacheAllocateFail(t); - IggyGDrawSendWarning( - NULL, "GDraw CreateTexture() call failed with error code 0x%08x", - hr); - return false; - } - - t->handle.tex.w = width; - t->handle.tex.h = height; - - gdraw_HandleCacheAllocateEnd(t, size, owner, - (flags & GDRAW_MAKETEXTURE_FLAGS_never_flush) - ? GDRAW_HANDLE_STATE_pinned - : GDRAW_HANDLE_STATE_locked); - stats->nonzero_flags |= GDRAW_STATS_alloc_tex; - stats->alloc_tex += 1; - stats->alloc_tex_bytes += size; - - p->texture_type = GDRAW_TEXTURE_TYPE_bgra; - p->p0 = t; - - if (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) { - rrbool ok; - assert(p->temp_buffer != NULL); - ok = gdraw_MipmapBegin(&gdraw->mipmap, width, height, - t->handle.tex.d3d->GetLevelCount(), bpp, - p->temp_buffer, p->temp_buffer_bytes); - assert(ok); // this should never trigger unless the temp_buffer is way - // too small - - p->p1 = &gdraw->mipmap; - p->texture_data = gdraw->mipmap.pixels[0]; - p->num_rows = gdraw->mipmap.bheight; - p->stride_in_bytes = gdraw->mipmap.pitch[0]; - p->i0 = 0; // current output y - p->i1 = bpp; - } else { - D3DLOCKED_RECT z; - hr = t->handle.tex.d3d->LockRect(0, &z, NULL, 0); - if (FAILED(hr)) { - t->handle.tex.d3d->Release(); - gdraw_HandleCacheAllocateFail(t); - - if (hr == E_OUTOFMEMORY) { - IggyGDrawSendWarning(NULL, - "GDraw out of texture memory allocating " - "%dx%d (%dbpp) texture", - width, height, 8 * bpp); - return false; - } else { - IggyGDrawSendWarning(NULL, - "GDraw LockRect for texture allocation " - "failed, D3D error 0x%08x\n", - hr); - return false; - } - } - - p->p1 = NULL; - p->texture_data = (U8*)z.pBits; - p->num_rows = height; - p->stride_in_bytes = z.Pitch; - } - - return true; -} - -static rrbool RADLINK -gdraw_MakeTextureMore(GDraw_MakeTexture_ProcessingInfo* p) { - GDrawHandle* t = (GDrawHandle*)p->p0; - - if (p->p1) { - GDrawMipmapContext* c = (GDrawMipmapContext*)p->p1; - U32 outy = p->i0; - U32 bpp = p->i1; - U32 width = c->width; - U32 height = c->height; - U32 bheight = c->bheight; - U32 level = 0; - - if (outy >= c->height) return false; - - do { - // upload data for this miplevel - D3DLOCKED_RECT z; - HRESULT hr = t->handle.tex.d3d->LockRect(level, &z, NULL, 0); - if (FAILED(hr)) return false; - - for (U32 y = 0; y < bheight; ++y) - memcpy((U8*)z.pBits + ((outy >> level) + y) * z.Pitch, - c->pixels[level] + y * c->pitch[level], width * bpp); - t->handle.tex.d3d->UnlockRect(level); - - // prepare next miplevel - width = RR_MAX(width >> 1, 1); - height = RR_MAX(height >> 1, 1); - bheight = RR_MAX(bheight >> 1, 1); - } while (gdraw_MipmapAddLines(c, ++level)); - - // prepare next chunk - p->i0 += p->num_rows; - p->texture_data = c->pixels[0]; - p->num_rows = c->bheight = RR_MIN(c->bheight, c->height - p->i0); - return true; - } else - return false; -} - -static GDrawTexture* RADLINK gdraw_MakeTextureEnd( - GDraw_MakeTexture_ProcessingInfo* p, GDrawStats* /*stats*/) { - GDrawHandle* t = (GDrawHandle*)p->p0; - if (p->p1) - gdraw_MakeTextureMore(p); // use more to upload the last batch of data - else - t->handle.tex.d3d->UnlockRect(0); - - return (GDrawTexture*)t; -} - -static rrbool RADLINK gdraw_UpdateTextureBegin(GDrawTexture* t, void* unique_id, - GDrawStats* /*stats*/) { - return gdraw_HandleCacheLock((GDrawHandle*)t, unique_id); -} - -static void RADLINK gdraw_UpdateTextureRect(GDrawTexture* t, - void* /*unique_id*/, S32 x, S32 y, - S32 stride, S32 w, S32 h, - U8* samples, - gdraw_texture_format format) { - GDrawHandle* s = (GDrawHandle*)t; - RECT rdest = {x, y, x + w, y + h}; - S32 i, bpl = (format == GDRAW_TEXTURE_FORMAT_font ? 1 : 4) * w; - D3DLOCKED_RECT lr; - - HRESULT hr = s->handle.tex.d3d->LockRect(0, &lr, &rdest, 0); - if (FAILED(hr)) { - IggyGDrawSendWarning( - 0, "GDraw LockRect() for texture update failed; D3D error 0x%08x", - hr); - return; - } - - for (i = 0; i < h; i++) - memcpy((U8*)lr.pBits + i * lr.Pitch, samples + i * stride, bpl); - - s->handle.tex.d3d->UnlockRect(0); -} - -static void RADLINK gdraw_UpdateTextureEnd(GDrawTexture* t, void* /*unique_id*/, - GDrawStats* /*stats*/) { - gdraw_HandleCacheUnlock((GDrawHandle*)t); -} - -static void RADLINK gdraw_FreeTexture(GDrawTexture* tt, void* unique_id, - GDrawStats* stats) { - GDrawHandle* t = (GDrawHandle*)tt; - assert(t != NULL); // @GDRAW_ASSERT - if (t->owner == unique_id || unique_id == NULL) { - if (t->cache == &gdraw->rendertargets) { - gdraw_HandleCacheUnlock(t); - // cache it by simply not freeing it - return; - } - - gdraw_res_free(t, stats); - } -} - -static rrbool RADLINK gdraw_TryToLockTexture(GDrawTexture* t, void* unique_id, - GDrawStats* /*stats*/) { - return gdraw_HandleCacheLock((GDrawHandle*)t, unique_id); -} - -static void RADLINK gdraw_DescribeTexture(GDrawTexture* tex, - GDraw_Texture_Description* desc) { - GDrawHandle* p = (GDrawHandle*)tex; - desc->width = p->handle.tex.w; - desc->height = p->handle.tex.h; - desc->size_in_bytes = p->bytes; -} - -static void RADLINK gdraw_SetAntialiasTexture(S32 width, U8* rgba) { - HRESULT hr; - D3DLOCKED_RECT lr; - S32 i; - U8* d; - - safe_release(gdraw->aa_tex); // release the old texture, if any. - - hr = gdraw->d3d_device->CreateTexture( - width, 1, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &gdraw->aa_tex, NULL); - if (FAILED(hr)) { - IggyGDrawSendWarning(0, "GDraw D3D error in CreateTexture 0x%08x", hr); - return; - } - - hr = gdraw->aa_tex->LockRect(0, &lr, NULL, 0); - if (!FAILED(hr)) { - d = (U8*)lr.pBits; - for (i = 0; i < width; i++) { - d[i * 4 + 0] = rgba[i * 4 + 2]; - d[i * 4 + 1] = rgba[i * 4 + 1]; - d[i * 4 + 2] = rgba[i * 4 + 0]; - d[i * 4 + 3] = rgba[i * 4 + 3]; - } - - gdraw->aa_tex->UnlockRect(0); - } else - IggyGDrawSendWarning( - 0, "GDraw D3D error in LockRect for texture creation: 0x%08x", hr); -} - -//////////////////////////////////////////////////////////////////////// -// -// Vertex buffer creation/deletion -// - -static rrbool RADLINK gdraw_MakeVertexBufferBegin( - void* unique_id, gdraw_vformat /*vformat*/, S32 vbuf_size, S32 ibuf_size, - GDraw_MakeVertexBuffer_ProcessingInfo* p, GDrawStats* stats) { - char* failed_call; - GDrawHandle* vb = - gdraw_res_alloc_begin(gdraw->vbufcache, vbuf_size + ibuf_size, stats); - if (!vb) return false; - - vb->handle.vbuf.base = NULL; - vb->handle.vbuf.indices = NULL; - - HRESULT hr; - hr = gdraw->d3d_device->CreateVertexBuffer(vbuf_size, D3DUSAGE_WRITEONLY, 0, - D3DPOOL_MANAGED, - &vb->handle.vbuf.base, NULL); - failed_call = "CreateVertexBuffer"; - if (!FAILED(hr)) { - hr = gdraw->d3d_device->CreateIndexBuffer( - ibuf_size, D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_MANAGED, - &vb->handle.vbuf.indices, NULL); - failed_call = "CreateIndexBuffer"; - } - if (!FAILED(hr)) { - hr = vb->handle.vbuf.base->Lock(0, vbuf_size, (void**)&p->vertex_data, - 0); - failed_call = "Lock"; - } - if (!FAILED(hr)) - hr = vb->handle.vbuf.indices->Lock(0, ibuf_size, (void**)&p->index_data, - 0); - - if (FAILED(hr)) { - if (vb->handle.vbuf.base) - vb->handle.vbuf.base - ->Unlock(); // does nothing if we didn't actually lock - - safe_release(vb->handle.vbuf.base); - safe_release(vb->handle.vbuf.indices); - - gdraw_HandleCacheAllocateFail(vb); - - report_d3d_error(hr, failed_call, " creating vertex buffer"); - return false; - } - - p->vertex_data_length = vbuf_size; - p->index_data_length = ibuf_size; - p->p0 = vb; - - gdraw_HandleCacheAllocateEnd(vb, vbuf_size + ibuf_size, unique_id, - GDRAW_HANDLE_STATE_locked); - return true; -} - -static rrbool RADLINK -gdraw_MakeVertexBufferMore(GDraw_MakeVertexBuffer_ProcessingInfo* /*p*/) { - assert(0); - return false; -} - -static GDrawVertexBuffer* RADLINK gdraw_MakeVertexBufferEnd( - GDraw_MakeVertexBuffer_ProcessingInfo* p, GDrawStats* /*stats*/) { - GDrawHandle* vb = (GDrawHandle*)p->p0; - vb->handle.vbuf.base->Unlock(); - vb->handle.vbuf.indices->Unlock(); - return (GDrawVertexBuffer*)vb; -} - -static rrbool RADLINK gdraw_TryLockVertexBuffer(GDrawVertexBuffer* vb, - void* unique_id, - GDrawStats* /*stats*/) { - return gdraw_HandleCacheLock((GDrawHandle*)vb, unique_id); -} - -static void RADLINK gdraw_FreeVertexBuffer(GDrawVertexBuffer* vb, - void* unique_id, GDrawStats* stats) { - GDrawHandle* h = (GDrawHandle*)vb; - assert(h != NULL); // @GDRAW_ASSERT - if (h->owner == unique_id) gdraw_res_free(h, stats); -} - -static void RADLINK gdraw_DescribeVertexBuffer( - GDrawVertexBuffer* vbuf, GDraw_VertexBuffer_Description* desc) { - GDrawHandle* p = (GDrawHandle*)vbuf; - desc->size_in_bytes = p->bytes; -} - -//////////////////////////////////////////////////////////////////////// -// -// Create/free (or cache) render targets -// - -static GDrawHandle* get_color_rendertarget(GDrawStats* stats) { - // try to recycle LRU rendertarget - GDrawHandle* t = gdraw_HandleCacheGetLRU(&gdraw->rendertargets); - if (t) { - gdraw_HandleCacheLock(t, (void*)1); - return t; - } - - // ran out of RTs, allocate a new one - S32 size = gdraw->frametex_width * gdraw->frametex_height * 4; - if (gdraw->rendertargets.bytes_free < size) { - IggyGDrawSendWarning( - NULL, - "GDraw rendertarget allocation failed: hit size limit of %d bytes", - gdraw->rendertargets.total_bytes); - return NULL; - } - - t = gdraw_HandleCacheAllocateBegin(&gdraw->rendertargets); - if (!t) { - IggyGDrawSendWarning( - NULL, "GDraw rendertarget allocation failed: hit handle limit"); - return t; - } - - HRESULT hr = gdraw->d3d_device->CreateTexture( - gdraw->frametex_width, gdraw->frametex_height, 1, D3DUSAGE_RENDERTARGET, - D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &t->handle.tex.d3d, NULL); - if (FAILED(hr)) { - report_d3d_error(hr, "CreateTexture", " creating rendertarget"); - gdraw_HandleCacheAllocateFail(t); - return NULL; - } - - gdraw_HandleCacheAllocateEnd(t, size, (void*)1, GDRAW_HANDLE_STATE_locked); - stats->nonzero_flags |= GDRAW_STATS_alloc_tex; - stats->alloc_tex += 1; - stats->alloc_tex_bytes += size; - - return t; -} - -static IDirect3DSurface9* get_rendertarget_depthbuffer(GDrawStats* stats) { - if (!gdraw->rt_depthbuffer) { - HRESULT hr = gdraw->d3d_device->CreateDepthStencilSurface( - gdraw->frametex_width, gdraw->frametex_height, D3DFMT_D24S8, - D3DMULTISAMPLE_NONE, 0, TRUE, &gdraw->rt_depthbuffer, NULL); - if (FAILED(hr)) - IggyGDrawSendWarning( - NULL, "GDraw D3D error in CreateDepthStencilSurface: 0x%08x", - hr); - else { - stats->nonzero_flags |= GDRAW_STATS_alloc_tex; - stats->alloc_tex += 1; - stats->alloc_tex_bytes += - gdraw->frametex_width * gdraw->frametex_height * 4; - } - } - - return gdraw->rt_depthbuffer; -} - -static void flush_rendertargets(GDrawStats* stats) { - gdraw_res_flush(&gdraw->rendertargets, stats); - safe_release(gdraw->rt_depthbuffer); -} - -//////////////////////////////////////////////////////////////////////// -// -// Vertex shader constants -// - -#define VVAR_world0 0 -#define VVAR_world1 1 -#define VVAR_count_worldonly \ - 2 // number of constants to send if you only changed world matrix - -#define VVAR_x_off 2 -#define VVAR_count_world_xoff \ - 3 // number of constants to send if you changed world+x_off - -#define VVAR_texgen_s 3 -#define VVAR_texgen_t 4 -#define VVAR_count \ - 5 // number of constants to send if you changed all per-batch state - -#define VVAR_x3d 5 -#define VVAR_y3d 6 -#define VVAR_z3d 7 -#define VVAR_count3d 8 - -// Fixed-location pixel shader constants -#define PVAR_cmul 0 -#define PVAR_cadd 1 -#define PVAR_focal 2 -#define PVAR_rescale1 3 - -struct VertexVars { - F32 world[2][4]; - F32 x_off[4]; - F32 texgen_s[4]; - F32 texgen_t[4]; - F32 viewproj[3][4]; -}; - -//////////////////////////////////////////////////////////////////////// -// -// Rendering helpers -// - -static void set_d3d_texture(U32 sampler, IDirect3DTexture9* tex, U32 wrap, - U32 nearest) { - static const int addrmodes[ASSERT_COUNT(GDRAW_WRAP__count, 4)] = { - D3DTADDRESS_CLAMP, // GDRAW_WRAP_clamp - D3DTADDRESS_WRAP, // GDRAW_WRAP_repeat - D3DTADDRESS_MIRROR, // GDRAW_WRAP_mirror - D3DTADDRESS_CLAMP, // GDRAW_WRAP_clamp_to_border (never used by client - // code!) - }; - - static const int filtermodes[2] = { - D3DTEXF_LINEAR, // !nearest - D3DTEXF_POINT, // nearest - }; - - assert(wrap < sizeof(addrmodes) / sizeof(addrmodes[0])); - assert(nearest < sizeof(filtermodes) / sizeof(filtermodes[0])); - IDirect3DDevice9* d3d = gdraw->d3d_device; - - d3d->SetTexture(sampler, tex); - d3d->SetSamplerState(sampler, D3DSAMP_MAGFILTER, filtermodes[nearest]); - d3d->SetSamplerState(sampler, D3DSAMP_ADDRESSU, addrmodes[wrap]); - d3d->SetSamplerState(sampler, D3DSAMP_ADDRESSV, addrmodes[wrap]); -} - -static void set_viewport_raw(S32 x, S32 y, S32 w, S32 h) { - D3DVIEWPORT9 vp = {x, y, w, h, 0.0f, 1.0f}; - gdraw->d3d_device->SetViewport(&vp); -} - -static void set_projection_base(void) { - F32 m[3][4] = {0}; - - // x3d = < viewproj.x, 0, 0, 0 > - // y3d = < 0, viewproj.y, 0, 0 > - // w3d = < viewproj.z, viewproj.w, 1.0, 1.0 > - - m[0][0] = gdraw->projection[0]; - m[1][1] = gdraw->projection[1]; - m[2][0] = gdraw->projection[2]; - m[2][1] = gdraw->projection[3]; - - m[2][2] = 1.0; - m[2][3] = 1.0; - - gdraw->d3d_device->SetVertexShaderConstantF(VVAR_x3d, m[0], 3); -} - -static void set_projection_raw(S32 x0, S32 x1, S32 y0, S32 y1) { - gdraw->projection[0] = 2.0f / (x1 - x0); - gdraw->projection[1] = 2.0f / (y1 - y0); - gdraw->projection[2] = - (x1 + x0) / (F32)(x0 - x1) - - 0.5f * gdraw->projection[0]; // -0.5f: convert from D3D9 to GL/D3D10 - // pixel coordinates - gdraw->projection[3] = - (y1 + y0) / (F32)(y0 - y1) - 0.5f * gdraw->projection[1]; - - set_projection_base(); -} - -static void set_viewport(void) { - if (gdraw->in_blur) { - set_viewport_raw(0, 0, gdraw->tpw, gdraw->tph); - return; - } - - if (gdraw->cur == gdraw->frame) // if the rendering stack is empty - // render a tile-sized region to the user-request tile location - set_viewport_raw(gdraw->vx, gdraw->vy, gdraw->tw, gdraw->th); - else if (gdraw->cur->cached) - set_viewport_raw(0, 0, gdraw->cur->width, gdraw->cur->height); - else - // if on the render stack, draw a padded-tile-sized region at the origin - set_viewport_raw(0, 0, gdraw->tpw, gdraw->tph); -} - -static void set_projection(void) { - if (gdraw->in_blur) return; - if (gdraw->cur == gdraw->frame) // if the render stack is empty - set_projection_raw(gdraw->tx0, gdraw->tx0 + gdraw->tw, - gdraw->ty0 + gdraw->th, gdraw->ty0); - else if (gdraw->cur->cached) - set_projection_raw( - gdraw->cur->base_x, gdraw->cur->base_x + gdraw->cur->width, - gdraw->cur->base_y, gdraw->cur->base_y + gdraw->cur->height); - else - set_projection_raw(gdraw->tx0p, gdraw->tx0p + gdraw->tpw, - gdraw->ty0p + gdraw->tph, gdraw->ty0p); -} - -static void set_common_renderstate() { - IDirect3DDevice9* d3d = gdraw->d3d_device; - S32 i; - - // all the render states we never change while drawing - d3d->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - d3d->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - d3d->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); - d3d->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE); - d3d->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_EQUAL); - d3d->SetRenderState(D3DRS_STENCILREF, 255); - d3d->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - d3d->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, 0); - d3d->SetRenderState(D3DRS_DEPTHBIAS, 0); - d3d->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD); - d3d->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); - - for (i = 0; i < 3; i++) { - d3d->SetTextureStageState(i, D3DTSS_TEXCOORDINDEX, i); - d3d->SetTextureStageState(i, D3DTSS_TEXTURETRANSFORMFLAGS, - D3DTTFF_DISABLE); - d3d->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); - d3d->SetSamplerState(i, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); - d3d->SetSamplerState(i, D3DSAMP_MIPMAPLODBIAS, 0); - d3d->SetSamplerState(i, D3DSAMP_MAXMIPLEVEL, 0); - } - - d3d->SetTextureStageState(AATEX_SAMPLER, D3DTSS_TEXCOORDINDEX, - AATEX_SAMPLER); - - d3d->SetTexture(AATEX_SAMPLER, gdraw->aa_tex); - d3d->SetSamplerState(AATEX_SAMPLER, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); - d3d->SetSamplerState(AATEX_SAMPLER, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); - d3d->SetSamplerState(AATEX_SAMPLER, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); - d3d->SetSamplerState(AATEX_SAMPLER, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); - d3d->SetSamplerState(AATEX_SAMPLER, D3DSAMP_MIPMAPLODBIAS, 0); - d3d->SetSamplerState(AATEX_SAMPLER, D3DSAMP_MAXMIPLEVEL, 0); - - // reset our state caching - gdraw->scissor_state = ~0u; - gdraw->blend_mode = -1; - gdraw->stencil_key = ~0u; - gdraw->z_key = ~0u; - - VertexVars vvars = {0}; - d3d->SetVertexShaderConstantF(0, vvars.world[0], VVAR_count); -} - -static void clear_renderstate(void) { - IDirect3DDevice9* d3d = gdraw->d3d_device; - - d3d->SetTexture(0, NULL); - d3d->SetTexture(1, NULL); - d3d->SetTexture(2, NULL); - d3d->SetTexture(AATEX_SAMPLER, NULL); - d3d->SetStreamSource(0, NULL, 0, 0); - d3d->SetIndices(NULL); - - d3d->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - d3d->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS); - d3d->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); - d3d->SetRenderState(D3DRS_COLORWRITEENABLE, 0xf); - d3d->SetRenderState(D3DRS_STENCILENABLE, FALSE); - d3d->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); - - d3d->SetVertexShader(0); - d3d->SetPixelShader(0); - d3d->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - d3d->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); -} - -static void clear_zbuffer(IDirect3DSurface9* surf, U32 flags) { - IDirect3DDevice9* d3d = gdraw->d3d_device; - IDirect3DSurface9* target; - D3DSURFACE_DESC desc; - surf->GetDesc(&desc); - - // here's where it gets stupid: we need a rendertarget that's - // big enough so we can actually clear the full z-buffer. - // we don't actually render to it or anything, we just need to - // set it... - target = gdraw->main_framebuffer; - if (surf != gdraw->main_depthbuffer) { - // tile surface could, in theory, be larger than main framebuffer, so - // check if we have at least one rendertarget matching the rt depth - // buffer created and use that while clearing if possible - S32 i; - for (i = 0; i < MAX_RENDER_STACK_DEPTH; ++i) - if (gdraw->rendertargets.handle[i].handle.tex.d3d) { - gdraw->rendertargets.handle[i].handle.tex.d3d->GetSurfaceLevel( - 0, &target); - break; - } - } - - D3DVIEWPORT9 vp = {0, 0, desc.Width, desc.Height, 0.0f, 1.0f}; - d3d->SetRenderTarget(0, target); - d3d->SetDepthStencilSurface(surf); - d3d->SetViewport(&vp); - d3d->Clear(0, NULL, flags, 0, 1.0f, 0); - - if (target != gdraw->main_framebuffer) target->Release(); -} - -//////////////////////////////////////////////////////////////////////// -// -// Begin/end rendering of a tile and per-frame processing -// - -void gdraw_D3D_SetTileOrigin(IDirect3DSurface9* rt, IDirect3DSurface9* depth, - S32 x, S32 y) { - D3DSURFACE_DESC desc; - - if (gdraw->frame_done) { - ++gdraw->frame_counter; - gdraw->frame_done = false; - } - - rt->GetDesc(&desc); - - gdraw->main_framebuffer = rt; - gdraw->main_depthbuffer = depth; - gdraw->main_msaa = (desc.MultiSampleType != D3DMULTISAMPLE_NONE); - gdraw->vx = x; - gdraw->vy = y; -} - -static void RADLINK gdraw_SetViewSizeAndWorldScale(S32 w, S32 h, F32 scale_x, - F32 scale_y) { - memset(gdraw->frame, 0, sizeof(gdraw->frame)); - gdraw->cur = gdraw->frame; - gdraw->fw = w; - gdraw->fh = h; - gdraw->tw = w; - gdraw->th = h; - gdraw->world_to_pixel[0] = scale_x; - gdraw->world_to_pixel[1] = scale_y; - - set_viewport(); -} - -static void RADLINK gdraw_Set3DTransform(F32* mat) { - if (mat == NULL) - gdraw->use_3d = 0; - else { - gdraw->use_3d = 1; - memcpy(gdraw->xform_3d, mat, sizeof(gdraw->xform_3d)); - } -} - -// must include anything necessary for texture creation/update -static void RADLINK gdraw_RenderingBegin(void) {} -static void RADLINK gdraw_RenderingEnd(void) {} - -static void RADLINK gdraw_RenderTileBegin(S32 x0, S32 y0, S32 x1, S32 y1, - S32 pad, GDrawStats* stats) { - if (x0 == 0 && y0 == 0 && x1 == gdraw->fw && y1 == gdraw->fh) pad = 0; - - gdraw->tx0 = x0; - gdraw->ty0 = y0; - gdraw->tw = x1 - x0; - gdraw->th = y1 - y0; - - // padded region - gdraw->tx0p = RR_MAX(x0 - pad, 0); - gdraw->ty0p = RR_MAX(y0 - pad, 0); - gdraw->tpw = RR_MIN(x1 + pad, gdraw->fw) - gdraw->tx0p; - gdraw->tph = RR_MIN(y1 + pad, gdraw->fh) - gdraw->ty0p; - - // just record the max, but then when we texture from, we have to use - // sub-regions -- alternatively, each gdraw gets its own rendertargets - if (gdraw->tpw > gdraw->frametex_width || - gdraw->tph > gdraw->frametex_height) { - gdraw->frametex_width = RR_MAX(gdraw->tpw, gdraw->frametex_width); - gdraw->frametex_height = RR_MAX(gdraw->tph, gdraw->frametex_height); - - flush_rendertargets(stats); - } - - // clear our depth buffers - clear_zbuffer(gdraw->main_depthbuffer, D3DCLEAR_STENCIL | D3DCLEAR_ZBUFFER); - if (gdraw->rt_depthbuffer) - clear_zbuffer(gdraw->rt_depthbuffer, - D3DCLEAR_STENCIL | D3DCLEAR_ZBUFFER); - - // set our rendertarget - gdraw->d3d_device->SetRenderTarget(0, gdraw->main_framebuffer); - gdraw->d3d_device->SetDepthStencilSurface(gdraw->main_depthbuffer); - set_viewport(); - set_projection(); - set_common_renderstate(); -} - -static void RADLINK gdraw_RenderTileEnd(GDrawStats* /*stats*/) {} - -void gdraw_D3D_SetRendertargetSize(S32 w, S32 h) { - if (gdraw && (w != gdraw->frametex_width || h != gdraw->frametex_height)) { - GDrawStats stats = {0}; - gdraw->frametex_width = w; - gdraw->frametex_height = h; - flush_rendertargets(&stats); - } -} - -void gdraw_D3D_NoMoreGDrawThisFrame(void) { - clear_renderstate(); - if (gdraw->main_framebuffer) - gdraw->d3d_device->SetRenderTarget(0, gdraw->main_framebuffer); - if (gdraw->main_depthbuffer) - gdraw->d3d_device->SetDepthStencilSurface(gdraw->main_depthbuffer); - gdraw->frame_done = true; - - GDrawFence now = {gdraw->frame_counter}; - gdraw_HandleCacheTick(gdraw->texturecache, now); - gdraw_HandleCacheTick(gdraw->vbufcache, now); -} - -#define MAX_DEPTH_VALUE (1 << 13) - -static void RADLINK gdraw_GetInfo(GDrawInfo* d) { - D3DCAPS9 caps; - gdraw->d3d_device->GetDeviceCaps(&caps); - - d->num_stencil_bits = 8; - d->max_id = MAX_DEPTH_VALUE - 2; - // for floating point depth, just use mantissa, e.g. 16-20 bits - d->max_texture_size = RR_MIN(caps.MaxTextureWidth, caps.MaxTextureHeight); - d->buffer_format = GDRAW_BFORMAT_vbib; - d->shared_depth_stencil = 1; - d->always_mipmap = 1; - d->conditional_nonpow2 = - (caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) != 0; -} - -//////////////////////////////////////////////////////////////////////// -// -// Enable/disable rendertargets in stack fashion -// - -static void set_render_target(GDrawStats* stats) { - IDirect3DSurface9 *target = NULL, *depth = NULL; - - if (gdraw->cur->color_buffer) { - S32 need_depth; - need_depth = - (gdraw->cur->flags & (GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_id | - GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_stencil)); - - unbind_resources(); // to make sure this RT isn't accidentally set as a - // texture (avoid D3D warnings) - gdraw->cur->color_buffer->handle.tex.d3d->GetSurfaceLevel( - 0, &target); // if this fails, there's nothing to be done - if (need_depth) { - if (gdraw->main_msaa) - depth = get_rendertarget_depthbuffer( - stats); // @TODO: is this right? get_rt_depthbuffer doesn't - // seem to do MSAA - else { - // if tile is smaller than frametex, then trying to use the - // tile's zbuffer may not work - if (gdraw->tw < gdraw->frametex_width || - gdraw->th < gdraw->frametex_height) - depth = get_rendertarget_depthbuffer(stats); - else - depth = gdraw->main_depthbuffer; - } - } - } else { - target = gdraw->main_framebuffer; - depth = gdraw->main_depthbuffer; - } - - gdraw->d3d_device->SetRenderTarget(0, target); - gdraw->d3d_device->SetDepthStencilSurface(depth); - if (target != gdraw->main_framebuffer) target->Release(); - - stats->nonzero_flags |= GDRAW_STATS_rendtarg; - stats->rendertarget_changes += 1; -} - -static rrbool RADLINK gdraw_TextureDrawBufferBegin( - gswf_recti* region, gdraw_texture_format /*format*/, U32 flags, void* owner, - GDrawStats* stats) { - GDrawFramebufferState* n = gdraw->cur + 1; - GDrawHandle* t; - if (gdraw->tw == 0 || gdraw->th == 0) return false; - - if (n >= &gdraw->frame[MAX_RENDER_STACK_DEPTH]) { - IggyGDrawSendWarning( - NULL, "GDraw rendertarget nesting exceeds MAX_RENDER_STACK_DEPTH"); - return false; - } - - if (owner) { - S32 w = region->x1 - region->x0; - S32 h = region->y1 - region->y0; - - // allocate a texture handle and free enough texture space - t = gdraw_res_alloc_begin(gdraw->texturecache, w * h * 4, stats); - if (!t) - return false; - else { - IDirect3DTexture9* tex; - HRESULT hr = gdraw->d3d_device->CreateTexture( - w, h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, - D3DPOOL_DEFAULT, &tex, NULL); - - if (FAILED(hr)) { - if (t) gdraw_HandleCacheAllocateFail(t); - IggyGDrawSendWarning(NULL, - "GDraw D3D error for CreateTexture for " - "cacheAsBitmap rendertarget: 0x%08x", - hr); - return false; - } - - stats->nonzero_flags |= GDRAW_STATS_alloc_tex; - stats->alloc_tex += 1; - stats->alloc_tex_bytes += w * h * 4; - - gdraw_HandleCacheAllocateEnd(t, w * h * 4, (void*)1, - GDRAW_HANDLE_STATE_locked); - } - } else { - t = get_color_rendertarget(stats); - if (!t) return false; - } - - n->flags = flags; - n->color_buffer = t; - assert(n->color_buffer != NULL); // @GDRAW_ASSERT - - ++gdraw->cur; - gdraw->cur->cached = owner != NULL; - if (owner) { - gdraw->cur->base_x = region->x0; - gdraw->cur->base_y = region->y0; - gdraw->cur->width = region->x1 - region->x0; - gdraw->cur->height = region->y1 - region->y0; - } - - set_render_target(stats); - assert(gdraw->frametex_width >= gdraw->tw && - gdraw->frametex_height >= gdraw->th); // @GDRAW_ASSERT - set_viewport(); - set_projection(); - - int k = (int)(t - gdraw->rendertargets.handle); - - if (region) { - D3DRECT r; - S32 ox, oy, pad = 2; // 2 pixels of border on all sides - // 1 pixel turns out to be not quite enough with the interpolator - // precision we get. - - if (gdraw->in_blur) - ox = oy = 0; - else - ox = gdraw->tx0p, oy = gdraw->ty0p; - - // clamp region to tile - S32 xt0 = RR_MAX(region->x0 - ox, 0); - S32 yt0 = RR_MAX(region->y0 - oy, 0); - S32 xt1 = RR_MIN(region->x1 - ox, gdraw->tpw); - S32 yt1 = RR_MIN(region->y1 - oy, gdraw->tph); - - // but the padding needs to clamp to render target bounds - r.x1 = RR_MAX(xt0 - pad, 0); - r.y1 = RR_MAX(yt0 - pad, 0); - r.x2 = RR_MIN(xt1 + pad, gdraw->frametex_width); - r.y2 = RR_MIN(yt1 + pad, gdraw->frametex_height); - - if (r.x2 <= r.x1 || - r.y2 <= r.y1) { // region doesn't intersect with current tile - --gdraw->cur; - gdraw_FreeTexture((GDrawTexture*)t, 0, stats); - // note: don't send a warning since this will happen during regular - // tiled rendering - return false; - } - - gdraw->d3d_device->Clear(1, &r, D3DCLEAR_TARGET, 0, 1, 0); - gdraw->rt_valid[k].x0 = xt0; - gdraw->rt_valid[k].y0 = yt0; - gdraw->rt_valid[k].x1 = xt1; - gdraw->rt_valid[k].y1 = yt1; - } else { - gdraw->d3d_device->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1, 0); - gdraw->rt_valid[k].x0 = 0; - gdraw->rt_valid[k].y0 = 0; - gdraw->rt_valid[k].x1 = gdraw->frametex_width; - gdraw->rt_valid[k].y1 = gdraw->frametex_height; - } - - return true; -} - -static GDrawTexture* RADLINK gdraw_TextureDrawBufferEnd(GDrawStats* stats) { - GDrawFramebufferState* n = gdraw->cur; - GDrawFramebufferState* m = --gdraw->cur; - - if (gdraw->tw == 0 || gdraw->th == 0) return 0; - - if (n >= &gdraw->frame[MAX_RENDER_STACK_DEPTH]) - return 0; // already returned a warning in Begin - - assert(m >= gdraw->frame); // bug in Iggy -- unbalanced - - if (m != gdraw->frame) { - assert(m->color_buffer != NULL); // @GDRAW_ASSERT - } - assert(n->color_buffer != NULL); // @GDRAW_ASSERT - - // switch back to old render target - set_render_target(stats); - - // if we're at the root, set the viewport back - set_viewport(); - set_projection(); - - return (GDrawTexture*)n->color_buffer; -} - -//////////////////////////////////////////////////////////////////////// -// -// Clear stencil/depth buffers -// -// Open question whether we'd be better off finding bounding boxes -// and only clearing those; it depends exactly how fast clearing works. -// - -static void clear_renderstate_acceleration_cache(void) { - gdraw->last_was_3d = false; - gdraw->scissor_state = ~0u; - gdraw->stencil_key = 0; - gdraw->blend_mode = ~0u; -} - -static void do_screen_quad(gswf_recti* s, F32* tc, GDrawStats* stats); - -static void RADLINK gdraw_ClearStencilBits(U32 bits) { - IDirect3DDevice9* d3d = gdraw->d3d_device; - F32 texcoord[8] = {0}; - GDrawStats stats = {0}; - gswf_recti region; - - region.x0 = 0; - region.y0 = 0; - region.x1 = gdraw->frametex_width; - region.y1 = gdraw->frametex_height; - - d3d->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - d3d->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); - d3d->SetRenderState(D3DRS_STENCILWRITEMASK, bits); - d3d->SetRenderState(D3DRS_STENCILENABLE, TRUE); - // fewest states to force it to always write: make the stencil test always - // fail - d3d->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_NEVER); - d3d->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE); - d3d->SetRenderState(D3DRS_STENCILREF, 0); - d3d->SetRenderState(D3DRS_COLORWRITEENABLE, FALSE); - d3d->SetRenderState(D3DRS_ZENABLE, FALSE); - d3d->SetRenderState(D3DRS_ZFUNC, FALSE); - d3d->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - - d3d->SetPixelShader(gdraw->manual_clear.pshader); - do_screen_quad(®ion, texcoord, &stats); - - // restore state from set_common_renderstate - d3d->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - d3d->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_EQUAL); - d3d->SetRenderState(D3DRS_STENCILREF, 255); - - // make next renderstate reset other state - clear_renderstate_acceleration_cache(); - - // reset matrices et al - set_render_target(&stats); - set_viewport(); - set_projection(); -} - -// this only happens rarely (hopefully never) if we use the depth buffer, -// so we can just clear the whole thing -static void RADLINK gdraw_ClearID(void) { - GDrawStats stats = {0}; - - clear_zbuffer(gdraw->main_depthbuffer, D3DCLEAR_ZBUFFER); - set_render_target(&stats); - set_viewport(); - set_projection(); -} - -//////////////////////////////////////////////////////////////////////// -// -// Set all the render state from GDrawRenderState -// -// This also is responsible for getting the framebuffer into a texture -// if the read-modify-write blend operation can't be expressed with -// the native blend operators. (E.g. "screen") -// - -// convert an ID request to a value suitable for the depth buffer, -// assuming the depth buffer has been mappped to 0..1 -static F32 depth_from_id(S32 id) { - return 1.0f - ((F32)id + 1.0f) / MAX_DEPTH_VALUE; -} - -static void set_texture(S32 texunit, GDrawTexture* tex) { - if (texunit >= 0) - set_d3d_texture(texunit, ((GDrawHandle*)tex)->handle.tex.d3d, - GDRAW_WRAP_clamp, 0); -} - -static int set_renderstate_full(S32 vertex_format, GDrawRenderState* r, - GDrawStats* /*stats*/) { - IDirect3DDevice9* d3d = gdraw->d3d_device; - U32 stencil_key, z_key; - F32 depth = depth_from_id(r->id); - VertexVars vvars; - int vvarcount = VVAR_count_world_xoff; - - // set vertex shader - d3d->SetVertexShader(gdraw->vert[vertex_format].vshader); - - // set vertex shader constants - if (!r->use_world_space) - gdraw_ObjectSpace(vvars.world[0], r->o2w, depth, 0.0f); - else - gdraw_WorldSpace(vvars.world[0], gdraw->world_to_pixel, depth, 0.0f); - - memcpy(&vvars.x_off, r->edge_matrix, 4 * sizeof(F32)); - - if (r->texgen0_enabled) { - memcpy(&vvars.texgen_s, r->s0_texgen, 4 * sizeof(F32)); - memcpy(&vvars.texgen_t, r->t0_texgen, 4 * sizeof(F32)); - vvarcount = VVAR_count; - } - - if (gdraw->use_3d || gdraw->last_was_3d) { - if (gdraw->use_3d) { - vvarcount = VVAR_count3d; - memcpy(&vvars.viewproj, gdraw->xform_3d, 12 * sizeof(F32)); - } else - set_projection_base(); - gdraw->last_was_3d = gdraw->use_3d; - } - - d3d->SetVertexShaderConstantF(0, vvars.world[0], vvarcount); - - // set the blend mode - int blend_mode = r->blend_mode; - int tex0mode = r->tex0_mode; - - static struct gdraw_d3d_blendspec { - BOOL enable; - D3DBLEND src; - D3DBLEND dest; - } blends[ASSERT_COUNT(GDRAW_BLEND__count, 6)] = { - FALSE, - D3DBLEND_ONE, - D3DBLEND_ZERO, // GDRAW_BLEND_none - TRUE, - D3DBLEND_ONE, - D3DBLEND_INVSRCALPHA, // GDRAW_BLEND_alpha - TRUE, - D3DBLEND_DESTCOLOR, - D3DBLEND_INVSRCALPHA, // GDRAW_BLEND_multiply - TRUE, - D3DBLEND_ONE, - D3DBLEND_ONE, // GDRAW_BLEND_add - - FALSE, - D3DBLEND_ONE, - D3DBLEND_ZERO, // GDRAW_BLEND_filter - FALSE, - D3DBLEND_ONE, - D3DBLEND_ZERO, // GDRAW_BLEND_special - }; - assert(blend_mode >= 0 && blend_mode < sizeof(blends) / sizeof(*blends)); - - if (blend_mode != gdraw->blend_mode) { - gdraw->blend_mode = blend_mode; - if (blends[blend_mode].enable) { - d3d->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - d3d->SetRenderState(D3DRS_SRCBLEND, blends[blend_mode].src); - d3d->SetRenderState(D3DRS_DESTBLEND, blends[blend_mode].dest); - } else - d3d->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - } - - // set the pixel shader - IDirect3DPixelShader9* pshader; - if (blend_mode != GDRAW_BLEND_special) { - assert(tex0mode >= 0 && - tex0mode < sizeof(gdraw->fprog) / sizeof(*gdraw->fprog)); - - int additive = 0; - if (r->cxf_add) { - additive = 1; - if (r->cxf_add[3]) additive = 2; - } - - pshader = gdraw->fprog[tex0mode][additive].pshader; - } else - pshader = gdraw->exceptional_blend[r->special_blend].pshader; - - d3d->SetPixelShader(pshader); - - // set textures - if (tex0mode != GDRAW_TEXTURE_none) { - if (!r->tex[0]) return 0; - set_d3d_texture(0, ((GDrawHandle*)r->tex[0])->handle.tex.d3d, r->wrap0, - r->nearest0); - } - - // set pixel shader constants - d3d->SetPixelShaderConstantF(PVAR_cmul, r->color, 1); - - if (r->cxf_add) { - F32 temp[4] = {r->cxf_add[0] / 255.0f, r->cxf_add[1] / 255.0f, - r->cxf_add[2] / 255.0f, r->cxf_add[3] / 255.0f}; - d3d->SetPixelShaderConstantF(PVAR_cadd, temp, 1); - } - - if (tex0mode == GDRAW_TEXTURE_focal_gradient) - d3d->SetPixelShaderConstantF(PVAR_focal, r->focal_point, 1); - - // Set pixel operation states - gdraw->scissor_state = ~0u; - if (r->scissor) { - RECT s; - gdraw->scissor_state = r->scissor; - if (gdraw->cur == gdraw->frame) { - s.left = r->scissor_rect.x0 + gdraw->vx - gdraw->tx0; - s.top = r->scissor_rect.y0 + gdraw->vy - gdraw->ty0; - s.right = r->scissor_rect.x1 + gdraw->vx - gdraw->tx0; - s.bottom = r->scissor_rect.y1 + gdraw->vy - gdraw->ty0; - } else { - s.left = r->scissor_rect.x0 - gdraw->tx0p; - s.top = r->scissor_rect.y0 - gdraw->ty0p; - s.right = r->scissor_rect.x1 - gdraw->tx0p; - s.bottom = r->scissor_rect.y1 - gdraw->ty0p; - } - d3d->SetScissorRect(&s); - d3d->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE); - } else { - if (r->scissor != gdraw->scissor_state) { - gdraw->scissor_state = r->scissor; - d3d->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); - } - } - - // stencil changed? - stencil_key = r->stencil_test | (r->stencil_set << 8); - if (stencil_key != gdraw->stencil_key) { - gdraw->stencil_key = stencil_key; - - d3d->SetRenderState(D3DRS_STENCILMASK, r->stencil_test); - d3d->SetRenderState(D3DRS_STENCILWRITEMASK, r->stencil_set); - d3d->SetRenderState(D3DRS_STENCILENABLE, - (r->stencil_set | r->stencil_test) != 0); - d3d->SetRenderState(D3DRS_COLORWRITEENABLE, r->stencil_set ? 0x0 : 0xf); - } - - // z key - z_key = r->set_id | (r->test_id << 1); - if (z_key != gdraw->z_key) { - gdraw->z_key = z_key; - d3d->SetRenderState( - D3DRS_ZENABLE, (r->test_id | r->set_id) ? D3DZB_TRUE : D3DZB_FALSE); - d3d->SetRenderState(D3DRS_ZFUNC, - r->test_id ? D3DCMP_LESS : D3DCMP_ALWAYS); - d3d->SetRenderState(D3DRS_ZWRITEENABLE, r->set_id); - } - - return 1; -} - -static RADINLINE int set_renderstate(S32 vertex_format, GDrawRenderState* r, - GDrawStats* stats) { - if (r->identical_state) { - // fast path: only need to change vertex shader, other state is the same - gdraw->d3d_device->SetVertexShader(gdraw->vert[vertex_format].vshader); - return 1; - } else - return set_renderstate_full(vertex_format, r, stats); -} - -//////////////////////////////////////////////////////////////////////// -// -// Vertex formats -// - -static D3DVERTEXELEMENT9 vformat_v2[] = { - {0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END()}; - -static D3DVERTEXELEMENT9 vformat_v2aa[] = { - {0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_POSITION, 0}, - {0, 8, D3DDECLTYPE_SHORT4, 0, D3DDECLUSAGE_TEXCOORD, 0}, - D3DDECL_END()}; - -static D3DVERTEXELEMENT9 vformat_v2tc2[] = { - {0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_POSITION, 0}, - {0, 8, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0}, - D3DDECL_END()}; - -static D3DVERTEXELEMENT9* vformats[ASSERT_COUNT(GDRAW_vformat__count, 3)] = { - vformat_v2, // GDRAW_vformat_v2 - vformat_v2aa, // GDRAW_vformat_v2aa - vformat_v2tc2, // GDRAW_vformat_v2tc2 -}; - -static int vertsize[ASSERT_COUNT(GDRAW_vformat__count, 3)] = { - 8, // GDRAW_vformat_v2 - 16, // GDRAW_vformat_v2aa - 16, // GDRAW_vformat_v2tc2 -}; - -//////////////////////////////////////////////////////////////////////// -// -// Draw triangles with a given renderstate -// - -static void tag_resources(void* r1, void* r2 = NULL, void* r3 = NULL, - void* r4 = NULL) { - U64 now = gdraw->frame_counter; - if (r1) ((GDrawHandle*)r1)->fence.value = now; - if (r2) ((GDrawHandle*)r2)->fence.value = now; - if (r3) ((GDrawHandle*)r3)->fence.value = now; - if (r4) ((GDrawHandle*)r4)->fence.value = now; -} - -static void RADLINK gdraw_DrawIndexedTriangles(GDrawRenderState* r, - GDrawPrimitive* p, - GDrawVertexBuffer* buf, - GDrawStats* stats) { - GDrawHandle* vb = (GDrawHandle*)buf; - int vfmt = p->vertex_format; - assert(vfmt >= 0 && vfmt < GDRAW_vformat__count); - - if (!set_renderstate(vfmt, r, stats)) return; - - gdraw->d3d_device->SetVertexDeclaration(gdraw->vdec[vfmt]); - - if (vb) { - gdraw->d3d_device->SetIndices(vb->handle.vbuf.indices); - gdraw->d3d_device->SetStreamSource( - 0, vb->handle.vbuf.base, (U32)(UINTa)p->vertices, vertsize[vfmt]); - - gdraw->d3d_device->DrawIndexedPrimitive( - D3DPT_TRIANGLELIST, 0, 0, p->num_vertices, - (U32)((UINTa)p->indices) >> 1, p->num_indices / 3); - - gdraw->d3d_device->SetStreamSource(0, 0, 0, 0); - gdraw->d3d_device->SetIndices(0); - } else if (p->indices) { - gdraw->d3d_device->DrawIndexedPrimitiveUP( - D3DPT_TRIANGLELIST, 0, p->num_vertices, p->num_indices / 3, - p->indices, D3DFMT_INDEX16, p->vertices, vertsize[vfmt]); - } else { // dynamic quads - assert(p->num_vertices % 4 == 0); - UINT stride = vertsize[vfmt]; - S32 pos = 0; - while (pos < p->num_vertices) { - S32 vert_count = RR_MIN(p->num_vertices - pos, QUAD_IB_COUNT * 4); - gdraw->d3d_device->DrawIndexedPrimitiveUP( - D3DPT_TRIANGLELIST, 0, vert_count, (vert_count / 4) * 2, - quad_ib, D3DFMT_INDEX16, (U8*)p->vertices + pos * stride, - stride); - pos += vert_count; - } - } - - tag_resources(vb, r->tex[0], r->tex[1]); - - stats->nonzero_flags |= GDRAW_STATS_batches; - stats->num_batches += 1; - stats->drawn_indices += p->num_indices; - stats->drawn_vertices += p->num_vertices; -} - -/////////////////////////////////////////////////////////////////////// -// -// Flash 8 filter effects -// - -static void set_pixel_constant(S32 constant, F32 x, F32 y, F32 z, F32 w) { - if (constant >= 0) { - F32 value[4] = {x, y, z, w}; - gdraw->d3d_device->SetPixelShaderConstantF(constant, value, 1); - } -} - -// caller sets up texture coordinates -static void do_screen_quad(gswf_recti* s, F32* tc, GDrawStats* stats) { - F32 px0 = (F32)s->x0, py0 = (F32)s->y0, px1 = (F32)s->x1, py1 = (F32)s->y1; - gswf_vertex_xyst vert[4]; - VertexVars vvars; - - // interleave the data so we can use UP - vert[0].x = px0; - vert[0].y = py0; - vert[0].s = tc[0]; - vert[0].t = tc[1]; - vert[1].x = px1; - vert[1].y = py0; - vert[1].s = tc[2]; - vert[1].t = tc[1]; - vert[2].x = px1; - vert[2].y = py1; - vert[2].s = tc[2]; - vert[2].t = tc[3]; - vert[3].x = px0; - vert[3].y = py1; - vert[3].s = tc[0]; - vert[3].t = tc[3]; - - gdraw_PixelSpace(vvars.world[0]); - - gdraw->d3d_device->SetVertexDeclaration(gdraw->vdec[GDRAW_vformat_v2tc2]); - gdraw->d3d_device->SetVertexShader( - gdraw->vert[GDRAW_vformat_v2tc2].vshader); - gdraw->d3d_device->SetVertexShaderConstantF(0, vvars.world[0], - VVAR_count_worldonly); - gdraw->d3d_device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vert, 16); - - stats->nonzero_flags |= GDRAW_STATS_batches; - stats->num_batches += 1; - stats->drawn_indices += 6; - stats->drawn_vertices += 4; -} - -static void gdraw_DriverBlurPass(GDrawRenderState* r, int taps, float* data, - gswf_recti* s, float* tc, float /*height_max*/, - float* clamp, GDrawStats* gstats) { - ProgramWithCachedVariableLocations* prg = &gdraw->blur_prog[taps]; - gdraw->d3d_device->SetPixelShader(prg->pshader); - set_texture(prg->vars[VAR_blur_tex0], r->tex[0]); - - assert(prg->vars[VAR_blur_tap] >= 0); - gdraw->d3d_device->SetPixelShaderConstantF(prg->vars[VAR_blur_tap], data, - taps); - gdraw->d3d_device->SetPixelShaderConstantF(prg->vars[VAR_blur_clampv], - clamp, 1); - - do_screen_quad(s, tc, gstats); - tag_resources(r->tex[0]); -} - -static void gdraw_Colormatrix(GDrawRenderState* r, gswf_recti* s, float* tc, - GDrawStats* stats) { - if (!gdraw_TextureDrawBufferBegin( - s, GDRAW_TEXTURE_FORMAT_rgba32, - GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | - GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, - 0, stats)) - return; - - gdraw->d3d_device->SetPixelShader(gdraw->colormatrix.pshader); - set_texture(gdraw->colormatrix.vars[VAR_colormatrix_tex0], r->tex[0]); - gdraw->d3d_device->SetPixelShaderConstantF( - gdraw->colormatrix.vars[VAR_colormatrix_data], r->shader_data, 5); - do_screen_quad(s, tc, stats); - tag_resources(r->tex[0]); - r->tex[0] = gdraw_TextureDrawBufferEnd(stats); -} - -static gswf_recti* get_valid_rect(GDrawTexture* tex) { - GDrawHandle* h = (GDrawHandle*)tex; - S32 n = (S32)(h - gdraw->rendertargets.handle); - assert(n >= 0 && n <= MAX_RENDER_STACK_DEPTH + 1); - return &gdraw->rt_valid[n]; -} - -static void set_clamp_constant(int constant, GDrawTexture* tex) { - gswf_recti* s = get_valid_rect(tex); - // when we make the valid data, we make sure there is an extra empty pixel - // at the border - set_pixel_constant(constant, (s->x0 - 0.5f) / gdraw->frametex_width, - (s->y0 - 0.5f) / gdraw->frametex_height, - (s->x1 + 0.5f) / gdraw->frametex_width, - (s->y1 + 0.5f) / gdraw->frametex_height); -} - -static void gdraw_Filter(GDrawRenderState* r, gswf_recti* s, float* tc, - int isbevel, GDrawStats* stats) { - ProgramWithCachedVariableLocations* prg = - &gdraw->filter_prog[isbevel][r->filter_mode]; - - if (!gdraw_TextureDrawBufferBegin( - s, GDRAW_TEXTURE_FORMAT_rgba32, - GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | - GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, - NULL, stats)) - return; - - gdraw->d3d_device->SetPixelShader(prg->pshader); - set_texture(prg->vars[VAR_filter_tex0], r->tex[0]); - set_texture(prg->vars[VAR_filter_tex1], r->tex[1]); - set_texture(prg->vars[VAR_filter_tex2], r->tex[2]); - - set_pixel_constant(prg->vars[VAR_filter_color], r->shader_data[0], - r->shader_data[1], r->shader_data[2], r->shader_data[3]); - set_pixel_constant(prg->vars[VAR_filter_tc_off], - -r->shader_data[4] / (F32)gdraw->frametex_width, - -r->shader_data[5] / (F32)gdraw->frametex_height, - r->shader_data[6], 0); - set_pixel_constant(prg->vars[VAR_filter_color2], r->shader_data[8], - r->shader_data[9], r->shader_data[10], - r->shader_data[11]); - set_clamp_constant(prg->vars[VAR_filter_clamp0], r->tex[0]); - set_clamp_constant(prg->vars[VAR_filter_clamp1], r->tex[1]); - - do_screen_quad(s, tc, stats); - tag_resources(r->tex[0], r->tex[1], r->tex[2]); - r->tex[0] = gdraw_TextureDrawBufferEnd(stats); -} - -static void RADLINK gdraw_FilterQuad(GDrawRenderState* r, S32 x0, S32 y0, - S32 x1, S32 y1, GDrawStats* stats) { - IDirect3DDevice9* d3d = gdraw->d3d_device; - F32 tc[4]; - gswf_recti s; - - // clip to tile boundaries - s.x0 = RR_MAX(x0, gdraw->tx0p); - s.y0 = RR_MAX(y0, gdraw->ty0p); - s.x1 = RR_MIN(x1, gdraw->tx0p + gdraw->tpw); - s.y1 = RR_MIN(y1, gdraw->ty0p + gdraw->tph); - if (s.x1 < s.x0 || s.y1 < s.y0) return; - - tc[0] = (s.x0 - gdraw->tx0p) / (F32)gdraw->frametex_width; - tc[1] = (s.y0 - gdraw->ty0p) / (F32)gdraw->frametex_height; - tc[2] = (s.x1 - gdraw->tx0p) / (F32)gdraw->frametex_width; - tc[3] = (s.y1 - gdraw->ty0p) / (F32)gdraw->frametex_height; - - // clear to known render state - d3d->SetRenderState(D3DRS_STENCILENABLE, FALSE); - d3d->SetRenderState(D3DRS_COLORWRITEENABLE, 0xf); - - d3d->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); - d3d->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS); - d3d->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - - d3d->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); - d3d->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - - gdraw->scissor_state = 0; - gdraw->blend_mode = GDRAW_BLEND_none; - gdraw->stencil_key = 0; - gdraw->z_key = 0; - - if (r->blend_mode == GDRAW_BLEND_filter) { - switch (r->filter) { - case GDRAW_FILTER_blur: { - GDrawBlurInfo b; - gswf_recti bounds = *get_valid_rect(r->tex[0]); - gdraw_ShiftRect(&s, &s, -gdraw->tx0p, - -gdraw->ty0p); // blur uses physical - // rendertarget coordinates - - b.BlurPass = gdraw_DriverBlurPass; - b.w = gdraw->tpw; - b.h = gdraw->tph; - b.frametex_width = gdraw->frametex_width; - b.frametex_height = gdraw->frametex_height; - - // blur needs to draw with multiple passes, so set up special - // state - gdraw->in_blur = true; - set_viewport_raw(0, 0, gdraw->tpw, gdraw->tph); - set_projection_raw(0, gdraw->tpw, gdraw->tph, 0); - - // do the blur - gdraw_Blur(&gdraw_funcs, &b, r, &s, &bounds, stats); - - // restore the normal state - gdraw->in_blur = false; - set_viewport(); - set_projection(); - break; - } - - case GDRAW_FILTER_colormatrix: - gdraw_Colormatrix(r, &s, tc, stats); - break; - - case GDRAW_FILTER_dropshadow: - gdraw_Filter(r, &s, tc, 0, stats); - break; - - case GDRAW_FILTER_bevel: - gdraw_Filter(r, &s, tc, 1, stats); - break; - - default: - assert(0); - } - } else { - GDrawHandle* blend_tex = NULL; - static S16 zero[4] = {0, 0, 0, 0}; - - // for crazy blend modes, we need to read back from the framebuffer - // and do the blending in the pixel shader. we do this with StretchRect - // rather than trying to render-to-texture-all-along, because we want - // to be able to render over the user's existing framebuffer, which - // might not be a texture. note that this causes MSAA issues! - if (r->blend_mode == GDRAW_BLEND_special && - (blend_tex = get_color_rendertarget(stats)) != NULL) { - IDirect3DSurface9* src; - HRESULT hr = d3d->GetRenderTarget(0, &src); - if (!FAILED(hr)) { - IDirect3DSurface9* dest; - hr = blend_tex->handle.tex.d3d->GetSurfaceLevel(0, &dest); - if (!FAILED(hr)) { - RECT drect = {0, 0, gdraw->tpw, gdraw->tph}; - RECT srect; - - if (gdraw->cur != gdraw->frame) - srect = drect; - else { - srect.left = gdraw->vx; - srect.top = gdraw->vy; - srect.right = gdraw->vx + gdraw->tw; - srect.bottom = gdraw->vy + gdraw->th; - drect.left = gdraw->tx0 - gdraw->tx0p; - drect.top = gdraw->ty0 - gdraw->ty0p; - drect.right = drect.left + gdraw->tw; - drect.bottom = drect.top + gdraw->th; - } - - d3d->StretchRect(src, &srect, dest, &drect, D3DTEXF_POINT); - dest->Release(); - - stats->nonzero_flags |= GDRAW_STATS_blits; - stats->num_blits += 1; - stats->num_blit_pixels += - (srect.right - srect.left) * (srect.bottom - srect.top); - } - - src->Release(); - } - - set_texture(1, (GDrawTexture*)blend_tex); - // make sure we set color_add, because the shader reads it - if (!r->cxf_add) r->cxf_add = zero; - } - - if (!set_renderstate(GDRAW_vformat_v2tc2, r, stats)) return; - - do_screen_quad(&s, tc, stats); - tag_resources(r->tex[0], r->tex[1]); - if (blend_tex) gdraw_FreeTexture((GDrawTexture*)blend_tex, 0, stats); - } -} - -/////////////////////////////////////////////////////////////////////// -// -// Shaders -// - -#include "gdraw_d3d9_shaders.inl" - -static void create_pixel_shader(ProgramWithCachedVariableLocations* p, - ProgramWithCachedVariableLocations* src) { - *p = *src; - if (p->bytecode) { - HRESULT hr = - gdraw->d3d_device->CreatePixelShader(p->bytecode, &p->pshader); - if (FAILED(hr)) { - IggyGDrawSendWarning( - NULL, "GDraw D3D error creating pixel shader: 0x%08x", hr); - p->pshader = NULL; - } - } -} - -static void create_vertex_shader(ProgramWithCachedVariableLocations* p, - ProgramWithCachedVariableLocations* src) { - *p = *src; - if (p->bytecode) { - HRESULT hr = - gdraw->d3d_device->CreateVertexShader(p->bytecode, &p->vshader); - if (FAILED(hr)) { - IggyGDrawSendWarning( - NULL, "GDraw D3D error creating vertex shader: 0x%08x", hr); - p->vshader = NULL; - } - } -} - -static void destroy_shader(ProgramWithCachedVariableLocations* p) { - safe_release(p->pshader); -} - -static void create_all_shaders(void) { - S32 i; - - for (i = 0; i < GDRAW_TEXTURE__count * 3; ++i) - create_pixel_shader(&gdraw->fprog[0][i], pshader_basic_arr + i); - for (i = 0; i < GDRAW_BLENDSPECIAL__count; ++i) - create_pixel_shader(&gdraw->exceptional_blend[i], - pshader_exceptional_blend_arr + i); - for (i = 0; i < 32; ++i) - create_pixel_shader(&gdraw->filter_prog[0][i], pshader_filter_arr + i); - for (i = 0; i < MAX_TAPS + 1; ++i) - create_pixel_shader(&gdraw->blur_prog[i], pshader_blur_arr + i); - create_pixel_shader(&gdraw->colormatrix, pshader_color_matrix_arr); - create_pixel_shader(&gdraw->manual_clear, pshader_manual_clear_arr); - - for (i = 0; i < GDRAW_vformat__count; i++) { - HRESULT hr = gdraw->d3d_device->CreateVertexDeclaration( - vformats[i], &gdraw->vdec[i]); - if (FAILED(hr)) - IggyGDrawSendWarning( - NULL, "GDraw D3D error in CreateVertexDeclaration: 0x%08x", hr); - - create_vertex_shader(&gdraw->vert[i], vshader_vsd3d9_arr + i); - } -} - -static void destroy_all_shaders() { - S32 i; - - for (i = 0; i < GDRAW_TEXTURE__count * 3; ++i) - destroy_shader(&gdraw->fprog[0][i]); - for (i = 0; i < GDRAW_BLENDSPECIAL__count; ++i) - destroy_shader(&gdraw->exceptional_blend[i]); - for (i = 0; i < 32; ++i) destroy_shader(&gdraw->filter_prog[0][i]); - for (i = 0; i < MAX_TAPS + 1; ++i) destroy_shader(&gdraw->blur_prog[i]); - destroy_shader(&gdraw->colormatrix); - - for (i = 0; i < GDRAW_vformat__count; i++) { - if (gdraw->vdec[i]) { - gdraw->vdec[i]->Release(); - gdraw->vdec[i] = 0; - } - destroy_shader(&gdraw->vert[i]); - } -} - -//////////////////////////////////////////////////////////////////////// -// -// Create and tear-down the state -// - -typedef struct { - S32 num_handles; - S32 num_bytes; -} GDrawResourceLimit; - -// These are the defaults limits used by GDraw unless the user specifies -// something else. -static GDrawResourceLimit - gdraw_limits[ASSERT_COUNT(GDRAW_D3D_RESOURCE__count, 3)] = { - MAX_RENDER_STACK_DEPTH + 1, - 16 * 1024 * 1024, // GDRAW_D3D_RESOURCE_rendertarget - 500, - 16 * 1024 * 1024, // GDRAW_D3D_RESOURCE_texture - 1000, - 2 * 1024 * 1024, // GDRAW_D3D_RESOURCE_vertexbuffer -}; - -static GDrawHandleCache* make_handle_cache(gdraw_d3d_resourcetype type) { - S32 num_handles = gdraw_limits[type].num_handles; - S32 num_bytes = gdraw_limits[type].num_bytes; - GDrawHandleCache* cache = (GDrawHandleCache*)IggyGDrawMalloc( - sizeof(GDrawHandleCache) + (num_handles - 1) * sizeof(GDrawHandle)); - if (cache) { - gdraw_HandleCacheInit(cache, num_handles, num_bytes); - cache->is_vertex = (type == GDRAW_D3D_RESOURCE_vertexbuffer); - } - - return cache; -} - -static void free_gdraw() { - if (!gdraw) return; - if (gdraw->texturecache) IggyGDrawFree(gdraw->texturecache); - if (gdraw->vbufcache) IggyGDrawFree(gdraw->vbufcache); - IggyGDrawFree(gdraw); - gdraw = NULL; -} - -int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, S32 num_handles, - S32 num_bytes) { - GDrawStats stats = {0}; - - if (type == GDRAW_D3D_RESOURCE_rendertarget) // RT count is small and space - // is preallocated - num_handles = MAX_RENDER_STACK_DEPTH + 1; - - assert(type >= GDRAW_D3D_RESOURCE_rendertarget && - type < GDRAW_D3D_RESOURCE__count); - assert(num_handles >= 0); - assert(num_bytes >= 0); - - // nothing to do if the values are unchanged - if (gdraw_limits[type].num_handles == num_handles && - gdraw_limits[type].num_bytes == num_bytes) - return 1; - - gdraw_limits[type].num_handles = num_handles; - gdraw_limits[type].num_bytes = num_bytes; - - // if no gdraw context created, there's nothing to worry about - if (!gdraw) return 1; - - // resize the appropriate pool - switch (type) { - case GDRAW_D3D_RESOURCE_rendertarget: - flush_rendertargets(&stats); - gdraw_HandleCacheInit(&gdraw->rendertargets, num_handles, - num_bytes); - return 1; - - case GDRAW_D3D_RESOURCE_texture: - if (gdraw->texturecache) { - gdraw_res_flush(gdraw->texturecache, &stats); - IggyGDrawFree(gdraw->texturecache); - } - gdraw->texturecache = make_handle_cache(GDRAW_D3D_RESOURCE_texture); - return gdraw->texturecache != NULL; - - case GDRAW_D3D_RESOURCE_vertexbuffer: - if (gdraw->vbufcache) { - gdraw_res_flush(gdraw->vbufcache, &stats); - IggyGDrawFree(gdraw->vbufcache); - } - gdraw->vbufcache = - make_handle_cache(GDRAW_D3D_RESOURCE_vertexbuffer); - return gdraw->vbufcache != NULL; - - default: - return 0; - } -} - -GDrawFunctions* gdraw_D3D_CreateContext(IDirect3DDevice9* dev, S32 w, S32 h) { - gdraw = (GDraw*)IggyGDrawMalloc(sizeof(*gdraw)); - if (!gdraw) return NULL; - - memset(gdraw, 0, sizeof(*gdraw)); - - gdraw->frametex_width = w; - gdraw->frametex_height = h; - - gdraw->texturecache = make_handle_cache(GDRAW_D3D_RESOURCE_texture); - gdraw->vbufcache = make_handle_cache(GDRAW_D3D_RESOURCE_vertexbuffer); - gdraw_HandleCacheInit( - &gdraw->rendertargets, - gdraw_limits[GDRAW_D3D_RESOURCE_rendertarget].num_handles, - gdraw_limits[GDRAW_D3D_RESOURCE_rendertarget].num_bytes); - - if (!gdraw->texturecache || !gdraw->vbufcache) { - free_gdraw(); - return NULL; - } - - if (!quad_ib[1]) { - // initialize quad index buffer - for (U16 i = 0; i < QUAD_IB_COUNT; i++) { - quad_ib[i * 6 + 0] = i * 4 + 0; - quad_ib[i * 6 + 1] = i * 4 + 1; - quad_ib[i * 6 + 2] = i * 4 + 2; - quad_ib[i * 6 + 3] = i * 4 + 0; - quad_ib[i * 6 + 4] = i * 4 + 2; - quad_ib[i * 6 + 5] = i * 4 + 3; - } - } - - D3DCAPS9 caps; - dev->GetDeviceCaps(&caps); - gdraw->conditional_nonpow2 = - ((caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) != 0); - - gdraw->d3d_device = dev; - create_all_shaders(); - - gdraw_funcs.SetViewSizeAndWorldScale = gdraw_SetViewSizeAndWorldScale; - gdraw_funcs.GetInfo = gdraw_GetInfo; - - gdraw_funcs.DescribeTexture = gdraw_DescribeTexture; - gdraw_funcs.DescribeVertexBuffer = gdraw_DescribeVertexBuffer; - - gdraw_funcs.RenderingBegin = gdraw_RenderingBegin; - gdraw_funcs.RenderingEnd = gdraw_RenderingEnd; - gdraw_funcs.RenderTileBegin = gdraw_RenderTileBegin; - gdraw_funcs.RenderTileEnd = gdraw_RenderTileEnd; - - gdraw_funcs.TextureDrawBufferBegin = gdraw_TextureDrawBufferBegin; - gdraw_funcs.TextureDrawBufferEnd = gdraw_TextureDrawBufferEnd; - - gdraw_funcs.DrawIndexedTriangles = gdraw_DrawIndexedTriangles; - gdraw_funcs.FilterQuad = gdraw_FilterQuad; - - gdraw_funcs.SetAntialiasTexture = gdraw_SetAntialiasTexture; - - gdraw_funcs.ClearStencilBits = gdraw_ClearStencilBits; - gdraw_funcs.ClearID = gdraw_ClearID; - - gdraw_funcs.MakeTextureBegin = gdraw_MakeTextureBegin; - gdraw_funcs.MakeTextureMore = gdraw_MakeTextureMore; - gdraw_funcs.MakeTextureEnd = gdraw_MakeTextureEnd; - - gdraw_funcs.UpdateTextureBegin = gdraw_UpdateTextureBegin; - gdraw_funcs.UpdateTextureRect = gdraw_UpdateTextureRect; - gdraw_funcs.UpdateTextureEnd = gdraw_UpdateTextureEnd; - - gdraw_funcs.FreeTexture = gdraw_FreeTexture; - gdraw_funcs.TryToLockTexture = gdraw_TryToLockTexture; - - gdraw_funcs.MakeTextureFromResource = - (gdraw_make_texture_from_resource*)gdraw_D3D_MakeTextureFromResource; - gdraw_funcs.FreeTextureFromResource = gdraw_D3D_DestroyTextureFromResource; - - gdraw_funcs.MakeVertexBufferBegin = gdraw_MakeVertexBufferBegin; - gdraw_funcs.MakeVertexBufferMore = gdraw_MakeVertexBufferMore; - gdraw_funcs.MakeVertexBufferEnd = gdraw_MakeVertexBufferEnd; - gdraw_funcs.TryToLockVertexBuffer = gdraw_TryLockVertexBuffer; - gdraw_funcs.FreeVertexBuffer = gdraw_FreeVertexBuffer; - - gdraw_funcs.UnlockHandles = gdraw_UnlockHandles; - gdraw_funcs.SetTextureUniqueID = gdraw_SetTextureUniqueID; - gdraw_funcs.Set3DTransform = gdraw_Set3DTransform; - - return &gdraw_funcs; -} - -void gdraw_D3D_DestroyContext(void) { - if (gdraw && gdraw->d3d_device) { - GDrawStats stats = {0}; - destroy_all_shaders(); - gdraw_res_flush(gdraw->texturecache, &stats); - gdraw_res_flush(gdraw->vbufcache, &stats); - flush_rendertargets(&stats); - - safe_release(gdraw->aa_tex); - gdraw->d3d_device = NULL; - } - - free_gdraw(); -} - -void gdraw_D3D_SetErrorHandler(void(__cdecl* error_handler)(HRESULT hr)) { - if (gdraw) gdraw->error_handler = error_handler; -} - -void gdraw_D3D_PreReset(void) { - if (!gdraw) return; - - GDrawStats stats = {0}; - flush_rendertargets(&stats); - - // we may end up resizing the frame buffer - gdraw->frametex_width = 0; - gdraw->frametex_height = 0; -} - -void gdraw_D3D_PostReset(void) { - // maybe re-create rendertargets right now? -} - -void RADLINK gdraw_D3D_BeginCustomDraw(IggyCustomDrawCallbackRegion* region, - D3DMATRIX* mat) { - clear_renderstate(); - gdraw_GetObjectSpaceMatrix(mat->m[0], region->o2w, gdraw->projection, 0, 0); -} - -void RADLINK gdraw_D3D_EndCustomDraw(IggyCustomDrawCallbackRegion* /*region*/) { - set_common_renderstate(); - set_projection(); -} - -void RADLINK gdraw_D3D_GetResourceUsageStats(gdraw_d3d_resourcetype type, - S32* handles_used, - S32* bytes_used) { - GDrawHandleCache* cache; - - switch (type) { - case GDRAW_D3D_RESOURCE_rendertarget: - cache = &gdraw->rendertargets; - break; - case GDRAW_D3D_RESOURCE_texture: - cache = gdraw->texturecache; - break; - case GDRAW_D3D_RESOURCE_vertexbuffer: - cache = gdraw->vbufcache; - break; - default: - cache = NULL; - break; - } - - *handles_used = *bytes_used = 0; - - if (cache) { - S32 i; - U64 frame = gdraw->frame_counter; - - for (i = 0; i < cache->max_handles; ++i) - if (cache->handle[i].bytes && cache->handle[i].owner && - cache->handle[i].fence.value == frame) { - *handles_used += 1; - *bytes_used += cache->handle[i].bytes; - } - } -} - -GDrawTexture* RADLINK gdraw_D3D_MakeTextureFromResource( - U8* resource_file, S32 /*len*/, IggyFileTextureRaw* texture) { - GDrawTexture* h; - S32 width, height, mipmaps, size; - IDirect3DTexture9* tex; - D3DFORMAT d3dfmt; - width = texture->w; - height = texture->h; - mipmaps = texture->mipmaps; - - // discard mipmaps on non-pow-of-2 if the hardware doesn't support - if (gdraw->conditional_nonpow2) { - if ((width & (width - 1)) || (height & (height - 1))) mipmaps = 1; - } - - switch (texture->format) { - case IFT_FORMAT_rgba_8888: - size = 4; - d3dfmt = D3DFMT_A8R8G8B8; - break; - case IFT_FORMAT_rgba_4444_LE: - size = 2; - d3dfmt = D3DFMT_A4R4G4B4; - break; - case IFT_FORMAT_rgba_5551_LE: - size = 2; - d3dfmt = D3DFMT_A1R5G5B5; - break; - case IFT_FORMAT_la_88: - size = 2; - d3dfmt = D3DFMT_A8L8; - break; - case IFT_FORMAT_la_44: - size = 1; - d3dfmt = D3DFMT_A4L4; - break; - case IFT_FORMAT_i_8: - case IFT_FORMAT_i_4: - size = 2; - d3dfmt = D3DFMT_A8L8; - break; - case IFT_FORMAT_l_8: - size = 1; - case IFT_FORMAT_l_4: - size = 1; - d3dfmt = D3DFMT_L8; - break; - case IFT_FORMAT_DXT1: - size = 8; - d3dfmt = D3DFMT_DXT1; - break; - case IFT_FORMAT_DXT3: - size = 16; - d3dfmt = D3DFMT_DXT3; - break; - case IFT_FORMAT_DXT5: - size = 16; - d3dfmt = D3DFMT_DXT5; - break; - default: - size = 0; - d3dfmt = D3DFMT_UNKNOWN; - break; - } - - HRESULT hr = gdraw->d3d_device->CreateTexture( - width, height, mipmaps, 0, d3dfmt, D3DPOOL_MANAGED, &tex, NULL); - if (FAILED(hr)) { - if (size >= 8 && ((width & 3) || (height & 3))) - IggyGDrawSendWarning(NULL, - "GDraw D3D error, dxtc texture dimensions " - "must be multiples of 4"); - else - report_d3d_error(hr, "CreateTexture", ""); - return NULL; - } - - U8* data = resource_file + texture->file_offset; - - for (int level = 0; level < mipmaps; ++level) { - S32 dxt_width = (width + 3) / 4; - S32 effective_height; - if (size >= 8) - effective_height = (height + 3) / 4; - else - effective_height = height; - - D3DLOCKED_RECT z; - hr = tex->LockRect(level, &z, NULL, 0); - if (FAILED(hr)) { - report_d3d_error(hr, "LockRect", " while creating texture"); - tex->Release(); - return NULL; - } - U8* pixels = (U8*)z.pBits; - for (S32 j = 0; j < effective_height; ++j) { - switch (texture->format) { - default: - memcpy(pixels + z.Pitch * j, data + j * width * size, - width * size); - break; - case IFT_FORMAT_rgba_8888: { - for (S32 i = 0; i < width; ++i) { - pixels[z.Pitch * j + i * 4 + 0] = - data[j * width * 4 + i * 4 + 2]; - pixels[z.Pitch * j + i * 4 + 1] = - data[j * width * 4 + i * 4 + 1]; - pixels[z.Pitch * j + i * 4 + 2] = - data[j * width * 4 + i * 4 + 0]; - pixels[z.Pitch * j + i * 4 + 3] = - data[j * width * 4 + i * 4 + 3]; - } - break; - } - case IFT_FORMAT_DXT1: - case IFT_FORMAT_DXT3: - case IFT_FORMAT_DXT5: - memcpy(pixels + z.Pitch * j, data + j * dxt_width * size, - dxt_width * size); - break; - case IFT_FORMAT_i_8: - case IFT_FORMAT_i_4: { - // convert from intensity to luminance-alpha by replicating - // all the pixels - for (S32 i = 0; i < width; ++i) - pixels[z.Pitch * j + i * 2 + 0] = - pixels[z.Pitch * j + i * 2 + 1] = - data[j * width + i]; - break; - } - } - } - tex->UnlockRect(level); - - data += (size < 8) ? width * height * size - : ((width + 3) / 4) * ((height + 3) / 4) * size; - width = width >> 1; - width += !width; - height = height >> 1; - height += !height; - } - - h = gdraw_D3D_WrappedTextureCreate(tex); - if (!h) tex->Release(); - return h; -} - -void RADLINK gdraw_D3D_DestroyTextureFromResource(GDrawTexture* tex) { - GDrawHandle* h = (GDrawHandle*)tex; - h->handle.tex.d3d->Release(); - gdraw_D3D_WrappedTextureDestroy(tex); -} diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.h b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.h deleted file mode 100644 index 1c413f523..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d.h +++ /dev/null @@ -1,125 +0,0 @@ -#pragma once -// gdraw_d3d.h - author: Sean Barrett - copyright 2009-2011 RAD Game Tools -// -// Interface for creating a D3D GDraw driver. - -#include "../include/gdraw.h" - -#define IDOC -// idoc(parent,GDraw_d3d9) - -typedef enum gdraw_d3d_resourcetype { - GDRAW_D3D_RESOURCE_rendertarget, - GDRAW_D3D_RESOURCE_texture, - GDRAW_D3D_RESOURCE_vertexbuffer, - - GDRAW_D3D_RESOURCE__count, -} gdraw_d3d_resourcetype; - -IDOC extern int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, - S32 num_handles, S32 num_bytes); -/* This sets how large the memory pool for a given resource types is, and how - many handles GDraw should allocate for it. GDraw keeps track of allocations - in each pool, and will free old resources in a LRU manner to make space if - one of the limits is about to be exceeded. - - Returns 1 if value successfully changed, 0 on error. - You need to call IggyPlayerFlushAll on all active Iggys before you do this to - make them flush their resources since changing the resource limits - invalidates all handles. You also need to call IggyFlushInstalledFonts if you - have any installed fonts. -*/ - -IDOC extern GDrawFunctions* gdraw_D3D_CreateContext(IDirect3DDevice9* dev, - S32 w, S32 h); -/* Creates a GDraw context for rendering using D3D. You need to pass in the D3D - device and the width/height of the content you're displaying. - - The width/height is used solely for sizing internal rendertargets. They will - be allocated to the larger of this size and the size of any rendered tiles - (with padding). In other words, you can pass in (0,0) and the rendertargets - will be allocated to the right size. However, if you draw multiple Iggy files - or tiles of different sizes, they might first be allocated too small; it's - best to pass in the correct size initially to avoid unnecessary - allocation/deallocation of too-small rendertargets. - - There can only be one D3D GDraw context active at any one time. - - If initialization fails for some reason (the main reason would be an out of - memory condition), NULL is returned. Otherwise, you can pass the return value - to IggySetGDraw. */ - -IDOC extern void gdraw_D3D_SetRendertargetSize(S32 w, S32 h); -/* Reset the size used for internal rendertargets defined by CreateContext. - Flushes all existing rendertargets if the size changes. */ - -IDOC extern void gdraw_D3D_DestroyContext(void); -/* Destroys the current GDraw context, if any. */ - -IDOC extern void gdraw_D3D_SetTileOrigin(IDirect3DSurface9* rt, - IDirect3DSurface9* depth, S32 x, - S32 y); -/* This sets the main rendertarget that GDraw should render to, the - corresponding depth/stencil surface, and the x/y position where to draw the - top-left of the current tile (to be used for tiled rendering). You need to - call this before Iggy calls any rendering functions. */ - -IDOC extern void gdraw_D3D_NoMoreGDrawThisFrame(void); -/* Tells GDraw that no more rendering operations will occur this frame. This - triggers some end-of-frame processing; most importantly, GDraw uses this call - as a marker to detect thrashing (and react accordingly), so please do not - forget to call this every frame! (As long as Iggy does any rendering, that - is) */ - -IDOC extern void gdraw_D3D_PreReset(void); -/* Call this before D3D device Reset(); it will free all default pool resources - allocated by GDraw. */ - -IDOC extern void gdraw_D3D_PostReset(void); -/* Call after D3D device Reset(). */ - -IDOC extern void RADLINK -gdraw_D3D_BeginCustomDraw(IggyCustomDrawCallbackRegion* Region, D3DMATRIX* mat); -/* Call at the beginning of Iggy custom draw callback to clear any odd render - states GDraw has set on the D3D device, and to get the current 2D - object-to-world transformation. */ - -IDOC extern void RADLINK -gdraw_D3D_EndCustomDraw(IggyCustomDrawCallbackRegion* Region); -/* Call at the end of Iggy custom draw callback so GDraw can restore its render - * states. */ - -IDOC extern void RADLINK gdraw_D3D_GetResourceUsageStats( - gdraw_d3d_resourcetype type, S32* handles_used, S32* bytes_used); -/* D3D only: Get resource usage stats for last frame. - This can be used to get an estimate of how much graphics memory got used by - GDraw during the last frame. Caveat: This counts the number of bytes that - GDraw knows about. 3D hardware usually has its own management overhead, - alignment requirements, allocation granularity and so on. In short, this is - not an accurate estimate of how much memory is actually used by the GPU - it - is a lower bound, though, and makes for a useful ballpark estimate. */ - -IDOC extern GDrawTexture* gdraw_D3D_WrappedTextureCreate( - IDirect3DTexture9* tex_handle); -/* Create a wrapped texture from a D3D texture. - A wrapped texture can be used to let Iggy draw using the contents of a - texture you create and manage on your own. For example, you might render to - this texture, or stream video into it. Wrapped textures take up a handle. - They will never be freed or otherwise modified by GDraw; nor will GDraw - change any reference counts. All this is up to the application. */ - -IDOC extern void gdraw_D3D_WrappedTextureChange(GDrawTexture* tex, - IDirect3DTexture9* tex_handle); -/* Switch an existing GDrawTexture * that represents a wrapped texture to use - a new underlying D3D texture. For example, you might internally double-buffer - a dynamically updated texture. As above, GDraw will leave this texture alone - and not touch any reference counts. */ - -IDOC extern void gdraw_D3D_WrappedTextureDestroy(GDrawTexture* tex); -/* Destroys the GDraw wrapper for a wrapped texture object. This will free up - a GDraw texture handle but not release the associated D3D texture; that is - up to you. */ - -extern GDrawTexture* RADLINK gdraw_D3D_MakeTextureFromResource( - U8* resource_file, S32 length, IggyFileTextureRaw* texture); -extern void RADLINK gdraw_D3D_DestroyTextureFromResource(GDrawTexture* tex); diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10.cpp b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10.cpp deleted file mode 100644 index de1289445..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// gdraw_d3d10.cpp - author: Fabian Giesen - copyright 2011 RAD Game Tools -// -// This implements the Iggy graphics driver layer for D3D 10. - -// GDraw consists of several components that interact fairly loosely with each -// other; e.g. the resource management, drawing and filtering parts are all -// fairly independent of each other. If you want to modify some aspect of GDraw -// - say the texture allocation logic - your best bet is usually to just look -// for one of the related entry points, e.g. MakeTextureBegin, and take it from -// there. There's a bunch of code in this file, but none of it is really -// complicated. -// -// The one bit you might want to change that's not that localized is to -// integrate GDraw with an existing state caching system. The following bits all -// modify D3D state in some way: -// - The rendering helpers (set_viewport_raw, set_projection_raw, -// set_*_renderstate) -// - RenderTile*/TextureDrawBuffer* may change the active rendertarget and -// depth/stencil surface, -// as do D3D1X_(NoMoreGDrawThisFrame) and set_render_target -// - set_texture -// - set_renderstate and set_renderstate_full. These are the main places where -// render state changes occur; -// you should probably start here. -// - DrawIndexedTriangles sets the active vertex/index buffers and vertex -// declaration -// - Most of the functions in the "filter effects" section modify D3D state, -// mostly -// pixel shader constants and textures - -#define GDRAW_ASSERTS - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -// We temporarily disable this warning for the shared interface portions -#pragma warning(push) -#pragma warning(disable \ - : 4201) // nonstandard extension used : nameless struct/union - -#include -#include -#include "../include/gdraw.h" -#include "../include/iggy.h" -#include -#include - -#include "gdraw_d3d10.h" - -#pragma warning(pop) - -// Some macros to allow as much sharing between D3D10 and D3D11 code as -// possible. -#define D3D1X_(id) D3D10_##id -#define ID3D1X(id) ID3D10##id -#define gdraw_D3D1X_(id) gdraw_D3D10_##id -#define GDRAW_D3D1X_(id) GDRAW_D3D10_##id - -typedef ID3D10Device ID3D1XDevice; -typedef ID3D10Device ID3D1XContext; -typedef S32 ViewCoord; -typedef gdraw_d3d10_resourcetype gdraw_resourcetype; - -static void report_d3d_error(HRESULT hr, char* call, char* context); - -static void* map_buffer(ID3D1XContext*, ID3D10Buffer* buf, bool discard) { - void* ptr; - if (FAILED(buf->Map( - discard ? D3D10_MAP_WRITE_DISCARD : D3D10_MAP_WRITE_NO_OVERWRITE, 0, - &ptr))) - return NULL; - else - return ptr; -} - -static void unmap_buffer(ID3D1XContext*, ID3D10Buffer* buf) { buf->Unmap(); } - -static RADINLINE void set_pixel_shader(ID3D10Device* ctx, - ID3D10PixelShader* shader) { - ctx->PSSetShader(shader); -} - -static RADINLINE void set_vertex_shader(ID3D10Device* ctx, - ID3D10VertexShader* shader) { - ctx->VSSetShader(shader); -} - -static ID3D10BlendState* create_blend_state(ID3D10Device* dev, BOOL blend, - D3D10_BLEND src, D3D10_BLEND dst) { - D3D10_BLEND_DESC desc = {}; - desc.BlendEnable[0] = blend; - desc.SrcBlend = src; - desc.DestBlend = dst; - desc.BlendOp = D3D10_BLEND_OP_ADD; - desc.SrcBlendAlpha = - (src == D3D10_BLEND_DEST_COLOR) ? D3D10_BLEND_DEST_ALPHA : src; - desc.DestBlendAlpha = dst; - desc.BlendOpAlpha = D3D10_BLEND_OP_ADD; - desc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL; - - ID3D10BlendState* res; - HRESULT hr = dev->CreateBlendState(&desc, &res); - if (FAILED(hr)) { - report_d3d_error(hr, "CreateBlendState", ""); - res = NULL; - } - - return res; -} - -#define GDRAW_SHADER_FILE "gdraw_d3d10_shaders.inl" -#include "gdraw_d3d1x_shared.inl" - -static void create_pixel_shader(ProgramWithCachedVariableLocations* p, - ProgramWithCachedVariableLocations* src) { - *p = *src; - if (p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, - &p->pshader); - if (FAILED(hr)) { - report_d3d_error(hr, "CreatePixelShader", ""); - p->pshader = NULL; - return; - } - } -} - -static void create_vertex_shader(ProgramWithCachedVariableLocations* p, - ProgramWithCachedVariableLocations* src) { - *p = *src; - if (p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, - &p->vshader); - if (FAILED(hr)) { - report_d3d_error(hr, "CreateVertexShader", ""); - p->vshader = NULL; - return; - } - } -} - -GDrawFunctions* gdraw_D3D10_CreateContext(ID3D10Device* dev, S32 w, S32 h) { - return create_context(dev, dev, w, h); -} diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10.h b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10.h deleted file mode 100644 index 65fa8024c..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10.h +++ /dev/null @@ -1,152 +0,0 @@ -#pragma once -// gdraw_d3d10.h - author: Fabian Giesen - copyright 2011 RAD Game Tools -// -// Interface for creating a D3D10 GDraw driver. - -#define IDOC -// idoc(parent,GDraw_d3d10) - -typedef enum gdraw_d3d10_resourcetype { - GDRAW_D3D10_RESOURCE_rendertarget, - GDRAW_D3D10_RESOURCE_texture, - GDRAW_D3D10_RESOURCE_vertexbuffer, - GDRAW_D3D10_RESOURCE_dynbuffer, // Streaming buffer for dynamic - // vertex/index data (handle count ignored) - - GDRAW_D3D10_RESOURCE__count, -} gdraw_d3d10_resourcetype; - -IDOC extern int gdraw_D3D10_SetResourceLimits(gdraw_d3d10_resourcetype type, - S32 num_handles, S32 num_bytes); -/* This sets how large the memory pool for a given resource types is, and how - many handles GDraw should allocate for it. GDraw keeps track of allocations - in each pool, and will free old resources in a LRU manner to make space if - one of the limits is about to be exceeded. - - Returns 1 if value successfully changed, 0 on error. - You need to call IggyPlayerFlushAll on all active Iggys before you do this to - make them flush their resources since changing the resource limits - invalidates all handles. You also need to call IggyFlushInstalledFonts if you - have any installed fonts. -*/ - -IDOC extern GDrawFunctions* gdraw_D3D10_CreateContext(ID3D10Device* dev, S32 w, - S32 h); -/* Creates a GDraw context for rendering using D3D. You need to pass in the D3D - device and the width/height of render target textures. - - The width/height is used solely for sizing internal rendertargets. They will - be allocated to the larger of this size and the size of any rendered tiles - (with padding). In other words, you can pass in (0,0) and the rendertargets - will be allocated to the right size. However, if you draw multiple Iggy files - or tiles of different sizes, they might first be allocated too small; it's - best to pass in the correct size initially to avoid unnecessary - allocation/deallocation of too-small rendertargets. - - There can only be one D3D GDraw context active at any one time. - - If initialization fails for some reason (the main reason would be an out of - memory condition), NULL is returned. Otherwise, you can pass the return value - to IggySetGDraw. */ - -IDOC extern void gdraw_D3D10_DestroyContext(void); -/* Destroys the current GDraw context, if any. */ - -IDOC extern void gdraw_D3D10_SetErrorHandler( - void(__cdecl* error_handler)(HRESULT hr)); -/* Sets the GDraw D3D error handler. - - This will get called with the respective D3D error code if GDraw encounters - an error that it can't handle by itself (e.g. running out of state objects). - */ - -IDOC extern void gdraw_D3D10_SetRendertargetSize(S32 w, S32 h); -/* Changes the current render target size (and recreates all rendertargets if - necessary). This allows you to shrink the rendertargets if the new needed - size is smaller than it was previously. As with $gdraw_D3D10_CreateContext, - the width and height specified here are only minimums; GDraw will reallocate - larger rendertargets as needed. */ - -IDOC extern void gdraw_D3D10_SetTileOrigin( - ID3D10RenderTargetView* main_rt, ID3D10DepthStencilView* main_ds, - ID3D10ShaderResourceView* non_msaa_rt, S32 x, S32 y); -/* This sets the main rendertarget and matching depth/stencil buffer that GDraw - should render to and the x/y position of the output location of the top-left - of the current tile (allowing you to finely-position content, or to do tiled - rendering). - - If your rendertarget uses multisampling, you also need to specify a shader - resource view for a non-MSAA rendertarget texture (identically sized to - main_rt) in non_msaa_rt. This is only used if the Flash content includes - non-standard blend modes which have to use a special blend shader, so you can - leave it NULL if you forbid such content. - - You need to call this before Iggy calls any rendering functions. */ - -IDOC extern void gdraw_D3D10_NoMoreGDrawThisFrame(void); -/* Tells GDraw that no more rendering operations will occur this frame. This - triggers some end-of-frame processing; most importantly, GDraw uses this call - as a marker to detect thrashing (and react accordingly), so please do not - forget to call this every frame! (As long as Iggy does any rendering, that - is) */ - -IDOC extern void gdraw_D3D10_PreReset(void); -/* Call this before D3D device Reset(); it will free all default pool resources - allocated by GDraw. */ - -IDOC extern void gdraw_D3D10_PostReset(void); -/* Call after D3D device Reset(). */ - -IDOC extern void RADLINK gdraw_D3D10_BeginCustomDraw( - IggyCustomDrawCallbackRegion* Region, F32 mat[4][4]); -/* Call at the beginning of Iggy custom draw callback to clear any odd render - states GDraw has set on the D3D device, and to get the current 2D - object-to-world transformation. */ - -IDOC extern void RADLINK -gdraw_D3D10_EndCustomDraw(IggyCustomDrawCallbackRegion* Region); -/* Call at the end of Iggy custom draw callback so GDraw can restore its render - * states. */ - -IDOC extern void RADLINK gdraw_D3D10_GetResourceUsageStats( - gdraw_d3d10_resourcetype type, S32* handles_used, S32* bytes_used); -/* D3D only: Get resource usage stats for last frame. - This can be used to get an estimate of how much graphics memory got used by - GDraw during the last frame. - - For the dynbuffer, this always returns 0 in handles_used and the *size of the - largest single allocation* in bytes_used. It needs to be sized so that this - allocation fits; make it smaller and it won't work, but if you make it much - larger (say more than 2x as big), it's just a waste of memory. That said, we - still recommend to make it no smaller than 64k, and the default is 256k. - - Caveat: This counts the number of bytes that GDraw knows about. 3D hardware - usually has its own management overhead, alignment requirements, allocation - granularity and so on. In short, this is not an accurate estimate of how much - memory is actually used by the GPU - it is a lower bound, though, and makes - for a useful ballpark estimate. */ - -IDOC extern GDrawTexture* gdraw_D3D10_WrappedTextureCreate( - ID3D10ShaderResourceView* tex_view); -/* Create a wrapped texture from a shader resource view. - A wrapped texture can be used to let Iggy draw using the contents of a - texture you create and manage on your own. For example, you might render to - this texture, or stream video into it. Wrapped textures take up a handle. - They will never be freed or otherwise modified by GDraw; nor will GDraw - change any reference counts. All this is up to the application. */ - -IDOC extern void gdraw_D3D10_WrappedTextureChange( - GDrawTexture* tex, ID3D10ShaderResourceView* tex_view); -/* Switch an existing GDrawTexture * that represents a wrapped texture to use - a new underlying D3D view. For example, you might internally double-buffer - a dynamically updated texture. As above, GDraw will leave this texture alone - and not touch any reference counts. */ - -IDOC extern void gdraw_D3D10_WrappedTextureDestroy(GDrawTexture* tex); -/* Destroys the GDraw wrapper for a wrapped texture object. This will free up - a GDraw texture handle but not release the associated D3D texture; that is - up to you. */ - -extern GDrawTexture* RADLINK gdraw_D3D10_MakeTextureFromResource( - U8* resource_file, S32 length, IggyFileTextureRaw* texture); -extern void RADLINK gdraw_D3D10_DestroyTextureFromResource(GDrawTexture* tex); diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl deleted file mode 100644 index ce13993b1..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d9_shaders.inl +++ /dev/null @@ -1,1075 +0,0 @@ -// This file was automatically generated by shadergen. Do not edit by hand! - -static DWORD pshader_basic_0[36] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0807, 0x02000006, - 0x80080000, 0xb0ff0000, 0x03000005, 0x80010000, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020000, - 0xb0ff0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40807, 0x03000005, 0x80070001, 0xa0ff0000, - 0xa0e40000, 0x02000001, 0x80080001, 0xa0ff0000, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40001, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_1[48] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0807, 0x02000006, - 0x80080000, 0xb0ff0000, 0x03000005, 0x80010000, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020000, - 0xb0ff0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40807, 0x03000005, 0x80070001, 0xa0ff0000, - 0xa0e40000, 0x02000001, 0x80080001, 0xa0ff0000, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40001, - 0x04000004, 0x80070000, 0xa0e40001, 0x80ff0000, 0x80e40000, 0x0300000a, 0x80070001, 0x80ff0000, - 0x80e40000, 0x02000001, 0x80080001, 0x80ff0000, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_basic_2[41] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0807, 0x02000006, - 0x80080000, 0xb0ff0000, 0x03000005, 0x80010000, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020000, - 0xb0ff0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40807, 0x02000001, 0x800f0001, 0xa0e40000, - 0x04000004, 0x80080000, 0x80ff0001, 0x80ff0000, 0xa0ff0001, 0x03000002, 0x80070001, 0x80e40001, - 0xa0e40001, 0x03000005, 0x80070000, 0x80ff0000, 0x80e40001, 0x02000001, 0x800f0800, 0x80e40000, - 0x0000ffff, -}; - -static DWORD pshader_basic_3[51] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, - 0xb0e40000, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, - 0x03000005, 0x80070002, 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, - 0x800f0000, 0x80e40000, 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_4[63] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, - 0xb0e40000, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, - 0x03000005, 0x80070002, 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, - 0x800f0000, 0x80e40000, 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, 0x04000004, - 0x80070000, 0xa0e40001, 0x80ff0000, 0x80e40000, 0x0300000a, 0x80070001, 0x80ff0000, 0x80e40000, - 0x02000001, 0x80080001, 0x80ff0000, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_basic_5[68] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, - 0xb0e40000, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, - 0x02000006, 0x80010001, 0x80ff0000, 0x03000005, 0x80070001, 0x80e40000, 0x80000001, 0x03000005, - 0x80080002, 0x80ff0000, 0x80ff0000, 0x04000058, 0x80070000, 0x81ff0002, 0x80e40000, 0x80e40001, - 0x03000005, 0x800f0000, 0x80e40000, 0xa0e40000, 0x03000005, 0x80080000, 0x80ff0001, 0x80ff0000, - 0x03000002, 0x800f0000, 0x80e40000, 0xa0e40001, 0x03000005, 0x80070000, 0x80ff0000, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_6[51] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, - 0xb0e40000, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, - 0x03000005, 0x80070002, 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, - 0x800f0000, 0x80ff0000, 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_7[63] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, - 0xb0e40000, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, - 0x03000005, 0x80070002, 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, - 0x800f0000, 0x80ff0000, 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, 0x04000004, - 0x80070000, 0xa0e40001, 0x80ff0000, 0x80e40000, 0x0300000a, 0x80070001, 0x80ff0000, 0x80e40000, - 0x02000001, 0x80080001, 0x80ff0000, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_basic_8[56] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, - 0xb0e40000, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, - 0x03000005, 0x80010000, 0x80ff0000, 0xa0ff0000, 0x04000004, 0x80080000, 0x80000000, 0x80ff0001, - 0xa0ff0001, 0x02000001, 0x80070001, 0xa0e40000, 0x03000002, 0x80070001, 0x80e40001, 0xa0e40001, - 0x03000005, 0x80070000, 0x80ff0000, 0x80e40001, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_9[68] = { - 0xffff0200, 0x05000051, 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0807, - 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, 0xb0e40000, 0x03000005, - 0x80010001, 0x80ff0000, 0xb0aa0000, 0x0400005a, 0x80010000, 0x80e40000, 0x80e40000, 0xa0000001, - 0x02000007, 0x80010000, 0x80000000, 0x02000006, 0x80030000, 0x80000000, 0x02000001, 0x80020001, - 0xb0ff0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, - 0xa0e40807, 0x03000005, 0x80070002, 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, - 0x03000005, 0x800f0000, 0x80e40000, 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_10[80] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0807, - 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, 0xb0e40000, 0x03000005, - 0x80010001, 0x80ff0000, 0xb0aa0000, 0x0400005a, 0x80010000, 0x80e40000, 0x80e40000, 0xa0000002, - 0x02000007, 0x80010000, 0x80000000, 0x02000006, 0x80030000, 0x80000000, 0x02000001, 0x80020001, - 0xb0ff0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, - 0xa0e40807, 0x03000005, 0x80070002, 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, - 0x03000005, 0x800f0000, 0x80e40000, 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, - 0x04000004, 0x80070000, 0xa0e40001, 0x80ff0000, 0x80e40000, 0x0300000a, 0x80070001, 0x80ff0000, - 0x80e40000, 0x02000001, 0x80080001, 0x80ff0000, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_basic_11[85] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0807, - 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, 0xb0e40000, 0x03000005, - 0x80010001, 0x80ff0000, 0xb0aa0000, 0x0400005a, 0x80010000, 0x80e40000, 0x80e40000, 0xa0000002, - 0x02000007, 0x80010000, 0x80000000, 0x02000006, 0x80030000, 0x80000000, 0x02000001, 0x80020001, - 0xb0ff0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, - 0xa0e40807, 0x02000006, 0x80010001, 0x80ff0000, 0x03000005, 0x80070001, 0x80e40000, 0x80000001, - 0x03000005, 0x80080002, 0x80ff0000, 0x80ff0000, 0x04000058, 0x80070000, 0x81ff0002, 0x80e40000, - 0x80e40001, 0x03000005, 0x800f0000, 0x80e40000, 0xa0e40000, 0x03000005, 0x80080000, 0x80ff0001, - 0x80ff0000, 0x03000002, 0x800f0000, 0x80e40000, 0xa0e40001, 0x03000005, 0x80070000, 0x80ff0000, - 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_12[89] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80010000, 0x80ff0000, - 0xb0550000, 0x03000005, 0x80010000, 0x80000000, 0x80000000, 0x04000004, 0x80020000, 0xb0000000, - 0x80ff0000, 0xa0000002, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x04000004, 0x80010000, - 0x80550000, 0x80550000, 0x80000000, 0x03000005, 0x80040000, 0x80550000, 0xa0550002, 0x03000005, - 0x80040000, 0x80aa0000, 0x80aa0000, 0x04000004, 0x80010000, 0x80000000, 0xa0aa0002, 0x80aa0000, - 0x02000007, 0x80010000, 0x80000000, 0x02000006, 0x80010000, 0x80000000, 0x04000004, 0x80030000, - 0x80550000, 0xa1550002, 0x80000000, 0x02000001, 0x80020001, 0xb0ff0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, 0x03000005, 0x80070002, - 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, 0x800f0000, 0x80e40000, - 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, - 0x0000ffff, -}; - -static DWORD pshader_basic_13[101] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80010000, 0x80ff0000, - 0xb0550000, 0x03000005, 0x80010000, 0x80000000, 0x80000000, 0x04000004, 0x80020000, 0xb0000000, - 0x80ff0000, 0xa0000002, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x04000004, 0x80010000, - 0x80550000, 0x80550000, 0x80000000, 0x03000005, 0x80040000, 0x80550000, 0xa0550002, 0x03000005, - 0x80040000, 0x80aa0000, 0x80aa0000, 0x04000004, 0x80010000, 0x80000000, 0xa0aa0002, 0x80aa0000, - 0x02000007, 0x80010000, 0x80000000, 0x02000006, 0x80010000, 0x80000000, 0x04000004, 0x80030000, - 0x80550000, 0xa1550002, 0x80000000, 0x02000001, 0x80020001, 0xb0ff0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, 0x03000005, 0x80070002, - 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, 0x800f0000, 0x80e40000, - 0x80e40002, 0x03000005, 0x800f0000, 0x80e40001, 0x80e40000, 0x04000004, 0x80070000, 0xa0e40001, - 0x80ff0000, 0x80e40000, 0x0300000a, 0x80070001, 0x80ff0000, 0x80e40000, 0x02000001, 0x80080001, - 0x80ff0000, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_basic_14[106] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0807, 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80010000, 0x80ff0000, - 0xb0550000, 0x03000005, 0x80010000, 0x80000000, 0x80000000, 0x04000004, 0x80020000, 0xb0000000, - 0x80ff0000, 0xa0000002, 0x03000005, 0x80010001, 0x80ff0000, 0xb0aa0000, 0x04000004, 0x80010000, - 0x80550000, 0x80550000, 0x80000000, 0x03000005, 0x80040000, 0x80550000, 0xa0550002, 0x03000005, - 0x80040000, 0x80aa0000, 0x80aa0000, 0x04000004, 0x80010000, 0x80000000, 0xa0aa0002, 0x80aa0000, - 0x02000007, 0x80010000, 0x80000000, 0x02000006, 0x80010000, 0x80000000, 0x04000004, 0x80030000, - 0x80550000, 0xa1550002, 0x80000000, 0x02000001, 0x80020001, 0xb0ff0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, 0x02000006, 0x80010001, - 0x80ff0000, 0x03000005, 0x80070001, 0x80e40000, 0x80000001, 0x03000005, 0x80080002, 0x80ff0000, - 0x80ff0000, 0x04000058, 0x80070000, 0x81ff0002, 0x80e40000, 0x80e40001, 0x03000005, 0x800f0000, - 0x80e40000, 0xa0e40000, 0x03000005, 0x80080000, 0x80ff0001, 0x80ff0000, 0x03000002, 0x800f0000, - 0x80e40000, 0xa0e40001, 0x03000005, 0x80070000, 0x80ff0000, 0x80e40000, 0x02000001, 0x800f0800, - 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_basic_15[64] = { - 0xffff0200, 0x05000051, 0xa00f0001, 0xbf000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0807, - 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, 0xb0e40000, 0x03000005, - 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, 0x03000005, 0x80070002, - 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, 0x800f0000, 0x80ff0000, - 0x80e40002, 0x04000004, 0x800f0002, 0x80ff0000, 0x80ff0001, 0xa0000001, 0x03000005, 0x800f0000, - 0x80e40001, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x01000041, 0x800f0002, 0x0000ffff, -}; - -static DWORD pshader_basic_16[76] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0xbf000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0807, - 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, 0xb0e40000, 0x03000005, - 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, 0x03000005, 0x80070002, - 0xa0ff0000, 0xa0e40000, 0x02000001, 0x80080002, 0xa0ff0000, 0x03000005, 0x800f0000, 0x80ff0000, - 0x80e40002, 0x04000004, 0x800f0002, 0x80ff0000, 0x80ff0001, 0xa0000002, 0x03000005, 0x800f0000, - 0x80e40001, 0x80e40000, 0x01000041, 0x800f0002, 0x04000004, 0x80070000, 0xa0e40001, 0x80ff0000, - 0x80e40000, 0x0300000a, 0x80070001, 0x80ff0000, 0x80e40000, 0x02000001, 0x80080001, 0x80ff0000, - 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_basic_17[68] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0xbf000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb00f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0807, - 0x02000006, 0x80080000, 0xb0ff0000, 0x03000005, 0x80030000, 0x80ff0000, 0xb0e40000, 0x03000005, - 0x80010001, 0x80ff0000, 0xb0aa0000, 0x02000001, 0x80020001, 0xb0ff0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40807, 0x03000005, 0x80010000, - 0x80ff0000, 0xa0ff0000, 0x04000004, 0x80080000, 0x80000000, 0x80ff0001, 0xa0ff0001, 0x03000002, - 0x800f0001, 0x80ff0000, 0xa0000002, 0x01000041, 0x800f0001, 0x02000001, 0x80070001, 0xa0e40000, - 0x03000002, 0x80070001, 0x80e40001, 0xa0e40001, 0x03000005, 0x80070000, 0x80ff0000, 0x80e40001, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations pshader_basic_arr[18] = { - { pshader_basic_0, NULL, { -1, 7, 0, -1, -1, } }, - { pshader_basic_1, NULL, { -1, 7, 0, 1, -1, } }, - { pshader_basic_2, NULL, { -1, 7, 0, 1, -1, } }, - { pshader_basic_3, NULL, { 0, 7, 0, -1, -1, } }, - { pshader_basic_4, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_5, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_6, NULL, { 0, 7, 0, -1, -1, } }, - { pshader_basic_7, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_8, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_9, NULL, { 0, 7, 0, -1, -1, } }, - { pshader_basic_10, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_11, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_12, NULL, { 0, 7, 0, -1, 2, } }, - { pshader_basic_13, NULL, { 0, 7, 0, 1, 2, } }, - { pshader_basic_14, NULL, { 0, 7, 0, 1, 2, } }, - { pshader_basic_15, NULL, { 0, 7, 0, -1, -1, } }, - { pshader_basic_16, NULL, { 0, 7, 0, 1, -1, } }, - { pshader_basic_17, NULL, { 0, 7, 0, 1, -1, } }, -}; - -static DWORD pshader_exceptional_blend_1[72] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0000, - 0xa0000002, 0x03000005, 0x80070003, 0x80e40001, 0x80e40000, 0x04000004, 0x80070001, 0x80000002, - 0x80e40001, 0x80e40003, 0x03000002, 0x80010002, 0x81ff0001, 0xa0000002, 0x04000004, 0x80070002, - 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, 0x04000004, - 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_2[111] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0000, - 0xa0000002, 0x03000002, 0x80020002, 0x81000000, 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, - 0x80ff0000, 0x03000002, 0x80080002, 0x81000001, 0x80ff0001, 0x04000004, 0x80010003, 0x80ff0002, - 0x81550002, 0x80aa0002, 0x03000002, 0x80080003, 0x81550000, 0x80ff0000, 0x03000002, 0x80020002, - 0x81550001, 0x80ff0001, 0x04000004, 0x80020003, 0x80550002, 0x81ff0003, 0x80aa0002, 0x03000002, - 0x80080003, 0x81aa0000, 0x80ff0000, 0x03000002, 0x80020002, 0x81aa0001, 0x80ff0001, 0x04000004, - 0x80040003, 0x80550002, 0x81ff0003, 0x80aa0002, 0x04000004, 0x80070001, 0x80000002, 0x80e40001, - 0x80e40003, 0x03000002, 0x80010002, 0x81ff0001, 0xa0000002, 0x04000004, 0x80070002, 0x80000002, - 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, 0x04000004, 0x80080002, - 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_3[104] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0000, - 0xa0000002, 0x03000005, 0x80020002, 0x80000001, 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, - 0x80000000, 0x0300000b, 0x80010003, 0x80550002, 0x80aa0002, 0x03000005, 0x80020002, 0x80550001, - 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, 0x80550000, 0x0300000b, 0x80020003, 0x80550002, - 0x80aa0002, 0x03000005, 0x80020002, 0x80aa0001, 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, - 0x80aa0000, 0x0300000b, 0x80040003, 0x80550002, 0x80aa0002, 0x04000004, 0x80070001, 0x80000002, - 0x80e40001, 0x80e40003, 0x03000002, 0x80010002, 0x81ff0001, 0xa0000002, 0x04000004, 0x80070002, - 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, 0x04000004, - 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_4[104] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0000, - 0xa0000002, 0x03000005, 0x80020002, 0x80000001, 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, - 0x80000000, 0x0300000a, 0x80010003, 0x80aa0002, 0x80550002, 0x03000005, 0x80020002, 0x80550001, - 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, 0x80550000, 0x0300000a, 0x80020003, 0x80aa0002, - 0x80550002, 0x03000005, 0x80020002, 0x80aa0001, 0x80ff0000, 0x03000005, 0x80040002, 0x80ff0001, - 0x80aa0000, 0x0300000a, 0x80040003, 0x80aa0002, 0x80550002, 0x04000004, 0x80070001, 0x80000002, - 0x80e40001, 0x80e40003, 0x03000002, 0x80010002, 0x81ff0001, 0xa0000002, 0x04000004, 0x80070002, - 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, 0x04000004, - 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_5[73] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010000, 0x80000000, - 0x80000001, 0x0300000a, 0x80010002, 0x80000000, 0xa0000002, 0x03000002, 0x80010000, 0x80550000, - 0x80550001, 0x0300000a, 0x80020002, 0x80000000, 0xa0000002, 0x03000002, 0x80010000, 0x80aa0000, - 0x80aa0001, 0x03000002, 0x80020000, 0x80ff0001, 0x80ff0000, 0x0300000a, 0x80080002, 0x80550000, - 0xa0000002, 0x0300000a, 0x80040002, 0x80000000, 0xa0000002, 0x02000001, 0x800f0800, 0x80e40002, - 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_6[73] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x00000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010000, 0x81000000, - 0x80000001, 0x0300000b, 0x80010002, 0x80000000, 0xa0000002, 0x03000002, 0x80010000, 0x81550000, - 0x80550001, 0x0300000b, 0x80020002, 0x80000000, 0xa0000002, 0x03000002, 0x80010000, 0x81aa0000, - 0x80aa0001, 0x03000002, 0x80020000, 0x80ff0001, 0x80ff0000, 0x0300000a, 0x80080002, 0x80550000, - 0xa0550002, 0x0300000b, 0x80040002, 0x80000000, 0xa0000002, 0x02000001, 0x800f0800, 0x80e40002, - 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_7[104] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0000, - 0xa0000002, 0x03000005, 0x80020002, 0x80ff0001, 0x80000000, 0x04000004, 0x80020002, 0x80ff0000, - 0x80000001, 0x81550002, 0x02000023, 0x80010003, 0x80550002, 0x03000005, 0x80080003, 0x80ff0001, - 0x80550000, 0x04000004, 0x80080003, 0x80ff0000, 0x80550001, 0x81ff0003, 0x02000023, 0x80020003, - 0x80ff0003, 0x03000005, 0x80080003, 0x80ff0001, 0x80aa0000, 0x04000004, 0x80080003, 0x80ff0000, - 0x80aa0001, 0x81ff0003, 0x02000023, 0x80040003, 0x80ff0003, 0x04000004, 0x80070001, 0x80000002, - 0x80e40001, 0x80e40003, 0x03000002, 0x80010002, 0x81ff0001, 0xa0000002, 0x04000004, 0x80070002, - 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, 0x04000004, - 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_8[92] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0000, - 0xa0000002, 0x03000002, 0x80020002, 0x81000001, 0x80ff0001, 0x03000005, 0x80010003, 0x80ff0000, - 0x80550002, 0x03000002, 0x80080003, 0x81550001, 0x80ff0001, 0x03000005, 0x80020003, 0x80ff0000, - 0x80ff0003, 0x03000002, 0x80080003, 0x81aa0001, 0x80ff0001, 0x03000005, 0x80040003, 0x80ff0000, - 0x80ff0003, 0x04000004, 0x80070001, 0x80000002, 0x80e40001, 0x80e40003, 0x03000002, 0x80010002, - 0x81ff0001, 0xa0000002, 0x04000004, 0x80070002, 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, - 0x80010000, 0x80ff0001, 0x80ff0000, 0x04000004, 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, - 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_9[177] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x03000002, 0x80010002, 0x81000000, - 0x80ff0000, 0x03000005, 0x80020002, 0x80ff0001, 0x80ff0000, 0x03000002, 0x80040002, 0x81000001, - 0x80ff0001, 0x03000002, 0x80040002, 0x80aa0002, 0x80aa0002, 0x04000004, 0x80010002, 0x80aa0002, - 0x81000002, 0x80550002, 0x03000005, 0x80040002, 0x80000000, 0x80000001, 0x03000002, 0x80040002, - 0x80aa0002, 0x80aa0002, 0x04000004, 0x80080002, 0x80ff0001, 0xa1000002, 0x80000001, 0x04000058, - 0x80010003, 0x80ff0002, 0x80000002, 0x80aa0002, 0x03000002, 0x80080003, 0x81550000, 0x80ff0000, - 0x03000002, 0x80010002, 0x81550001, 0x80ff0001, 0x03000002, 0x80010002, 0x80000002, 0x80000002, - 0x04000004, 0x80080003, 0x80000002, 0x81ff0003, 0x80550002, 0x03000005, 0x80010002, 0x80550000, - 0x80550001, 0x03000002, 0x80010002, 0x80000002, 0x80000002, 0x04000004, 0x80040002, 0x80ff0001, - 0xa1000002, 0x80550001, 0x04000058, 0x80020003, 0x80aa0002, 0x80ff0003, 0x80000002, 0x03000002, - 0x80080003, 0x81aa0000, 0x80ff0000, 0x03000002, 0x80010002, 0x81aa0001, 0x80ff0001, 0x03000002, - 0x80010002, 0x80000002, 0x80000002, 0x04000004, 0x80080003, 0x80000002, 0x81ff0003, 0x80550002, - 0x03000005, 0x80010002, 0x80aa0000, 0x80aa0001, 0x03000002, 0x80010002, 0x80000002, 0x80000002, - 0x04000004, 0x80020002, 0x80ff0001, 0xa1000002, 0x80aa0001, 0x04000058, 0x80040003, 0x80550002, - 0x80ff0003, 0x80000002, 0x03000002, 0x80080003, 0x81ff0000, 0xa0550002, 0x04000004, 0x80070001, - 0x80ff0003, 0x80e40001, 0x80e40003, 0x03000002, 0x80010002, 0x81ff0001, 0xa0550002, 0x04000004, - 0x80070002, 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, - 0x04000004, 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, - 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_10[177] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80070000, 0x80e40000, 0xa0e40000, 0x03000005, 0x800f0002, 0x80ff0000, 0xa0e40001, - 0x04000004, 0x801f0000, 0x80e40000, 0xa0ff0000, 0x80e40002, 0x04000004, 0x80010002, 0x80ff0000, - 0xa1000002, 0x80000000, 0x03000002, 0x80020002, 0x81000000, 0x80ff0000, 0x03000002, 0x80040002, - 0x81000001, 0x80ff0001, 0x03000002, 0x80040002, 0x80aa0002, 0x80aa0002, 0x03000005, 0x80080002, - 0x80ff0001, 0x80ff0000, 0x04000004, 0x80020002, 0x80aa0002, 0x81550002, 0x80ff0002, 0x03000005, - 0x80040002, 0x80000000, 0x80000001, 0x03000002, 0x80040002, 0x80aa0002, 0x80aa0002, 0x04000058, - 0x80010002, 0x80000002, 0x80550002, 0x80aa0002, 0x03000002, 0x80080003, 0x81550000, 0x80ff0000, - 0x03000002, 0x80010003, 0x81550001, 0x80ff0001, 0x03000002, 0x80010003, 0x80000003, 0x80000003, - 0x04000004, 0x80010003, 0x80000003, 0x81ff0003, 0x80ff0002, 0x04000004, 0x80020003, 0x80ff0000, - 0xa1000002, 0x80550000, 0x03000005, 0x80040003, 0x80550000, 0x80550001, 0x03000002, 0x80040003, - 0x80aa0003, 0x80aa0003, 0x04000058, 0x80020002, 0x80550003, 0x80000003, 0x80aa0003, 0x03000002, - 0x80010003, 0x81aa0000, 0x80ff0000, 0x03000002, 0x80020003, 0x81aa0001, 0x80ff0001, 0x03000002, - 0x80020003, 0x80550003, 0x80550003, 0x04000004, 0x80080002, 0x80550003, 0x81000003, 0x80ff0002, - 0x04000004, 0x80010003, 0x80ff0000, 0xa1000002, 0x80aa0000, 0x03000005, 0x80020003, 0x80aa0000, - 0x80aa0001, 0x03000002, 0x80020003, 0x80550003, 0x80550003, 0x04000058, 0x80040002, 0x80000003, - 0x80ff0002, 0x80550003, 0x03000002, 0x80080002, 0x81ff0000, 0xa0550002, 0x04000004, 0x80070001, - 0x80ff0002, 0x80e40001, 0x80e40002, 0x03000002, 0x80010002, 0x81ff0001, 0xa0550002, 0x04000004, - 0x80070002, 0x80000002, 0x80e40000, 0x80e40001, 0x03000002, 0x80010000, 0x80ff0001, 0x80ff0000, - 0x04000004, 0x80080002, 0x80ff0000, 0x81ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, - 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_11[49] = { - 0xffff0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, - 0x03000005, 0x80010000, 0x80ff0000, 0xa0ff0001, 0x04000004, 0x80110000, 0x80ff0000, 0xa0ff0000, - 0x80000000, 0x03000002, 0x80010000, 0x81000000, 0xa0000002, 0x03000005, 0x80070002, 0x80000000, - 0x80e40001, 0x03000005, 0x80080002, 0x80ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, - 0x0000ffff, -}; - -static DWORD pshader_exceptional_blend_12[39] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0801, 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, - 0xb0e40000, 0xa0e40801, 0x03000005, 0x80010000, 0x80ff0000, 0xa0ff0001, 0x04000004, 0x80110000, - 0x80ff0000, 0xa0ff0000, 0x80000000, 0x03000005, 0x80070002, 0x80000000, 0x80e40001, 0x03000005, - 0x80080002, 0x80ff0001, 0x80000000, 0x02000001, 0x800f0800, 0x80e40002, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations pshader_exceptional_blend_arr[13] = { - { NULL, NULL, { -1, -1, -1, -1, } }, - { pshader_exceptional_blend_1, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_2, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_3, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_4, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_5, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_6, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_7, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_8, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_9, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_10, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_11, NULL, { 0, 1, 0, 1, } }, - { pshader_exceptional_blend_12, NULL, { 0, 1, 0, 1, } }, -}; - -static DWORD pshader_filter_0[77] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40007, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000005, 0x80010000, 0x80ff0000, 0xa0aa0007, - 0x0300000a, 0x80080002, 0x80000000, 0xa0000000, 0x03000005, 0x800f0000, 0x80ff0002, 0xa0e40006, - 0x03000002, 0x80010002, 0x81ff0001, 0xa0000000, 0x04000004, 0x800f0000, 0x80e40000, 0x80000002, - 0x80e40001, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_1[76] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40007, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000005, 0x80010000, 0x80ff0000, 0xa0aa0007, - 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x03000002, 0x80010000, 0x81ff0001, 0xa0000000, - 0x03000005, 0x800f0000, 0x80000000, 0xa0e40006, 0x03000005, 0x800f0000, 0x80000001, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_2[83] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000005, - 0x80010000, 0x80ff0000, 0xa0aa0006, 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x02000001, - 0x80020001, 0xa0550000, 0x0300000b, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000a, 0x80010002, - 0xa0aa0005, 0x80000000, 0x0300000a, 0x80020002, 0xa0ff0005, 0x80550000, 0x03000042, 0x800f0000, - 0x80e40001, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40801, 0x03000002, 0x80010002, - 0x81ff0001, 0xa0000000, 0x04000004, 0x800f0000, 0x80e40000, 0x80000002, 0x80e40001, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_3[82] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000005, - 0x80010000, 0x80ff0000, 0xa0aa0006, 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x02000001, - 0x80020001, 0xa0550000, 0x0300000b, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000a, 0x80010002, - 0xa0aa0005, 0x80000000, 0x0300000a, 0x80020002, 0xa0ff0005, 0x80550000, 0x03000042, 0x800f0000, - 0x80e40001, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40801, 0x03000002, 0x80010001, - 0x81ff0001, 0xa0000000, 0x03000005, 0x800f0000, 0x80e40000, 0x80000001, 0x02000001, 0x800f0800, - 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_4[89] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40007, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000002, 0x80010000, 0x81ff0000, 0xa0000000, - 0x03000005, 0x80010000, 0x80000000, 0xa0aa0007, 0x0300000a, 0x80080002, 0x80000000, 0xa0000000, - 0x03000005, 0x80070000, 0x80ff0002, 0xa0e40006, 0x02000001, 0x80080000, 0xa0ff0006, 0x04000004, - 0x80080000, 0x80ff0000, 0x81ff0002, 0xa0000000, 0x03000005, 0x80070002, 0x80ff0000, 0x80e40001, - 0x04000004, 0x80070001, 0x80e40000, 0x80ff0001, 0x80e40002, 0x02000001, 0x800f0800, 0x80e40001, - 0x0000ffff, -}; - -static DWORD pshader_filter_5[76] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40007, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000002, 0x80010000, 0x81ff0000, 0xa0000000, - 0x03000005, 0x80010000, 0x80000000, 0xa0aa0007, 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, - 0x03000005, 0x800f0000, 0x80ff0001, 0xa0e40006, 0x03000005, 0x800f0000, 0x80000001, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_6[87] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000005, - 0x80010000, 0x80ff0000, 0xa0aa0006, 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x02000001, - 0x80020001, 0xa0550000, 0x0300000b, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000a, 0x80010002, - 0xa0aa0005, 0x80000000, 0x0300000a, 0x80020002, 0xa0ff0005, 0x80550000, 0x03000042, 0x800f0000, - 0x80e40001, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40801, 0x03000002, 0x80080000, - 0x81ff0000, 0xa0000000, 0x03000005, 0x80070002, 0x80ff0000, 0x80e40001, 0x04000004, 0x80070001, - 0x80e40000, 0x80ff0001, 0x80e40002, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_filter_7[78] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000005, - 0x80010000, 0x80ff0000, 0xa0aa0006, 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x02000001, - 0x80020001, 0xa0550000, 0x0300000b, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000a, 0x80010002, - 0xa0aa0005, 0x80000000, 0x0300000a, 0x80020002, 0xa0ff0005, 0x80550000, 0x03000042, 0x800f0000, - 0x80e40001, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40801, 0x03000005, 0x800f0000, - 0x80e40000, 0x80ff0001, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_8[45] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0801, 0x0300000b, 0x80030000, 0xb0e40000, - 0xa0e40004, 0x0300000a, 0x80010001, 0xa0aa0004, 0x80000000, 0x0300000a, 0x80020001, 0xa0ff0004, - 0x80550000, 0x03000042, 0x800f0000, 0x80e40001, 0xa0e40801, 0x02000001, 0x80080001, 0xa0ff0005, - 0x03000002, 0x80010001, 0x81ff0001, 0xa0000000, 0x04000004, 0x800f0000, 0x80e40000, 0x80000001, - 0xa0e40005, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_9[5] = { - 0xffff0200, 0x02000001, 0x800f0800, 0xa0e40004, 0x0000ffff, -}; - -static DWORD pshader_filter_10[83] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000005, - 0x80010000, 0x80ff0000, 0xa0aa0006, 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x02000001, - 0x80020001, 0xa0550000, 0x0300000b, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000a, 0x80010002, - 0xa0aa0005, 0x80000000, 0x0300000a, 0x80020002, 0xa0ff0005, 0x80550000, 0x03000042, 0x800f0000, - 0x80e40001, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40801, 0x03000002, 0x80010002, - 0x81ff0000, 0xa0000000, 0x04000004, 0x800f0000, 0x80e40001, 0x80000002, 0x80e40000, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_11[55] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0802, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000005, 0x80010000, 0x80ff0000, 0xa0aa0005, - 0x0300000a, 0x80010001, 0x80000000, 0xa0000000, 0x02000001, 0x80020001, 0xa0550000, 0x03000042, - 0x800f0000, 0x80e40001, 0xa0e40802, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_16[108] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40008, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40004, - 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0002, 0x80e40002, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, - 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0002, 0x03000005, 0x80010000, 0x80000000, 0xa0aa0008, - 0x02000001, 0x80120000, 0x80000000, 0x02000001, 0x80110000, 0x81000000, 0x03000005, 0x800f0002, - 0x80550000, 0xa0e40007, 0x04000004, 0x800f0000, 0x80000000, 0xa0e40006, 0x80e40002, 0x03000002, - 0x80010002, 0x81ff0001, 0xa0000000, 0x04000004, 0x800f0000, 0x80e40000, 0x80000002, 0x80e40001, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_17[107] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40008, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40004, - 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0002, 0x80e40002, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, - 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0002, 0x03000005, 0x80010000, 0x80000000, 0xa0aa0008, - 0x02000001, 0x80120000, 0x80000000, 0x02000001, 0x80110000, 0x81000000, 0x03000005, 0x800f0002, - 0x80550000, 0xa0e40007, 0x04000004, 0x800f0000, 0x80000000, 0xa0e40006, 0x80e40002, 0x03000002, - 0x80010001, 0x81ff0001, 0xa0000000, 0x03000005, 0x800f0000, 0x80e40000, 0x80000001, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_18[108] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0006, 0x0300000b, - 0x80030001, 0x801b0000, 0xa0e40004, 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020002, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, - 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, - 0x80010000, 0x80000000, 0xa0aa0006, 0x04000004, 0x80110000, 0x80000000, 0xa0000000, 0xa0000000, - 0x02000001, 0x80020000, 0xa0000000, 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, - 0x80010001, 0xa0aa0005, 0x80ff0000, 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000002, - 0x80010002, 0x81ff0001, 0xa0550000, 0x04000004, 0x800f0000, 0x80e40000, 0x80000002, 0x80e40001, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_19[107] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0006, 0x0300000b, - 0x80030001, 0x801b0000, 0xa0e40004, 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020002, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, - 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, - 0x80010000, 0x80000000, 0xa0aa0006, 0x04000004, 0x80110000, 0x80000000, 0xa0000000, 0xa0000000, - 0x02000001, 0x80020000, 0xa0000000, 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, - 0x80010001, 0xa0aa0005, 0x80ff0000, 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000002, - 0x80010001, 0x81ff0001, 0xa0550000, 0x03000005, 0x800f0000, 0x80e40000, 0x80000001, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_20[112] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40008, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40004, - 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0002, 0x80e40002, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, - 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0002, 0x03000005, 0x80010000, 0x80000000, 0xa0aa0008, - 0x02000001, 0x80120000, 0x80000000, 0x02000001, 0x80110000, 0x81000000, 0x03000005, 0x800f0002, - 0x80550000, 0xa0e40007, 0x04000004, 0x800f0000, 0x80000000, 0xa0e40006, 0x80e40002, 0x03000002, - 0x80080000, 0x81ff0000, 0xa0000000, 0x03000005, 0x80070002, 0x80ff0000, 0x80e40001, 0x04000004, - 0x80070001, 0x80e40000, 0x80ff0001, 0x80e40002, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_filter_21[97] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, - 0x90000000, 0xa00f0801, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40008, 0x0300000b, 0x80030001, - 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, - 0xa0ff0004, 0x80550001, 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0008, 0x0300000b, 0x80030001, - 0x801b0000, 0xa0e40004, 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, - 0xa0ff0004, 0x80550001, 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, - 0xa0aa0005, 0x80ff0000, 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, - 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0002, 0x80e40002, 0xa0e40800, 0x03000042, 0x800f0001, - 0x80e40001, 0xa0e40801, 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0002, 0x03000005, 0x80010000, - 0x80000000, 0xa0aa0008, 0x02000001, 0x80120000, 0x80000000, 0x02000001, 0x80110000, 0x81000000, - 0x03000005, 0x800f0002, 0x80550000, 0xa0e40007, 0x04000004, 0x800f0000, 0x80000000, 0xa0e40006, - 0x80e40002, 0x03000005, 0x800f0000, 0x80ff0001, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, - 0x0000ffff, -}; - -static DWORD pshader_filter_22[112] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0006, 0x0300000b, - 0x80030001, 0x801b0000, 0xa0e40004, 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020002, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, - 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, - 0x80010000, 0x80000000, 0xa0aa0006, 0x04000004, 0x80110000, 0x80000000, 0xa0000000, 0xa0000000, - 0x02000001, 0x80020000, 0xa0000000, 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, - 0x80010001, 0xa0aa0005, 0x80ff0000, 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000002, - 0x80080000, 0x81ff0000, 0xa0550000, 0x03000005, 0x80070002, 0x80ff0000, 0x80e40001, 0x04000004, - 0x80070001, 0x80e40000, 0x80ff0001, 0x80e40002, 0x02000001, 0x800f0800, 0x80e40001, 0x0000ffff, -}; - -static DWORD pshader_filter_23[103] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0006, 0x0300000b, - 0x80030001, 0x801b0000, 0xa0e40004, 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020002, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, - 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, - 0x80010000, 0x80000000, 0xa0aa0006, 0x04000004, 0x80110000, 0x80000000, 0xa0000000, 0xa0000000, - 0x02000001, 0x80020000, 0xa0000000, 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, - 0x80010001, 0xa0aa0005, 0x80ff0000, 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000005, - 0x800f0000, 0x80e40000, 0x80ff0001, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_24[108] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40008, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40004, - 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0004, 0x80550001, - 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, 0x80010001, 0xa0aa0005, 0x80ff0000, - 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, - 0x03000042, 0x800f0002, 0x80e40002, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, - 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0002, 0x03000005, 0x80010000, 0x80000000, 0xa0aa0008, - 0x02000001, 0x80120000, 0x80000000, 0x02000001, 0x80110000, 0x81000000, 0x03000005, 0x800f0002, - 0x80550000, 0xa0e40007, 0x04000004, 0x800f0000, 0x80000000, 0xa0e40006, 0x80e40002, 0x03000002, - 0x80010002, 0x81ff0000, 0xa0000000, 0x04000004, 0x800f0000, 0x80e40001, 0x80000002, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_25[74] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40007, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, - 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa11b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40004, 0x0300000a, - 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0004, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000002, - 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, 0x80010000, 0x80000000, 0xa0aa0007, 0x02000001, - 0x80120000, 0x80000000, 0x02000001, 0x80110000, 0x81000000, 0x03000005, 0x800f0001, 0x80550000, - 0xa0e40006, 0x04000004, 0x800f0000, 0x80000000, 0xa0e40005, 0x80e40001, 0x02000001, 0x800f0800, - 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_26[108] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f000000, 0x3f800000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801, - 0x0200001f, 0x90000000, 0xa00f0802, 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40006, 0x0300000b, - 0x80030001, 0x80e40000, 0xa0e40004, 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020000, 0xa0ff0004, 0x80550001, 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0006, 0x0300000b, - 0x80030001, 0x801b0000, 0xa0e40004, 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, - 0x80020002, 0xa0ff0004, 0x80550001, 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, - 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, - 0x80010000, 0x80000000, 0xa0aa0006, 0x04000004, 0x80110000, 0x80000000, 0xa0000000, 0xa0000000, - 0x02000001, 0x80020000, 0xa0000000, 0x0300000b, 0x800c0000, 0xb01b0000, 0xa01b0005, 0x0300000a, - 0x80010001, 0xa0aa0005, 0x80ff0000, 0x0300000a, 0x80020001, 0xa0ff0005, 0x80aa0000, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40802, 0x03000042, 0x800f0001, 0x80e40001, 0xa0e40801, 0x03000002, - 0x80010002, 0x81ff0000, 0xa0550000, 0x04000004, 0x800f0000, 0x80e40001, 0x80000002, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_filter_27[80] = { - 0xffff0200, 0x05000051, 0xa00f0000, 0x3f000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0802, - 0x03000002, 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40004, - 0x0300000a, 0x80010000, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0004, 0x80550001, - 0x03000002, 0x800c0000, 0xb01b0000, 0xa11b0005, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40004, - 0x0300000a, 0x80010002, 0xa0aa0004, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0004, 0x80550001, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, - 0x03000002, 0x80010000, 0x81ff0000, 0x80ff0001, 0x03000005, 0x80010000, 0x80000000, 0xa0aa0005, - 0x04000004, 0x80110000, 0x80000000, 0xa0000000, 0xa0000000, 0x02000001, 0x80020000, 0xa0000000, - 0x03000042, 0x800f0000, 0x80e40000, 0xa0e40802, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations pshader_filter_arr[32] = { - { pshader_filter_0, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_1, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_2, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_3, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_4, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_5, NULL, { 0, 1, 6, 7, -1, 4, 5, -1, } }, - { pshader_filter_6, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_7, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_8, NULL, { -1, 1, 5, -1, -1, -1, 4, -1, } }, - { pshader_filter_9, NULL, { -1, -1, 4, -1, -1, -1, -1, -1, } }, - { pshader_filter_10, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_11, NULL, { 0, -1, -1, 5, 2, 4, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { pshader_filter_16, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_17, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_18, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_19, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_20, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_21, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_22, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_23, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_24, NULL, { 0, 1, 6, 8, -1, 4, 5, 7, } }, - { pshader_filter_25, NULL, { 0, -1, 5, 7, -1, 4, -1, 6, } }, - { pshader_filter_26, NULL, { 0, 1, -1, 6, 2, 4, 5, -1, } }, - { pshader_filter_27, NULL, { 0, -1, -1, 5, 2, 4, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, -1, -1, -1, -1, -1, } }, -}; - -static DWORD pshader_blur_2[60] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40006, 0x0300000a, - 0x80010000, 0xa0aa0006, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0006, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40006, 0x0300000a, - 0x80010002, 0xa0aa0006, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0006, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000005, - 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, - 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_blur_3[85] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40007, 0x0300000a, - 0x80010000, 0xa0aa0007, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0007, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40007, 0x0300000a, - 0x80010002, 0xa0aa0007, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0007, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40007, 0x0300000a, - 0x80010003, 0xa0aa0007, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff0007, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000005, 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, - 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, - 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_blur_4[110] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40008, 0x0300000a, - 0x80010000, 0xa0aa0008, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0008, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40008, 0x0300000a, - 0x80010002, 0xa0aa0008, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0008, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40008, 0x0300000a, - 0x80010003, 0xa0aa0008, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff0008, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40008, 0x0300000a, - 0x80010004, 0xa0aa0008, 0x80000001, 0x0300000a, 0x80020004, 0xa0ff0008, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000042, 0x800f0003, 0x80e40004, 0xa0e40800, 0x03000005, - 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, - 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40003, - 0xa0aa0007, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_blur_5[135] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e40009, 0x0300000a, - 0x80010000, 0xa0aa0009, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff0009, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40009, 0x0300000a, - 0x80010002, 0xa0aa0009, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff0009, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40009, 0x0300000a, - 0x80010003, 0xa0aa0009, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff0009, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40009, 0x0300000a, - 0x80010004, 0xa0aa0009, 0x80000001, 0x0300000a, 0x80020004, 0xa0ff0009, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e40009, 0x0300000a, - 0x80010005, 0xa0aa0009, 0x80000001, 0x0300000a, 0x80020005, 0xa0ff0009, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000042, 0x800f0003, 0x80e40004, 0xa0e40800, 0x03000042, - 0x800f0004, 0x80e40005, 0xa0e40800, 0x03000005, 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, - 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, - 0x80e40000, 0x04000004, 0x800f0000, 0x80e40003, 0xa0aa0007, 0x80e40000, 0x04000004, 0x800f0000, - 0x80e40004, 0xa0aa0008, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_blur_6[160] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e4000a, 0x0300000a, - 0x80010000, 0xa0aa000a, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff000a, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000a, 0x0300000a, - 0x80010002, 0xa0aa000a, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff000a, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000a, 0x0300000a, - 0x80010003, 0xa0aa000a, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff000a, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000a, 0x0300000a, - 0x80010004, 0xa0aa000a, 0x80000001, 0x0300000a, 0x80020004, 0xa0ff000a, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000a, 0x0300000a, - 0x80010005, 0xa0aa000a, 0x80000001, 0x0300000a, 0x80020005, 0xa0ff000a, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0009, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000a, 0x0300000a, - 0x80010006, 0xa0aa000a, 0x80000001, 0x0300000a, 0x80020006, 0xa0ff000a, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000042, 0x800f0003, 0x80e40004, 0xa0e40800, 0x03000042, - 0x800f0004, 0x80e40005, 0xa0e40800, 0x03000042, 0x800f0005, 0x80e40006, 0xa0e40800, 0x03000005, - 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, - 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40003, - 0xa0aa0007, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40004, 0xa0aa0008, 0x80e40000, 0x04000004, - 0x800f0000, 0x80e40005, 0xa0aa0009, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_blur_7[185] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e4000b, 0x0300000a, - 0x80010000, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff000b, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000b, 0x0300000a, - 0x80010002, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff000b, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000b, 0x0300000a, - 0x80010003, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff000b, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000b, 0x0300000a, - 0x80010004, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020004, 0xa0ff000b, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000b, 0x0300000a, - 0x80010005, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020005, 0xa0ff000b, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0009, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000b, 0x0300000a, - 0x80010006, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020006, 0xa0ff000b, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b000a, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000b, 0x0300000a, - 0x80010007, 0xa0aa000b, 0x80000001, 0x0300000a, 0x80020007, 0xa0ff000b, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000042, 0x800f0003, 0x80e40004, 0xa0e40800, 0x03000042, - 0x800f0004, 0x80e40005, 0xa0e40800, 0x03000042, 0x800f0005, 0x80e40006, 0xa0e40800, 0x03000042, - 0x800f0006, 0x80e40007, 0xa0e40800, 0x03000005, 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, - 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, - 0x80e40000, 0x04000004, 0x800f0000, 0x80e40003, 0xa0aa0007, 0x80e40000, 0x04000004, 0x800f0000, - 0x80e40004, 0xa0aa0008, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40005, 0xa0aa0009, 0x80e40000, - 0x04000004, 0x800f0000, 0x80e40006, 0xa0aa000a, 0x80e40000, 0x02000001, 0x800f0800, 0x80e40000, - 0x0000ffff, -}; - -static DWORD pshader_blur_8[210] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e4000c, 0x0300000a, - 0x80010000, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010002, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010003, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010004, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020004, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010005, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020005, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0009, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010006, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020006, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b000a, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010007, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020007, 0xa0ff000c, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b000b, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000c, 0x0300000a, - 0x80010008, 0xa0aa000c, 0x80000001, 0x0300000a, 0x80020008, 0xa0ff000c, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000042, 0x800f0003, 0x80e40004, 0xa0e40800, 0x03000042, - 0x800f0004, 0x80e40005, 0xa0e40800, 0x03000042, 0x800f0005, 0x80e40006, 0xa0e40800, 0x03000042, - 0x800f0006, 0x80e40007, 0xa0e40800, 0x03000042, 0x800f0007, 0x80e40008, 0xa0e40800, 0x03000005, - 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, - 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40003, - 0xa0aa0007, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40004, 0xa0aa0008, 0x80e40000, 0x04000004, - 0x800f0000, 0x80e40005, 0xa0aa0009, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40006, 0xa0aa000a, - 0x80e40000, 0x04000004, 0x800f0000, 0x80e40007, 0xa0aa000b, 0x80e40000, 0x02000001, 0x800f0800, - 0x80e40000, 0x0000ffff, -}; - -static DWORD pshader_blur_9[235] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000002, - 0x80030000, 0xb0e40000, 0xa0e40005, 0x0300000b, 0x80030001, 0x80e40000, 0xa0e4000d, 0x0300000a, - 0x80010000, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020000, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0004, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010002, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020002, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0006, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010003, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020003, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0007, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010004, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020004, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0008, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010005, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020005, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b0009, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010006, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020006, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b000a, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010007, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020007, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b000b, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010008, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020008, 0xa0ff000d, 0x80550001, 0x03000002, - 0x800c0000, 0xb01b0000, 0xa01b000c, 0x0300000b, 0x80030001, 0x801b0000, 0xa0e4000d, 0x0300000a, - 0x80010009, 0xa0aa000d, 0x80000001, 0x0300000a, 0x80020009, 0xa0ff000d, 0x80550001, 0x03000042, - 0x800f0000, 0x80e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0x80e40002, 0xa0e40800, 0x03000042, - 0x800f0002, 0x80e40003, 0xa0e40800, 0x03000042, 0x800f0003, 0x80e40004, 0xa0e40800, 0x03000042, - 0x800f0004, 0x80e40005, 0xa0e40800, 0x03000042, 0x800f0005, 0x80e40006, 0xa0e40800, 0x03000042, - 0x800f0006, 0x80e40007, 0xa0e40800, 0x03000042, 0x800f0007, 0x80e40008, 0xa0e40800, 0x03000042, - 0x800f0008, 0x80e40009, 0xa0e40800, 0x03000005, 0x800f0000, 0x80e40000, 0xa0aa0005, 0x04000004, - 0x800f0000, 0x80e40001, 0xa0aa0004, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40002, 0xa0aa0006, - 0x80e40000, 0x04000004, 0x800f0000, 0x80e40003, 0xa0aa0007, 0x80e40000, 0x04000004, 0x800f0000, - 0x80e40004, 0xa0aa0008, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40005, 0xa0aa0009, 0x80e40000, - 0x04000004, 0x800f0000, 0x80e40006, 0xa0aa000a, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40007, - 0xa0aa000b, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40008, 0xa0aa000c, 0x80e40000, 0x02000001, - 0x800f0800, 0x80e40000, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations pshader_blur_arr[10] = { - { NULL, NULL, { -1, -1, -1, } }, - { NULL, NULL, { -1, -1, -1, } }, - { pshader_blur_2, NULL, { 0, 4, 6, } }, - { pshader_blur_3, NULL, { 0, 4, 7, } }, - { pshader_blur_4, NULL, { 0, 4, 8, } }, - { pshader_blur_5, NULL, { 0, 4, 9, } }, - { pshader_blur_6, NULL, { 0, 4, 10, } }, - { pshader_blur_7, NULL, { 0, 4, 11, } }, - { pshader_blur_8, NULL, { 0, 4, 12, } }, - { pshader_blur_9, NULL, { 0, 4, 13, } }, -}; - -static DWORD pshader_color_matrix_0[50] = { - 0xffff0200, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000042, - 0x800f0000, 0xb0e40000, 0xa0e40800, 0x03000009, 0x80080001, 0xa0e40004, 0x80e40000, 0x04000004, - 0x80010001, 0xa0000008, 0x80ff0000, 0x80ff0001, 0x03000009, 0x80080001, 0xa0e40005, 0x80e40000, - 0x04000004, 0x80020001, 0xa0550008, 0x80ff0000, 0x80ff0001, 0x03000009, 0x80080001, 0xa0e40006, - 0x80e40000, 0x04000004, 0x80040001, 0xa0aa0008, 0x80ff0000, 0x80ff0001, 0x03000005, 0x80080000, - 0x80ff0000, 0xa0ff0007, 0x03000005, 0x80070000, 0x80e40001, 0xa0ff0007, 0x02000001, 0x800f0800, - 0x80e40000, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations pshader_color_matrix_arr[1] = { - { pshader_color_matrix_0, NULL, { 0, 4, } }, -}; - -static DWORD pshader_manual_clear_0[5] = { - 0xffff0200, 0x02000001, 0x800f0800, 0xa0e40000, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations pshader_manual_clear_arr[1] = { - { pshader_manual_clear_0, NULL, { 0, } }, -}; - -static DWORD vshader_vsd3d9_0[65] = { - 0xfffe0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0x900f0000, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40001, 0x03000005, 0x80070000, - 0x80000000, 0xa0e40006, 0x03000009, 0x80080000, 0x90e40000, 0xa0e40000, 0x04000004, 0x80070000, - 0x80ff0000, 0xa0e40005, 0x80e40000, 0x03000002, 0x80070000, 0x80e40000, 0xa0e40007, 0x02000006, - 0x80040000, 0x80aa0000, 0x03000005, 0xc0030000, 0x80aa0000, 0x80e40000, 0x03000009, 0x80010000, - 0xa0e40003, 0x90e40000, 0x03000009, 0x80020000, 0xa0e40004, 0x90e40000, 0x03000005, 0xe0030000, - 0x80aa0000, 0x80e40000, 0x02000001, 0xe0080000, 0x80aa0000, 0x02000001, 0x80040000, 0xa0aa0000, - 0x04000004, 0xc00c0000, 0x80aa0000, 0xa0440002, 0xa0140002, 0x02000001, 0xe0040000, 0xa0000002, - 0x0000ffff, -}; - -static DWORD vshader_vsd3d9_1[143] = { - 0xfffe0200, 0x05000051, 0xa00f0008, 0x3c800000, 0x3d000000, 0x00000000, 0xbf800000, 0x05000051, - 0xa00f0009, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, - 0x0200001f, 0x80000005, 0x900f0001, 0x03000005, 0x80070000, 0x90c90001, 0xa0d00008, 0x03000005, - 0x800f0001, 0x80440000, 0xa0e40002, 0x03000002, 0x80030001, 0x80ed0001, 0x80e80001, 0x02000001, - 0x800c0001, 0xa0aa0008, 0x03000009, 0x80010002, 0x80f40001, 0xa0e40000, 0x03000009, 0x80020002, - 0x80e40001, 0xa0e40001, 0x03000005, 0x80030001, 0x80e40002, 0x80e40002, 0x03000002, 0x80080000, - 0x80550001, 0x80000001, 0x02000007, 0x80080000, 0x80ff0000, 0x02000006, 0x80080000, 0x80ff0000, - 0x0300000c, 0x80010001, 0x81ff0000, 0x80ff0000, 0x04000012, 0x80040002, 0x80000001, 0x80ff0000, - 0xa1ff0008, 0x02000006, 0x80080000, 0x80aa0002, 0x03000005, 0x80030000, 0x80e40000, 0x80e40000, - 0x03000002, 0x80010000, 0x80550000, 0x80000000, 0x02000007, 0x80010000, 0x80000000, 0x02000006, - 0x80010000, 0x80000000, 0x03000005, 0x80010000, 0x80ff0000, 0x80000000, 0x03000009, 0x80010001, - 0x90e40000, 0xa0e40000, 0x03000009, 0x80020001, 0x90e40000, 0xa0e40001, 0x04000004, 0x80030000, - 0x80e40002, 0x80000000, 0x80e40001, 0x03000005, 0x80070001, 0x80550000, 0xa0e40006, 0x04000004, - 0x800b0000, 0x80000000, 0xa0a40005, 0x80a40001, 0x03000002, 0x800b0000, 0x80e40000, 0xa0a40007, - 0x02000006, 0x80080000, 0x80ff0000, 0x03000005, 0xc0030000, 0x80ff0000, 0x80e40000, 0x03000009, - 0x80010000, 0xa0e40003, 0x90e40000, 0x03000009, 0x80020000, 0xa0e40004, 0x90e40000, 0x03000005, - 0xe0070000, 0x80ff0000, 0x80e40000, 0x02000001, 0xe0080000, 0x80ff0000, 0x02000001, 0x80040000, - 0xa0aa0000, 0x04000004, 0xc00c0000, 0x80aa0000, 0xa0440009, 0xa0140009, 0x0000ffff, -}; - -static DWORD vshader_vsd3d9_2[60] = { - 0xfffe0200, 0x05000051, 0xa00f0002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, - 0x80000000, 0x900f0000, 0x0200001f, 0x80000005, 0x900f0001, 0x03000009, 0x80010000, 0x90e40000, - 0xa0e40001, 0x03000005, 0x80070000, 0x80000000, 0xa0e40006, 0x03000009, 0x80080000, 0x90e40000, - 0xa0e40000, 0x04000004, 0x80070000, 0x80ff0000, 0xa0e40005, 0x80e40000, 0x03000002, 0x80070000, - 0x80e40000, 0xa0e40007, 0x02000006, 0x80040000, 0x80aa0000, 0x03000005, 0xc0030000, 0x80aa0000, - 0x80e40000, 0x03000005, 0xe0030000, 0x80aa0000, 0x90e40001, 0x02000001, 0xe0080000, 0x80aa0000, - 0x02000001, 0x80040000, 0xa0aa0000, 0x04000004, 0xc00c0000, 0x80aa0000, 0xa0440002, 0xa0140002, - 0x02000001, 0xe0040000, 0xa0000002, 0x0000ffff, -}; - -static ProgramWithCachedVariableLocations vshader_vsd3d9_arr[3] = { - { vshader_vsd3d9_0, NULL, { 0 } }, - { vshader_vsd3d9_1, NULL, { 0 } }, - { vshader_vsd3d9_2, NULL, { 0 } }, -}; - diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_wgl.c b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_wgl.c deleted file mode 100644 index df2a78e90..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_wgl.c +++ /dev/null @@ -1,219 +0,0 @@ -// gdraw_wgl.c - copyright 2011-2012 RAD Game Tools -// -// This implements the Iggy graphics driver layer for GL on Windows. - -#define GDRAW_ASSERTS - -#include "../include/iggy.h" -#include "../include/gdraw.h" -#include "gdraw_wgl.h" -#include -#include -#include "glext.h" -#include -#include - -#define true 1 -#define false 0 - -/////////////////////////////////////////////////////////////////////////////// -// -// Extensions (we map to GL 2.0 function names for a uniform interface -// across platforms) -// - -#define GDRAW_GL_EXTENSION_LIST \ - /* identifier import procname */ \ - /* GL_ARB_multitexture */ \ - GLE(ActiveTexture, "ActiveTextureARB", ACTIVETEXTUREARB) \ - /* GL_ARB_texture_compression */ \ - GLE(CompressedTexImage2D, "CompressedTexImage2DARB", \ - COMPRESSEDTEXIMAGE2DARB) \ - /* GL_ARB_vertex_buffer_object */ \ - GLE(GenBuffers, "GenBuffersARB", GENBUFFERSARB) \ - GLE(DeleteBuffers, "DeleteBuffersARB", DELETEBUFFERSARB) \ - GLE(BindBuffer, "BindBufferARB", BINDBUFFERARB) \ - GLE(BufferData, "BufferDataARB", BUFFERDATAARB) \ - GLE(MapBuffer, "MapBufferARB", MAPBUFFERARB) \ - GLE(UnmapBuffer, "UnmapBufferARB", UNMAPBUFFERARB) \ - GLE(VertexAttribPointer, "VertexAttribPointerARB", VERTEXATTRIBPOINTERARB) \ - GLE(EnableVertexAttribArray, "EnableVertexAttribArrayARB", \ - ENABLEVERTEXATTRIBARRAYARB) \ - GLE(DisableVertexAttribArray, "DisableVertexAttribArrayARB", \ - DISABLEVERTEXATTRIBARRAYARB) \ - /* GL_ARB_shader_objects */ \ - GLE(CreateShader, "CreateShaderObjectARB", CREATESHADEROBJECTARB) \ - GLE(DeleteShader, "DeleteObjectARB", DELETEOBJECTARB) \ - GLE(ShaderSource, "ShaderSourceARB", SHADERSOURCEARB) \ - GLE(CompileShader, "CompileShaderARB", COMPILESHADERARB) \ - GLE(GetShaderiv, "GetObjectParameterivARB", GETOBJECTPARAMETERIVARB) \ - GLE(GetShaderInfoLog, "GetInfoLogARB", GETINFOLOGARB) \ - GLE(CreateProgram, "CreateProgramObjectARB", CREATEPROGRAMOBJECTARB) \ - GLE(DeleteProgram, "DeleteObjectARB", DELETEOBJECTARB) \ - GLE(AttachShader, "AttachObjectARB", ATTACHOBJECTARB) \ - GLE(LinkProgram, "LinkProgramARB", LINKPROGRAMARB) \ - GLE(GetUniformLocation, "GetUniformLocationARB", GETUNIFORMLOCATIONARB) \ - GLE(UseProgram, "UseProgramObjectARB", USEPROGRAMOBJECTARB) \ - GLE(GetProgramiv, "GetObjectParameterivARB", GETOBJECTPARAMETERIVARB) \ - GLE(GetProgramInfoLog, "GetInfoLogARB", GETINFOLOGARB) \ - GLE(Uniform1i, "Uniform1iARB", UNIFORM1IARB) \ - GLE(Uniform4f, "Uniform4fARB", UNIFORM4FARB) \ - GLE(Uniform4fv, "Uniform4fvARB", UNIFORM4FVARB) \ - /* GL_ARB_vertex_shader */ \ - GLE(BindAttribLocation, "BindAttribLocationARB", BINDATTRIBLOCATIONARB) \ - /* GL_EXT_framebuffer_object */ \ - GLE(GenRenderbuffers, "GenRenderbuffersEXT", GENRENDERBUFFERSEXT) \ - GLE(DeleteRenderbuffers, "DeleteRenderbuffersEXT", DELETERENDERBUFFERSEXT) \ - GLE(BindRenderbuffer, "BindRenderbufferEXT", BINDRENDERBUFFEREXT) \ - GLE(RenderbufferStorage, "RenderbufferStorageEXT", RENDERBUFFERSTORAGEEXT) \ - GLE(GenFramebuffers, "GenFramebuffersEXT", GENFRAMEBUFFERSEXT) \ - GLE(DeleteFramebuffers, "DeleteFramebuffersEXT", DELETEFRAMEBUFFERSEXT) \ - GLE(BindFramebuffer, "BindFramebufferEXT", BINDFRAMEBUFFEREXT) \ - GLE(CheckFramebufferStatus, "CheckFramebufferStatusEXT", \ - CHECKFRAMEBUFFERSTATUSEXT) \ - GLE(FramebufferRenderbuffer, "FramebufferRenderbufferEXT", \ - FRAMEBUFFERRENDERBUFFEREXT) \ - GLE(FramebufferTexture2D, "FramebufferTexture2DEXT", \ - FRAMEBUFFERTEXTURE2DEXT) \ - GLE(GenerateMipmap, "GenerateMipmapEXT", GENERATEMIPMAPEXT) \ - /* GL_EXT_framebuffer_blit */ \ - GLE(BlitFramebuffer, "BlitFramebufferEXT", BLITFRAMEBUFFEREXT) \ - /* GL_EXT_framebuffer_multisample */ \ - GLE(RenderbufferStorageMultisample, "RenderbufferStorageMultisampleEXT", \ - RENDERBUFFERSTORAGEMULTISAMPLEEXT) \ - /* */ - -#define gdraw_GLx_(id) gdraw_GL_##id -#define GDRAW_GLx_(id) GDRAW_GL_##id -#define GDRAW_SHADERS "gdraw_gl_shaders.inl" - -typedef GLhandleARB GLhandle; -typedef gdraw_gl_resourcetype gdraw_resourcetype; - -// Extensions -#define GLE(id, import, procname) static PFNGL##procname##PROC gl##id; -GDRAW_GL_EXTENSION_LIST -#undef GLE - -static void load_extensions(void) { -#define GLE(id, import, procname) \ - gl##id = (PFNGL##procname##PROC)wglGetProcAddress("gl" import); - GDRAW_GL_EXTENSION_LIST -#undef GLE -} - -static void clear_renderstate_platform_specific(void) { - glDisable(GL_ALPHA_TEST); -} - -static void error_msg_platform_specific(const char* msg) { - OutputDebugStringA(msg); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Shared code -// - -#define GDRAW_MULTISAMPLING -#include "gdraw_gl_shared.inl" - -/////////////////////////////////////////////////////////////////////////////// -// -// Initialization and platform-specific functionality -// - -GDrawFunctions* gdraw_GL_CreateContext(S32 w, S32 h, S32 msaa_samples) { - static const TextureFormatDesc tex_formats[] = { - {IFT_FORMAT_rgba_8888, 1, 1, 4, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE}, - {IFT_FORMAT_rgba_4444_LE, 1, 1, 2, GL_RGBA4, GL_RGBA, - GL_UNSIGNED_SHORT_4_4_4_4}, - {IFT_FORMAT_rgba_5551_LE, 1, 1, 2, GL_RGB5_A1, GL_RGBA, - GL_UNSIGNED_SHORT_5_5_5_1}, - {IFT_FORMAT_la_88, 1, 1, 2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, - GL_UNSIGNED_BYTE}, - {IFT_FORMAT_la_44, 1, 1, 1, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE_ALPHA, - GL_UNSIGNED_BYTE}, - {IFT_FORMAT_i_8, 1, 1, 1, GL_INTENSITY8, GL_ALPHA, GL_UNSIGNED_BYTE}, - {IFT_FORMAT_i_4, 1, 1, 1, GL_INTENSITY4, GL_ALPHA, GL_UNSIGNED_BYTE}, - {IFT_FORMAT_l_8, 1, 1, 1, GL_LUMINANCE8, GL_LUMINANCE, - GL_UNSIGNED_BYTE}, - {IFT_FORMAT_l_4, 1, 1, 1, GL_LUMINANCE4, GL_LUMINANCE, - GL_UNSIGNED_BYTE}, - {IFT_FORMAT_DXT1, 4, 4, 8, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 0, - GL_UNSIGNED_BYTE}, - {IFT_FORMAT_DXT3, 4, 4, 16, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 0, - GL_UNSIGNED_BYTE}, - {IFT_FORMAT_DXT5, 4, 4, 16, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 0, - GL_UNSIGNED_BYTE}, - {0, 0, 0, 0, 0, 0, 0}, - }; - - GDrawFunctions* funcs; - const char* s; - GLint n; - - // check for the extensions we need - s = (const char*)glGetString(GL_EXTENSIONS); - if (s == NULL) { - assert(s != NULL); // if this is NULL, you're probably trying to create - // the device too early - return NULL; - } - - // check for the extensions we won't work without - if (!hasext(s, "GL_ARB_multitexture") || - !hasext(s, "GL_ARB_texture_compression") || - !hasext(s, "GL_ARB_texture_mirrored_repeat") || - !hasext( - s, - "GL_ARB_texture_non_power_of_two") || // with caveats - see below! - !hasext(s, "GL_ARB_vertex_buffer_object") || - !hasext(s, "GL_EXT_framebuffer_object") || - !hasext(s, "GL_ARB_shader_objects") || - !hasext(s, "GL_ARB_vertex_shader") || - !hasext(s, "GL_ARB_fragment_shader")) - return NULL; - - // if user requests multisampling and HW doesn't support it, bail - if (!hasext(s, "GL_EXT_framebuffer_multisample") && msaa_samples > 1) - return NULL; - - load_extensions(); - funcs = create_context(w, h); - if (!funcs) return NULL; - - gdraw->tex_formats = tex_formats; - - // check for optional extensions - gdraw->has_mapbuffer = true; // part of core VBO extension on regular GL - gdraw->has_depth24 = true; // we just assume. - gdraw->has_texture_max_level = true; // core on regular GL - - if (hasext(s, "GL_EXT_packed_depth_stencil")) - gdraw->has_packed_depth_stencil = true; - - // we require ARB_texture_non_power_of_two - on actual HW, this may either - // give us "full" non-power-of-two support, or "conditional" - // non-power-of-two (wrap mode must be CLAMP_TO_EDGE, no mipmaps). figure - // out which it is using this heuristic by Unity's Aras Pranckevicius - // (thanks!): - // http://www.aras-p.info/blog/2012/10/17/non-power-of-two-textures/ - // - // we use the second heuristic (texture size <8192 for cards without full - // NPOT support) since we don't otherwise use ARB_fragment_program and don't - // want to create a program just to be able to query - // MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB! - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &n); - gdraw->has_conditional_non_power_of_two = n < 8192; - - // clamp number of multisampling levels to max supported - if (msaa_samples > 1) { - glGetIntegerv(GL_MAX_SAMPLES, &n); - gdraw->multisampling = RR_MIN(msaa_samples, n); - } - - opengl_check(); - - return funcs; -} diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_wgl.h b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_wgl.h deleted file mode 100644 index 5669624fc..000000000 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_wgl.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef __RAD_INCLUDE_GDRAW_GL_H__ -#define __RAD_INCLUDE_GDRAW_GL_H__ - -#include "../include/rrCore.h" -#include "../include/gdraw.h" - -RADDEFSTART - -typedef enum gdraw_gl_resourcetype { - GDRAW_GL_RESOURCE_rendertarget, - GDRAW_GL_RESOURCE_texture, - GDRAW_GL_RESOURCE_vertexbuffer, - - GDRAW_GL_RESOURCE__count, -} gdraw_gl_resourcetype; - -struct IggyCustomDrawCallbackRegion; - -extern int gdraw_GL_SetResourceLimits(gdraw_gl_resourcetype type, - S32 num_handles, S32 num_bytes); -extern GDrawFunctions* gdraw_GL_CreateContext(S32 min_w, S32 min_h, - S32 msaa_samples); -extern void gdraw_GL_DestroyContext(void); -extern void gdraw_GL_SetTileOrigin( - S32 vx, S32 vy, - U32 framebuffer); // framebuffer=FBO handle, or 0 for main frame buffer -extern void gdraw_GL_NoMoreGDrawThisFrame(void); - -extern GDrawTexture* gdraw_GL_WrappedTextureCreate(S32 gl_texture_handle, - S32 width, S32 height, - rrbool has_mipmaps); -extern void gdraw_GL_WrappedTextureChange(GDrawTexture* tex, - S32 new_gl_texture_handle, - S32 new_width, S32 new_height, - rrbool new_has_mipmaps); -extern void gdraw_GL_WrappedTextureDestroy(GDrawTexture* tex); - -extern void gdraw_GL_BeginCustomDraw( - struct IggyCustomDrawCallbackRegion* region, F32* matrix); -extern void gdraw_GL_EndCustomDraw(struct IggyCustomDrawCallbackRegion* region); - -extern GDrawTexture* RADLINK gdraw_GL_MakeTextureFromResource( - U8* resource_file, S32 resource_len, IggyFileTextureRaw* texture); -extern void RADLINK gdraw_GL_DestroyTextureFromResource(GDrawTexture* tex); - -RADDEFEND - -#endif diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggy_w32.lib b/Minecraft.Client/Platform/Windows64/Iggy/lib/iggy_w32.lib deleted file mode 100644 index 3c6ad976f..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggy_w32.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggy_w64.lib b/Minecraft.Client/Platform/Windows64/Iggy/lib/iggy_w64.lib deleted file mode 100644 index 64effcbf3..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggy_w64.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyexpruntime_w32.lib b/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyexpruntime_w32.lib deleted file mode 100644 index 06905e7cf..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyexpruntime_w32.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyexpruntime_w64.lib b/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyexpruntime_w64.lib deleted file mode 100644 index 693fa9a25..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyexpruntime_w64.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyperfmon_w32.lib b/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyperfmon_w32.lib deleted file mode 100644 index 25ba046ee..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyperfmon_w32.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyperfmon_w64.lib b/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyperfmon_w64.lib deleted file mode 100644 index e58859299..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/iggyperfmon_w64.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Iggy/lib/redist64/iggy_w64.dll b/Minecraft.Client/Platform/Windows64/Iggy/lib/redist64/iggy_w64.dll deleted file mode 100644 index bd2cbd7e8..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Iggy/lib/redist64/iggy_w64.dll and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/imssapi.h b/Minecraft.Client/Platform/Windows64/Miles/include/imssapi.h deleted file mode 100644 index 1f698f086..000000000 --- a/Minecraft.Client/Platform/Windows64/Miles/include/imssapi.h +++ /dev/null @@ -1,3267 +0,0 @@ -#ifndef IMSSAPI_H -#define IMSSAPI_H - -// Internal API file - -#if defined(IS_PS3) || defined(IS_PSP) -#include -#endif - -#if defined(IS_WII) -#include -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if defined(IS_WIN32API) || defined(IS_WII) - #pragma pack(push, 1) -#endif -#ifdef IS_32 - #if !defined(IS_WIN32API) - #define ASMLINK - #define ASMPARM - #else - #if defined(IS_XENON) - #define ASMLINK __cdecl - #define ASMPARM register - #else - #define ASMLINK __cdecl - #define ASMPARM - #endif - #endif -#else - #define ASMLINK WINAPI - #define ASMPARM -#endif - -#ifndef YES -#define YES 1 -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#define MSSHIWORD(ptr) (((U32)ptr)>>16) -#define MSSLOWORD(ptr) ((U16)((U32)ptr)) - -#ifndef NO -#define NO 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifdef IS_MAC - -#if !defined(max) -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#if !defined(min) -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#endif - -#ifdef IS_WATCOM - -#if !defined(max) // Watcom stdlib.h doesn't define these for C++ -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#if !defined(min) -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#endif - -#ifdef IS_WIN64 - - #define PTRFMT "0x%I64X" - #define SINTFMT "%I64d" - #define HPFMT "%ld" - -#else - - #if defined(IS_PS3) || defined(IS_PSP) || defined(IS_3DS) - - #define PTRFMT "0x%lX" - #define SINTFMT "%d" // (GCC warns when ints printed with %ld) - #define HPFMT "%ld" - - #else - - #define PTRFMT "0x%lX" - #define SINTFMT "%ld" - #define HPFMT "%ld" - - #endif - -#endif - -U32 AILCALL XMI_read_VLN(U8 const* *ptr); -S32 AILCALL XMI_message_size(S32 status); -void const * AILCALL XMI_find_sequence(U8 const *image, S32 sequence); -S32 AIL_process_WAV_image( AILSOUNDINFO const * info, HSAMPLE sample ); - -#ifdef IS_SPU -#define NTELEMETRY -#endif - -#include "tmapi.h" - -#ifdef NTELEMETRY - #define miles_context 0 -#else - extern HTELEMETRY g_Miles_Tm; - extern S32 g_tm_log; - #define miles_context g_Miles_Tm -#endif - -//############################################################################ -//## ## -//## API function prototypes ## -//## ## -//############################################################################ - -#define check_hardware_buffer( S, flags ) -#define hardware_stop( S ) -#define set_hardware_position( S ) -#define hardware_spin_until_stopped( S ) -#define set_hardware_volume( S ) -#define set_master_hardware_volume( dig ) -#define set_hardware_loop_region( S ) -#define set_hardware_low_pass( S ) - -extern void AILCALL InMilesMutex(void); -extern void AILCALL OutMilesMutex(void); - -#ifdef IS_WIN32API - -#ifdef NTAPI -extern HWND AILCALL AIL_API_HWND (void); - -void AILEXPORT API_timer (UINT IDEvent, - UINT uReserved, - DWORD dwUser, - DWORD dwReserved1, - DWORD dwReserved2); - -#endif - -extern S32 MilesCount; -extern U32 lastapitimerms; - - void AILCALL Set_thread_name( U32 thread_id, char const * thread_name ); - -#endif - - -#ifdef IS_MAC - #if defined(__CARBON__) - ProcessSerialNumber AILCALL AIL_API_Process(void); - #endif -#endif - - -#ifdef _DEBUG - -DXDEC void AILEXPORT AIL_debug_printf( char const *fmt, ...); - -#else - -#define AIL_debug_printf(...) - -#endif - -#ifndef MSS_SPU_PROCESS - -// -// Global preference array -// -extern SINTa AIL_preference [N_PREFS]; - -#endif - -extern char AIL_redist_directory[260]; - -extern S32 AILCALL match_suffix(char const* suffix,char const* file_suffix); - -#if !defined(IS_X86) || !defined(IS_MAC) // use mix rib on x86 mac -DXDEC S32 AILCALL MIX_RIB_MAIN( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); -#endif - -// -// High-level support services -// - -extern void AILCALL AIL_API_startup (void); -extern void AILCALL AIL_API_shutdown (void); - -extern SINTa AILCALL AIL_API_set_preference (U32 number, - SINTa value); - -// -// Low-level support services -// - -extern void AILCALL AIL_API_sleep (U32 ms); - -extern S32 AILCALL AIL_API_background (void); - -extern void AILCALL AIL_API_mem_free_lock (void *ptr); - -extern void* AILCALL AIL_API_mem_alloc_lock (UINTa size); - -// -// Process services -// - -extern HTIMER AILCALL AIL_API_register_timer (AILTIMERCB fn); - -extern UINTa AILCALL AIL_API_set_timer_user (HTIMER timer, - UINTa user); - -extern void AILCALL AIL_API_set_timer_period (HTIMER timer, - U32 microseconds); - -extern void AILCALL AIL_API_set_timer_frequency (HTIMER timer, - U32 hertz) ; - -extern void AILCALL AIL_API_set_timer_divisor (HTIMER timer, - U32 PIT_divisor); - -extern void AILCALL AIL_API_start_timer (HTIMER timer) ; -extern void AILCALL AIL_API_start_all_timers (void); - -extern void AILCALL AIL_API_stop_timer (HTIMER timer); -extern void AILCALL AIL_API_stop_all_timers (void); - -extern void AILCALL AIL_API_release_timer_handle(HTIMER timer); -extern void AILCALL AIL_API_release_all_timers (void); - -extern void Container_FreeAll(); -extern void* Container_GetPreset(char const* i_PresetName); -extern void* Container_GetEnvironment(char const* i_EnvironmentName); -extern S32 Container_GetSound(char const* i_SoundName, char* o_SoundFileName, MILESBANKSOUNDINFO* o_SoundInfo); -extern void* Container_GetEvent(char const* i_EventName); -extern void* Container_GetMarkerList(char const* i_SoundName); -extern S32 Container_GetLoadedCount(); -extern S32 Container_GetMemUsage(); -extern char const* Container_GetLoadedName(S32 i_Index); - -extern const U8* AILCALL MilesFindEventInternal(HMSOUNDBANK i_Bank, const char* i_EventName); -extern void AILCALL MilesClearEventQueueInternal(); -extern void AILCALL MilesRegisterRandInternal(MSS_USER_RAND * rand); -extern U64 AILCALL MilesEnqueueEventInternal(const U8* i_Event, void* i_UserBuffer, S32 i_UserBufferLen, S32 i_EnqueueFlags, U64 i_EventFilter); -extern U64 AILCALL MilesEnqueueEventByNameInternal(char const* i_Name); -extern U64 AILCALL MilesEnqueueEventContextInternal(HEVENTSYSTEM i_Context, const U8* i_Event, void* i_UserBuffer, S32 i_UserBufferLen, S32 i_EnqueueFlags, U64 i_EventFilter); - -extern S32 AILCALL MilesBeginEventQueueProcessingInternal(); -extern S32 AILCALL MilesCompleteEventQueueProcessingInternal(); - -extern S32 AILCALL MilesEnumerateSoundInstancesInternal(HEVENTSYSTEM i_System, HMSSENUM* io_Next, S32 i_Status, const char* i_Labels, U64 search_for_ID, MILESEVENTSOUNDINFO* o_Info); -extern S32 AILCALL MilesEnumeratePresetPersistsInternal(HEVENTSYSTEM i_System, HMSSENUM* io_Next, const char** o_Name); -extern HEVENTSYSTEM AILCALL MilesStartupEventSystemInternal(HDIGDRIVER i_Driver, S32 i_CommandBufferSize, char* i_Memory, S32 i_MemoryLen); -extern HEVENTSYSTEM AILCALL MilesAddEventSystemInternal(HDIGDRIVER i_Driver); -extern S32 AILCALL MilesSetSoundLabelLimitsInternal(HEVENTSYSTEM i_System, U64 i_Id, const char* i_SoundLimits, char const* i_Name); - - -extern void AILCALL MilesShutdownEventSystemInternal(); -extern HMSOUNDBANK AILCALL MilesAddSoundBankInternal(const char* i_FileName, char const* i_Name); -extern S32 AILCALL MilesReleaseSoundBankInternal(HMSOUNDBANK i_Bank); -extern char* AILCALL MilesTextDumpEventSystemInternal(); -extern void AILCALL MilesSetEventErrorCallbackInternal(AILEVENTERRORCB i_Callback); - -extern void AILCALL MilesSetVarIInternal(UINTa i_System, char const* i_Name, S32 i_Value); -extern void AILCALL MilesSetVarFInternal(UINTa i_System, char const* i_Name, F32 i_Value); -extern S32 AILCALL MilesGetVarFInternal(UINTa i_Context, char const* i_Name, F32* o_Value); -extern S32 AILCALL MilesGetVarIInternal(UINTa i_Context, char const* i_Name, S32* o_Value); -extern void AILCALL MilesSetSoundStartOffsetInternal(HMSSENUM i_Instance, S32 i_Offset, S32 i_IsMs); -extern void AILCALL MilesRequeueAsyncsInternal(); - -extern AIL_file_open_callback MSS_open; -extern AIL_file_close_callback MSS_close; -extern AIL_file_seek_callback MSS_seek; -extern AIL_file_read_callback MSS_read; - -extern S32 disk_err; -extern char MSS_Directory[260]; - - -extern void stream_background(void); // background service for streaming - -#define call_fetch_CB( ASI,usr,dest,bytes,offset ) ((AILASIFETCHCB)((ASI)->fetch_CB))(usr,dest,bytes,offset) - -extern HPROVIDER find_ASI_provider(const C8 *attrib, const C8 *filename); - - -// -// M3D services -// - -extern HDIGDRIVER AILCALL AIL_API_primary_digital_driver (HDIGDRIVER new_primary); - -extern void AILCALL AIL_API_set_sample_3D_distances (HSAMPLE samp, - F32 max_dist, - F32 min_dist, - S32 auto_3D_wet_atten); - -extern void AILCALL AIL_API_sample_3D_distances (HSAMPLE samp, - F32 * max_dist, - F32 * min_dist, - S32 * auto_3D_wet_atten); - -extern void AILCALL AIL_API_set_sample_obstruction (HSAMPLE S, - F32 obstruction); - -extern void AILCALL AIL_API_set_sample_exclusion (HSAMPLE S, - F32 exclusion); - -extern void AILCALL AIL_API_set_sample_occlusion (HSAMPLE S, - F32 occlusion); - -extern void AILCALL AIL_API_set_sample_3D_cone (HSAMPLE S, - F32 inner_angle, - F32 outer_angle, - F32 outer_volume); - -extern F32 AILCALL AIL_API_sample_obstruction (HSAMPLE S); - -extern F32 AILCALL AIL_API_sample_occlusion (HSAMPLE S); - -extern F32 AILCALL AIL_API_sample_exclusion (HSAMPLE S); - -extern void AILCALL AIL_API_sample_3D_cone (HSAMPLE S, - F32 *inner_angle, - F32 *outer_angle, - F32 *outer_volume); - -extern S32 AILCALL AIL_API_room_type (HDIGDRIVER dig, - S32 bus_index); - -extern void AILCALL AIL_API_set_room_type (HDIGDRIVER dig, - S32 bus_index, - S32 EAX_room_type); - -extern F32 AILCALL AIL_API_3D_rolloff_factor (HDIGDRIVER dig); - -extern void AILCALL AIL_API_set_3D_rolloff_factor (HDIGDRIVER dig, - F32 factor ); - -extern F32 AILCALL AIL_API_3D_doppler_factor (HDIGDRIVER dig); - -extern void AILCALL AIL_API_set_3D_doppler_factor (HDIGDRIVER dig, - F32 factor ); - -extern F32 AILCALL AIL_API_3D_distance_factor (HDIGDRIVER dig); - -extern void AILCALL AIL_API_set_3D_distance_factor (HDIGDRIVER dig, - F32 factor ); - -extern void AILCALL AIL_API_set_sample_3D_position (HSAMPLE S, - F32 X, - F32 Y, - F32 Z); - -extern void AILCALL AIL_API_set_sample_3D_velocity (HSAMPLE S, - F32 dX_per_ms, - F32 dY_per_ms, - F32 dZ_per_ms, - F32 magnitude); - -extern void AILCALL AIL_API_set_sample_3D_velocity_vector (HSAMPLE S, - F32 dX_per_ms, - F32 dY_per_ms, - F32 dZ_per_ms); - -extern void AILCALL AIL_API_set_sample_3D_orientation (HSAMPLE S, - F32 X_face, - F32 Y_face, - F32 Z_face, - F32 X_up, - F32 Y_up, - F32 Z_up); - -extern S32 AILCALL AIL_API_sample_3D_position (HSAMPLE S, - F32 *X, - F32 *Y, - F32 *Z); - -extern void AILCALL AIL_API_sample_3D_velocity (HSAMPLE S, - F32 *dX_per_ms, - F32 *dY_per_ms, - F32 *dZ_per_ms); - -extern void AILCALL AIL_API_sample_3D_orientation (HSAMPLE S, - F32 *X_face, - F32 *Y_face, - F32 *Z_face, - F32 *X_up, - F32 *Y_up, - F32 *Z_up); - -extern void AILCALL AIL_API_update_sample_3D_position (HSAMPLE S, - F32 dt_milliseconds); - -extern void AILCALL AIL_API_set_listener_3D_position(HDIGDRIVER dig, - F32 X, - F32 Y, - F32 Z); - -extern void AILCALL AIL_API_set_listener_3D_velocity(HDIGDRIVER dig, - F32 dX_per_ms, - F32 dY_per_ms, - F32 dZ_per_ms, - F32 magnitude); - -extern void AILCALL AIL_API_set_listener_3D_velocity_vector (HDIGDRIVER dig, - F32 dX_per_ms, - F32 dY_per_ms, - F32 dZ_per_ms); - -extern void AILCALL AIL_API_set_listener_3D_orientation (HDIGDRIVER dig, - F32 X_face, - F32 Y_face, - F32 Z_face, - F32 X_up, - F32 Y_up, - F32 Z_up); - -extern void AILCALL AIL_API_set_sample_3D_volume_falloff (HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); -extern void AILCALL AIL_API_set_sample_3D_lowpass_falloff (HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); -extern void AILCALL AIL_API_set_sample_3D_exclusion_falloff (HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); -extern void AILCALL AIL_API_set_sample_3D_spread_falloff (HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); -extern void AILCALL AIL_API_set_sample_3D_position_segments (HSAMPLE S, MSSVECTOR3D* points, S32 pointcount); -extern void AILCALL AIL_API_set_sample_3D_spread (HSAMPLE S, F32 spread); - -extern void AILCALL AIL_API_listener_3D_position (HDIGDRIVER dig, - F32 *X, - F32 *Y, - F32 *Z); - -extern void AILCALL AIL_API_listener_3D_velocity (HDIGDRIVER dig, - F32 *dX_per_ms, - F32 *dY_per_ms, - F32 *dZ_per_ms); - -extern void AILCALL AIL_API_listener_3D_orientation (HDIGDRIVER dig, - F32 *X_face, - F32 *Y_face, - F32 *Z_face, - F32 *X_up, - F32 *Y_up, - F32 *Z_up); - -extern void AILCALL AIL_API_update_listener_3D_position (HDIGDRIVER dig, - F32 dt_milliseconds); - -extern S32 AILCALL AIL_API_calculate_3D_channel_levels (HDIGDRIVER driver, //) - F32 *channel_levels, - MSS_SPEAKER const * *speaker_array, - MSSVECTOR3D *src_pos, - MSSVECTOR3D *src_face, - MSSVECTOR3D *src_up, - F32 src_inner_angle, - F32 src_outer_angle, - F32 src_outer_volume, - F32 src_max_dist, - F32 src_min_dist, - MSSVECTOR3D *listen_pos, - MSSVECTOR3D *listen_face, - MSSVECTOR3D *listen_up, - F32 rolloff_factor, - MSSVECTOR3D *doppler_velocity, - F32 *doppler_shift); - - -#ifdef IS_GENERICDIG -extern HDIGDRIVER AILCALL AIL_API_open_generic_digital_driver( U32 frequency, - S32 bits, - S32 channel, - U32 flags, - RADSS_OPEN_FUNC dig_open); -#else -extern HDIGDRIVER AILCALL AIL_API_open_digital_driver( U32 frequency, - S32 bits, - S32 channel, - U32 flags ); -#endif - -extern void AILCALL AIL_API_close_digital_driver( HDIGDRIVER dig ); - -#if defined(IS_WINDOWS) - -extern S32 AILCALL AIL_API_digital_handle_release(HDIGDRIVER drvr); - -extern S32 AILCALL AIL_API_digital_handle_reacquire - (HDIGDRIVER drvr); -#endif - -#if defined(IS_WINDOWS) || (defined(IS_MAC) && !defined(IS_IPHONE)) - - -extern HDIGINPUT AILCALL AIL_API_open_input (AIL_INPUT_INFO *info); - -extern void AILCALL AIL_API_close_input (HDIGINPUT dig); - -extern AIL_INPUT_INFO * - AILCALL AIL_API_get_input_info (HDIGINPUT dig); - -extern S32 AILCALL AIL_API_set_input_state (HDIGINPUT dig, - S32 enable); - -#endif - -#ifdef MSS_FLT_SUPPORTED - -void * SS_execute_filter_chain(HSAMPLE S, //) - void * src, - void * temp_dest, - S32 src_bytes, - S32 is_stereo, - S16 *dest_mono_sample_buffer); - -// -// Internal FLT services -// - -void FLT_init_list(void); - -FLTPROVIDER *FLT_find_provider_instance(HPROVIDER provider, - HDIGDRIVER dig); - -void FLT_disconnect_driver(HDIGDRIVER dig); - -void FLT_call_premix_processors(HDIGDRIVER dig); - -S32 FLT_call_postmix_processors(HDIGDRIVER dig, void *output_buffer); - -// -// FLT services -// - -extern S32 AILCALL AIL_API_enumerate_filters (HMSSENUM *next, - HPROVIDER *dest, - C8 * *name); - -extern HDRIVERSTATE - AILCALL AIL_API_open_filter (HPROVIDER lib, - HDIGDRIVER dig); - -extern void AILCALL AIL_API_close_filter (HDRIVERSTATE filter); - - - - - - -extern S32 AILCALL AIL_API_enumerate_filter_attributes - (HPROVIDER lib, - HMSSENUM * next, - RIB_INTERFACE_ENTRY * dest); - -extern void AILCALL AIL_API_filter_attribute (HPROVIDER lib, - C8 const * name, - void * val); - -extern void AILCALL AIL_API_set_filter_preference - (HPROVIDER lib, - C8 const * name, - void const * val); - - - - - -extern S32 AILCALL AIL_API_enumerate_filter_sample_attributes - (HPROVIDER lib, - HMSSENUM * next, - RIB_INTERFACE_ENTRY * dest); - -extern void AILCALL AIL_API_filter_sample_attribute - (HSAMPLE S, - C8 const * name, - void * val); - -extern void AILCALL AIL_API_set_filter_sample_preference - (HSAMPLE S, - C8 const * name, - void const * val); -#endif - -extern S32 AILCALL AIL_API_enumerate_digital_driver_attributes - (HDIGDRIVER dig, - HMSSENUM * next, - RIB_INTERFACE_ENTRY * dest); - -extern void AILCALL AIL_API_digital_driver_attribute (HDIGDRIVER dig, - C8 const * name, - void * val); - -extern S32 AILCALL AIL_API_enumerate_digital_driver_preferences - (HDIGDRIVER dig, - HMSSENUM * next, - RIB_INTERFACE_ENTRY * dest); - -extern void AILCALL AIL_API_set_digital_driver_preference(HDIGDRIVER dig, - C8 const * name, - void const * val); - -extern S32 AILCALL AIL_API_enumerate_sample_attributes - (HSAMPLE S, - HMSSENUM * next, - RIB_INTERFACE_ENTRY * dest); - -extern void AILCALL AIL_API_sample_attribute (HSAMPLE S, - C8 const * name, - void * val); - -extern S32 AILCALL AIL_API_enumerate_sample_preferences - (HSAMPLE S, - HMSSENUM * next, - RIB_INTERFACE_ENTRY * dest); - -extern void AILCALL AIL_API_set_sample_preference (HSAMPLE S, - C8 const * name, - void const * val); - -extern S32 AILCALL AIL_API_digital_CPU_percent(HDIGDRIVER dig); - -extern S32 AILCALL AIL_API_digital_SPU_percent(HDIGDRIVER dig); - -extern S32 AILCALL AIL_API_background_CPU_percent(void); - -extern S32 AILCALL AIL_API_digital_latency(HDIGDRIVER dig); - -extern HSAMPLE AILCALL AIL_API_allocate_sample_handle - (HDIGDRIVER dig); - -extern HSAMPLE AILCALL AIL_API_allocate_bus(HDIGDRIVER dig); -extern HSAMPLE AILCALL AIL_API_bus_sample_handle(HDIGDRIVER dig, S32 bus_index); -extern S32 AILCALL AIL_API_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); -DXDEC void AILCALL AIL_free_all_busses(HDIGDRIVER dig); // For miles studio. - -extern HSAMPLE AILCALL AIL_API_allocate_file_sample - (HDIGDRIVER dig, - void const *file_image, - S32 block); - -extern void AILCALL AIL_API_set_speaker_configuration - (HDIGDRIVER dig, - MSSVECTOR3D *array, - S32 n_channels, - F32 falloff_power); - -extern MSSVECTOR3D * - AILCALL AIL_API_speaker_configuration - (HDIGDRIVER dig, - S32 *n_physical_channels, - S32 *n_logical_channels, - F32 *falloff_power, - MSS_MC_SPEC *channel_spec); - -extern void AILCALL AIL_API_set_listener_relative_receiver_array - (HDIGDRIVER dig, - MSS_RECEIVER_LIST *array, - S32 n_receivers); - -extern MSS_RECEIVER_LIST * - AILCALL AIL_API_listener_relative_receiver_array - (HDIGDRIVER dig, - S32 *n_receivers); - -extern void AILCALL AIL_API_set_speaker_reverb_levels - (HDIGDRIVER dig, - F32 *wet_array, - F32 *dry_array, - MSS_SPEAKER const *speaker_index_array, - S32 n_levels); - -extern S32 AILCALL AIL_API_speaker_reverb_levels (HDIGDRIVER dig, - F32 * *wet_array, - F32 * *dry_array, - MSS_SPEAKER const * *speaker_index_array); - -extern void AILCALL AIL_API_release_sample_handle (HSAMPLE S); - -extern S32 AILCALL AIL_API_set_sample_file (HSAMPLE S, - void const *file_image, - S32 block); - -extern S32 AILCALL AIL_API_set_sample_info (HSAMPLE S, - AILSOUNDINFO const * info); - -extern S32 AILCALL AIL_API_set_named_sample_file (HSAMPLE S, - C8 const *file_type_suffix, - void const *file_image, - U32 file_size, - S32 block); - -extern HPROVIDER AILCALL AIL_API_set_sample_processor (HSAMPLE S, - SAMPLESTAGE pipeline_stage, - HPROVIDER provider); - -extern HPROVIDER AILCALL AIL_API_set_digital_driver_processor - (HDIGDRIVER dig, - DIGDRVSTAGE pipeline_stage, - HPROVIDER provider); - -extern HPROVIDER AILCALL AIL_API_sample_processor (HSAMPLE S, - SAMPLESTAGE pipeline_stage); - -extern HPROVIDER AILCALL AIL_API_digital_driver_processor - (HDIGDRIVER dig, - DIGDRVSTAGE pipeline_stage); - -extern void AILCALL AIL_API_set_sample_address (HSAMPLE S, - void const *start, - U32 len); - -extern S32 AILCALL AIL_API_init_sample (HSAMPLE S, - S32 format); - -extern void AILCALL AIL_API_set_sample_adpcm_block_size - (HSAMPLE S, - U32 blocksize); - -extern void AILCALL AIL_API_start_sample (HSAMPLE S); -extern void AILCALL AIL_API_stop_sample (HSAMPLE S); -extern void AILCALL AIL_API_end_fade_sample (HSAMPLE S); -extern void AILCALL AIL_API_resume_sample (HSAMPLE S); -extern void AILCALL AIL_API_end_sample (HSAMPLE S); - -extern void AILCALL AIL_API_sample_group_operation (HDIGDRIVER dig, S32 op, S32 start_id, S32 set_to_id); -extern void AILCALL AIL_API_schedule_start_sample (HSAMPLE S, U64 mix_time_to_start); - -extern void AILCALL AIL_API_push_system_state (HDIGDRIVER dig, U32 flags, S16 crossfade_ms); -extern void AILCALL AIL_API_pop_system_state (HDIGDRIVER dig, S16 crossfade_ms); - -extern void AILCALL AIL_API_set_sample_playback_rate - (HSAMPLE S, - S32 playback_rate); - -extern void AILCALL AIL_API_set_sample_playback_rate_factor - (HSAMPLE S, - F32 playback_rate_factor); - -extern void AILCALL AIL_API_set_sample_playback_delay - (HSAMPLE S, - S32 playback_delay); - -extern void AILCALL AIL_API_set_sample_volume_pan (HSAMPLE S, - F32 volume, - F32 pan); - -extern S32 AILCALL AIL_API_sample_channel_count (HSAMPLE S, U32 *mask); - -extern S32 AILCALL AIL_API_set_sample_is_3D (HSAMPLE S, //) - S32 onoff); - -extern void AILCALL AIL_API_set_sample_speaker_scale_factors (HSAMPLE S, //) - MSS_SPEAKER const * dest_speaker_indexes, - F32 const * levels, - S32 n_levels ); - -extern void AILCALL AIL_API_sample_speaker_scale_factors (HSAMPLE S, //) - MSS_SPEAKER const * dest_speaker_indexes, - F32 * levels, - S32 n_levels ); - -extern void AILCALL AIL_API_set_sample_channel_levels (HSAMPLE S, - MSS_SPEAKER const *source_speaker_indexes, - MSS_SPEAKER const *dest_speaker_indexes, - F32 const *levels, - S32 n_levels); - -extern void AILCALL AIL_API_sample_channel_levels (HSAMPLE S, - MSS_SPEAKER const *source_speaker_indexes, - MSS_SPEAKER const *dest_speaker_indexes, - F32 *levels, - S32 n_levels); - -extern F32 AILCALL AIL_API_sample_output_levels (HSAMPLE S, - MSS_SPEAKER const *source_speaker_indexes, - MSS_SPEAKER const *dest_speaker_indexes, - F32 *levels, - S32 n_levels); - -extern void AILCALL AIL_API_set_sample_51_volume_pan( HSAMPLE S, - F32 volume, - F32 pan, - F32 fb_pan, - F32 center_level, - F32 sub_level ); - -extern void AILCALL AIL_API_sample_51_volume_pan ( HSAMPLE S, - F32* volume, - F32* pan, - F32* fb_pan, - F32* center_level, - F32* sub_level ); - -extern void AILCALL AIL_API_set_sample_51_volume_levels( HSAMPLE S, - F32 f_left_level, - F32 f_right_level, - F32 b_left_level, - F32 b_right_level, - F32 center_level, - F32 sub_level ); - -extern void AILCALL AIL_API_sample_51_volume_levels ( HSAMPLE S, - F32* f_left_level, - F32* f_right_level, - F32* b_left_level, - F32* b_right_level, - F32* center_level, - F32* sub_level ); -extern void AILCALL AIL_API_set_sample_volume_levels(HSAMPLE S, - F32 left_level, - F32 right_level); - -extern void AILCALL AIL_API_set_sample_reverb_levels(HSAMPLE S, - F32 dry_level, - F32 wet_level); - -extern void AILCALL AIL_API_set_sample_low_pass_cut_off( HSAMPLE S, - S32 /*-1 or MSS_SPEAKER*/ input_channel, - F32 cutoff ); - -extern void AILCALL AIL_API_set_sample_loop_count (HSAMPLE S, - S32 loop_count); - -extern void AILCALL AIL_API_set_sample_loop_block (HSAMPLE S, - S32 loop_start_offset, - S32 loop_end_offset); - -extern S32 AILCALL AIL_API_sample_loop_block (HSAMPLE S, - S32 *loop_start_offset, - S32 *loop_end_offset); - -extern U32 AILCALL AIL_API_sample_status (HSAMPLE S); - -extern S32 AILCALL AIL_API_sample_playback_rate (HSAMPLE S); - -extern F32 AILCALL AIL_API_sample_playback_rate_factor (HSAMPLE S); - -extern S32 AILCALL AIL_API_sample_playback_delay (HSAMPLE S); - -extern void AILCALL AIL_API_sample_volume_pan (HSAMPLE S, - F32* volume, - F32* pan); - -extern void AILCALL AIL_API_sample_volume_levels(HSAMPLE S, - F32 * left_level, - F32 * right_level); - -extern void AILCALL AIL_API_sample_reverb_levels(HSAMPLE S, - F32 * dry_level, - F32 * wet_level); - -extern F32 AILCALL AIL_API_sample_low_pass_cut_off(HSAMPLE S, S32 /*-1 or MSS_SPEAKER*/ channel); - -extern S32 AILCALL AIL_API_sample_loop_count (HSAMPLE S); - -extern void AILCALL AIL_API_set_digital_master_volume_level - (HDIGDRIVER dig, - F32 master_volume); - -extern F32 AILCALL AIL_API_digital_master_volume_level (HDIGDRIVER dig); - -extern void AILCALL AIL_API_set_digital_master_volume_levels(HDIGDRIVER dig, - F32 left_level, - F32 right_level); - -extern void AILCALL AIL_API_set_digital_master_reverb_levels(HDIGDRIVER dig, - S32 bus_index, - F32 dry_level, - F32 wet_level); - -extern void AILCALL AIL_API_set_digital_master_room_type(HDIGDRIVER dig, - S32 bus_index, - S32 room_type); - -extern void AILCALL AIL_API_digital_master_reverb_levels(HDIGDRIVER dig, - S32 bus_index, - F32 * dry_level, - F32 * wet_level); - -extern void AILCALL AIL_API_set_digital_master_reverb(HDIGDRIVER dig, - S32 bus_index, - F32 reverb_time, - F32 reverb_predelay, - F32 reverb_damping); - -extern void AILCALL AIL_API_digital_master_reverb(HDIGDRIVER dig, - S32 bus_index, - F32 * reverb_time, - F32 * reverb_predelay, - F32 * reverb_damping); - -extern S32 AILCALL AIL_API_minimum_sample_buffer_size - (HDIGDRIVER dig, - S32 playback_rate, - S32 format); - -extern S32 AILCALL AIL_API_set_sample_buffer_count - (HSAMPLE S, - S32 n_buffers); - -extern S32 AILCALL AIL_API_sample_buffer_count (HSAMPLE S); - -extern S32 AILCALL AIL_API_sample_buffer_available (HSAMPLE S); - -extern S32 AILCALL AIL_API_sample_loaded_len( HSAMPLE S ); - -extern S32 AILCALL AIL_API_load_sample_buffer (HSAMPLE S, - S32 buff_num, - void const *buffer, - U32 len); - -extern S32 AILCALL AIL_API_sample_buffer_info (HSAMPLE S, - S32 buff_num, - U32 *pos, - U32 *len, - S32 *head, - S32 *tail); - -extern U32 AILCALL AIL_API_sample_granularity (HSAMPLE S); - -extern void AILCALL AIL_API_set_sample_position (HSAMPLE S, - U32 pos); - -extern U32 AILCALL AIL_API_sample_position (HSAMPLE S); - -extern AILSAMPLECB AILCALL AIL_API_register_SOB_callback - (HSAMPLE S, - AILSAMPLECB SOB); - -extern AILSAMPLECB AILCALL AIL_API_register_EOB_callback - (HSAMPLE S, - AILSAMPLECB EOB); - -extern AILSAMPLECB AILCALL AIL_API_register_EOS_callback - (HSAMPLE S, - AILSAMPLECB EOS); - -extern AILFALLOFFCB AILCALL AIL_API_register_falloff_function_callback - (HSAMPLE S, - AILFALLOFFCB falloff_cb); - -extern void AILCALL AIL_API_set_sample_user_data (HSAMPLE S, - U32 index, - SINTa value); - -extern SINTa AILCALL AIL_API_sample_user_data (HSAMPLE S, - U32 index); - -extern S32 AILCALL AIL_API_active_sample_count (HDIGDRIVER dig); - -extern void AILCALL AIL_API_digital_configuration (HDIGDRIVER dig, - S32 *rate, - S32 *format, - char *config); - -// -// High-level XMIDI services -// - -#if defined(IS_WINDOWS) - -extern S32 AILCALL AIL_API_midiOutOpen (HMDIDRIVER *drvr, - LPHMIDIOUT *lphMidiOut, - U32 dwDeviceID); - -extern void AILCALL AIL_API_midiOutClose (HMDIDRIVER mdi); - - -extern S32 AILCALL AIL_API_MIDI_handle_release (HMDIDRIVER mdi); - -extern S32 AILCALL AIL_API_MIDI_handle_reacquire (HMDIDRIVER mdi); - -#else - -extern HMDIDRIVER AILCALL AIL_API_open_XMIDI_driver( U32 flags ); - -extern void AILCALL AIL_API_close_XMIDI_driver( HMDIDRIVER mdi ); - -#endif - -extern HSEQUENCE AILCALL AIL_API_allocate_sequence_handle - (HMDIDRIVER mdi); - -extern void AILCALL AIL_API_release_sequence_handle - (HSEQUENCE S); - -extern S32 AILCALL AIL_API_init_sequence (HSEQUENCE S, - void const *start, - S32 sequence_num); - -extern void AILCALL AIL_API_start_sequence (HSEQUENCE S); -extern void AILCALL AIL_API_stop_sequence (HSEQUENCE S); -extern void AILCALL AIL_API_resume_sequence (HSEQUENCE S); -extern void AILCALL AIL_API_end_sequence (HSEQUENCE S); - -extern void AILCALL AIL_API_set_sequence_tempo (HSEQUENCE S, - S32 tempo, - S32 milliseconds); - -extern void AILCALL AIL_API_set_sequence_volume (HSEQUENCE S, - S32 volume, - S32 milliseconds); - -extern void AILCALL AIL_API_set_sequence_loop_count - (HSEQUENCE S, - S32 loop_count); - -extern U32 AILCALL AIL_API_sequence_status (HSEQUENCE S); - -extern S32 AILCALL AIL_API_sequence_tempo (HSEQUENCE S); -extern S32 AILCALL AIL_API_sequence_volume (HSEQUENCE S); -extern S32 AILCALL AIL_API_sequence_loop_count (HSEQUENCE S); - -extern void AILCALL AIL_API_set_XMIDI_master_volume - (HMDIDRIVER mdi, - S32 master_volume); - -extern S32 AILCALL AIL_API_XMIDI_master_volume (HMDIDRIVER mdi); - -// -// Low-level XMIDI services -// - -extern S32 AILCALL AIL_API_active_sequence_count (HMDIDRIVER mdi); - -extern S32 AILCALL AIL_API_controller_value (HSEQUENCE S, - S32 channel, - S32 controller_num); - -extern S32 AILCALL AIL_API_channel_notes (HSEQUENCE S, - S32 channel); - -extern void AILCALL AIL_API_sequence_position (HSEQUENCE S, - S32 *beat, - S32 *measure); - -extern void AILCALL AIL_API_branch_index (HSEQUENCE S, - U32 marker); - -extern AILPREFIXCB AILCALL AIL_API_register_prefix_callback - (HSEQUENCE S, - AILPREFIXCB callback); - -extern AILTRIGGERCB AILCALL AIL_API_register_trigger_callback - (HSEQUENCE S, - AILTRIGGERCB callback); - -extern AILSEQUENCECB AILCALL AIL_API_register_sequence_callback - (HSEQUENCE S, - AILSEQUENCECB callback); - -extern AILEVENTCB AILCALL AIL_API_register_event_callback - (HMDIDRIVER mdi, - AILEVENTCB callback); - -extern AILBEATCB AILCALL AIL_API_register_beat_callback - (HSEQUENCE S, - AILBEATCB callback); - -extern AILTIMBRECB AILCALL AIL_API_register_timbre_callback - (HMDIDRIVER mdi, - AILTIMBRECB callback); - -extern void AILCALL AIL_API_set_sequence_user_data(HSEQUENCE S, - U32 index, - SINTa value); - -extern SINTa AILCALL AIL_API_sequence_user_data (HSEQUENCE S, - U32 index); - -extern void AILCALL AIL_API_register_ICA_array (HSEQUENCE S, - U8 *array); - -extern S32 AILCALL AIL_API_lock_channel (HMDIDRIVER mdi); - -extern void AILCALL AIL_API_release_channel (HMDIDRIVER mdi, - S32 channel); - -extern void AILCALL AIL_API_map_sequence_channel (HSEQUENCE S, - S32 seq_channel, - S32 new_channel); - -extern S32 AILCALL AIL_API_true_sequence_channel (HSEQUENCE S, - S32 seq_channel); - -extern void AILCALL AIL_API_send_channel_voice_message - (HMDIDRIVER mdi, - HSEQUENCE S, - S32 status, - S32 data_1, - S32 data_2); - -extern void AILCALL AIL_API_send_sysex_message (HMDIDRIVER mdi, - void const *buffer); - -extern HWAVESYNTH - AILCALL AIL_API_create_wave_synthesizer (HDIGDRIVER dig, - HMDIDRIVER mdi, - void const *wave_lib, - S32 polyphony); - -extern void AILCALL AIL_API_destroy_wave_synthesizer(HWAVESYNTH W); - -extern S32 AILCALL AIL_API_MIDI_to_XMI (void const* MIDI, - U32 MIDI_size, - void**XMIDI, - U32 * XMIDI_size, - S32 flags); - -#if defined(IS_WIN32) - -extern S32 AILCALL AIL_API_list_MIDI (void const* MIDI, - U32 MIDI_size, - char* *list, - U32 * list_size, - S32 flags); - -extern S32 AILCALL AIL_API_list_DLS (void const* DLS, - char**list, - U32 * list_size, - S32 flags, - C8 * title); - -#endif - -extern char* AILCALL AIL_API_last_error ( void ); - -extern void AILCALL AIL_API_set_error ( char const* error_msg ); - -extern S32 AILCALL AIL_API_file_error (void); - -extern S32 AILCALL AIL_API_file_size (char const *filename, - char const * caller, - U32 caller_line); - -extern void * AILCALL AIL_API_file_read (char const *filename, - void *dest, - char const * caller, - U32 caller_line); - -extern S32 AILCALL AIL_API_file_write (char const *filename, - void const *buf, - U32 len); - -extern S32 AILCALL AIL_API_WAV_file_write (char const *filename, - void const *buf, - U32 len, - S32 rate, - S32 format); - -extern void AILCALL AIL_API_serve (void); - - -#ifdef IS_WINDOWS - -extern HREDBOOK AILCALL AIL_API_redbook_open (U32 which); - -extern HREDBOOK AILCALL AIL_API_redbook_open_drive(S32 drive); - -extern void AILCALL AIL_API_redbook_close (HREDBOOK hand); - -extern void AILCALL AIL_API_redbook_eject (HREDBOOK hand); - -extern void AILCALL AIL_API_redbook_retract (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_status (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_tracks (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_track (HREDBOOK hand); - -extern void AILCALL AIL_API_redbook_track_info (HREDBOOK hand, - U32 tracknum, - U32* startmsec, - U32* endmsec); - -extern U32 AILCALL AIL_API_redbook_id (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_position (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_play (HREDBOOK hand, - U32 startmsec, - U32 endmsec); - -extern U32 AILCALL AIL_API_redbook_stop (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_pause (HREDBOOK hand); - -extern U32 AILCALL AIL_API_redbook_resume (HREDBOOK hand); - -extern F32 AILCALL AIL_API_redbook_volume_level (HREDBOOK hand); - -extern F32 AILCALL AIL_API_redbook_set_volume_level(HREDBOOK hand, - F32 volume); - -#endif - -extern S32 AILCALL AIL_API_quick_startup (S32 use_digital, - S32 use_MIDI, - U32 output_rate, - S32 output_bits, - S32 output_channels); - -extern void AILCALL AIL_API_quick_shutdown (void); - -extern void AILCALL AIL_API_quick_handles (HDIGDRIVER* pdig, - HMDIDRIVER* pmdi, - HDLSDEVICE* pdls); - -extern HAUDIO AILCALL AIL_API_quick_load (char const *filename); - -extern HAUDIO AILCALL AIL_API_quick_load_mem (void const *mem, - U32 size); - -extern HAUDIO AILCALL AIL_API_quick_load_named_mem(void const *mem, - char const *filename, - U32 size); - -extern void AILCALL AIL_API_quick_unload (HAUDIO audio); - -extern S32 AILCALL AIL_API_quick_play (HAUDIO audio, - U32 loop_count); - -extern void AILCALL AIL_API_quick_halt (HAUDIO audio); - -extern S32 AILCALL AIL_API_quick_status (HAUDIO audio); - -extern HAUDIO AILCALL AIL_API_quick_load_and_play (char const *filename, - U32 loop_count, - S32 wait_request); - -extern void AILCALL AIL_API_quick_set_speed (HAUDIO audio, - S32 speed); - -extern void AILCALL AIL_API_quick_set_volume (HAUDIO audio, - F32 volume, - F32 extravol); - -extern void AILCALL AIL_API_quick_set_reverb_levels(HAUDIO audio, - F32 dry_level, - F32 wet_level); - -extern void AILCALL AIL_API_quick_set_low_pass_cut_off(HAUDIO audio, - S32 channel, - F32 cut_off); - -extern HAUDIO AILCALL AIL_API_quick_copy (HAUDIO hand); - -extern void AILCALL AIL_API_quick_set_ms_position (HAUDIO audio, - S32 milliseconds); - -extern S32 AILCALL AIL_API_quick_ms_position (HAUDIO audio); - -extern S32 AILCALL AIL_API_quick_ms_length (HAUDIO audio); - -extern S32 AILCALL AIL_API_quick_type (HAUDIO audio); - -// -// High-level streaming services -// - -void AILSTRM_shutdown(HDIGDRIVER driver); - -extern HSTREAM AILCALL AIL_API_open_stream (HDIGDRIVER dig, - char const* filename, - S32 stream_mem); - -extern void AILCALL AIL_API_close_stream (HSTREAM stream); - -extern S32 AILCALL AIL_API_service_stream (HSTREAM stream, - S32 fillup); - -extern void AILCALL AIL_API_start_stream (HSTREAM stream); - -extern void AILCALL AIL_API_pause_stream (HSTREAM stream, - S32 onoff); - -extern void AILCALL AIL_API_set_stream_loop_block (HSTREAM S, - S32 loop_start_offset, - S32 loop_end_offset); - -extern S32 AILCALL AIL_API_stream_loop_count (HSTREAM stream); - -extern void AILCALL AIL_API_set_stream_loop_count (HSTREAM stream, - S32 count); - -extern S32 AILCALL AIL_API_stream_status (HSTREAM stream); - -extern F32 AILCALL AIL_API_stream_filled_percent (HSTREAM stream); - -extern void AILCALL AIL_API_set_stream_position (HSTREAM stream, - S32 offset); - -extern S32 AILCALL AIL_API_stream_position (HSTREAM stream); - -extern void AILCALL AIL_API_stream_info (HSTREAM stream, - S32* datarate, - S32* sndtype, - S32* length, - S32* memory); - -extern void AILCALL AIL_API_auto_service_stream (HSTREAM stream, - S32 onoff); - -extern AILSTREAMCB AILCALL AIL_API_register_stream_callback - (HSTREAM stream, - AILSTREAMCB callback); - -extern void AILCALL AIL_API_set_stream_user_data (HSTREAM S, - U32 index, - SINTa value); - -extern SINTa AILCALL AIL_API_stream_user_data (HSTREAM S, - U32 index); - -extern S32 AILCALL AIL_API_size_processed_digital_audio( - U32 dest_rate, - U32 dest_format, - S32 num_srcs, - AILMIXINFO const* src); - -extern S32 AILCALL AIL_API_process_digital_audio( - void *dest_buffer, - S32 dest_buffer_size, - U32 dest_rate, - U32 dest_format, - S32 num_srcs, - AILMIXINFO* src); - -extern HDLSDEVICE AILCALL AIL_API_DLS_open (HMDIDRIVER mdi, - HDIGDRIVER dig, -#ifdef IS_STATIC - AILSTATICDLS const* dls, -#else - char const* libname, -#endif - U32 flags, - U32 rate, - S32 bits, - S32 channels); - - -extern void AILCALL AIL_API_DLS_close (HDLSDEVICE dls, - U32 flags); - -extern HDLSFILEID AILCALL AIL_API_DLS_load_file (HDLSDEVICE dls, - char const* filename, - U32 flags); - -extern HDLSFILEID AILCALL AIL_API_DLS_load_memory (HDLSDEVICE dls, - void const* memfile, - U32 flags); - -extern void AILCALL AIL_API_DLS_unload (HDLSDEVICE dls, - HDLSFILEID dlsid); - -extern void AILCALL AIL_API_DLS_compact (HDLSDEVICE dls); - -extern void AILEXPORT AIL_API_DLS_set_reverb_levels(HDLSDEVICE dls, - F32 dry_level, - F32 wet_level); - -extern void AILEXPORT AIL_API_DLS_get_reverb_levels(HDLSDEVICE dls, - F32* dry_level, - F32* wet_level); - -extern void AILCALL AIL_API_DLS_get_info (HDLSDEVICE dls, - AILDLSINFO* info, - S32* PercentCPU); - -extern S32 AILCALL AIL_API_extract_DLS (void const*source_image, //) - U32 source_size, - void * *XMI_output_data, - U32 *XMI_output_size, - void * *DLS_output_data, - U32 *DLS_output_size, - AILLENGTHYCB callback); - -extern void AILCALL AIL_API_set_sequence_ms_position - (HSEQUENCE S, //) - S32 milliseconds); - -extern void AILCALL AIL_API_sequence_ms_position (HSEQUENCE S, //) - S32 *total_milliseconds, - S32 *current_milliseconds); - -extern void AILCALL AIL_API_set_sample_ms_position(HSAMPLE S, //) - S32 milliseconds); - -extern void AILCALL AIL_API_sample_ms_position (HSAMPLE S, //) - S32 *total_milliseconds, - S32 *current_milliseconds); - -extern U32 AILCALL AIL_API_sample_ms_lookup (HSAMPLE S, //) - S32 milliseconds, - S32* actualms); - -extern void AILCALL AIL_API_set_stream_ms_position(HSTREAM S, //) - S32 milliseconds); - -extern void AILCALL AIL_API_stream_ms_position (HSTREAM S, //) - S32 *total_milliseconds, - S32 *current_milliseconds); - -extern S32 AILCALL AIL_API_WAV_info (void const* data, - AILSOUNDINFO* info); - -extern S32 AILCALL AIL_API_compress_ADPCM (AILSOUNDINFO const* info, //) - void** outdata, U32* outsize); - -extern S32 AILCALL AIL_API_decompress_ADPCM (AILSOUNDINFO const* info, - void** outdata, - U32* outsize); - -extern S32 AILCALL AIL_API_file_type (void const* data, - U32 size); - -extern S32 AILCALL AIL_API_file_type_named (void const* data, - char const* filename, - U32 size); - -extern S32 AILCALL AIL_API_find_DLS (void const* data, - U32 size, - void**xmi, - U32* xmisize, - void**dls, - U32* dlssize); - -// -// Internal MSS mixer RIB calls -// - -extern U32 AILCALL MSS_MMX_available (void); - -extern void AILCALL MSS_mixer_startup (void); -extern void AILCALL MSS_mixer_shutdown (void); - -extern void AILCALL MSS_mixer_flush(S32 *dest, - S32 len -#ifdef IS_X86 - ,U32 MMX_available -#endif - ); - -extern void AILCALL MSS_mixer_merge(void const * *src, - U32 *src_fract, - void const *src_end, - S32 * *dest, - void *dest_end, - S32 *left_val, - S32 *right_val, - S32 playback_ratio, - S32 scale_left, - S32 scale_right, - U32 operation -#ifdef IS_X86 - ,U32 MMX_available -#endif - ); - -extern void AILCALL MSS_mixer_copy(void const *src, - S32 src_len, - void *dest, - U32 operation -#ifdef IS_BE - ,S32 big_endian_output -#else -#ifdef IS_X86 - ,U32 MMX_available -#endif -#endif - ); - -extern void AILCALL SS_set_speaker_configuration (D3DSTATE *D3D, - MSSVECTOR3D *speaker_positions, - S32 n_channels, - S32 logical_channels_per_sample); - -extern void SS_calculate_3D_channel_levels(D3DSTATE const *D3D, - S32 logical_channels_per_sample, - S3DSTATE *S3D, - F32 *channel_levels); - -extern void AILCALL SS_update_driver_reverb_state(HDIGDRIVER dig); - -extern void AILCALL SS_update_sample_reverb_state(HSAMPLE S); - -extern void AILCALL SS_flush (HDIGDRIVER dig, S32 reverb_index); - -extern void AILCALL SS_copy (HDIGDRIVER dig, S32 reverb_index, void *lpWaveAddr); - - -extern F32 AILCALLBACK SS_default_falloff_function_callback(HSAMPLE S, //) - F32 distance, - F32 rolloff_factor, - F32 min_dist, - F32 max_dist); -extern S32 AILCALLBACK SS_stream_to_buffer(HSAMPLE S, - S16 *dest_mono_sample_buffer, - S32 dest_buffer_size); - - -#ifdef MILES10 -extern void SS_fill(HDIGDRIVER dig); -#else -extern void SS_fill(HDIGDRIVER dig, void *lpData); -#endif - -extern void AILCALL SS_start_DIG_driver_playback(HSAMPLE S); - -extern S32 AILCALL SS_set_sample_type( HSAMPLE S, S32 format, U32 channel_mask ); - -extern void AILCALL AIL_apply_reverb( HDIGDRIVER dig ); - -extern S32 AILCALL AIL_allocate_reverb_buffers( HDIGDRIVER dig, S32 index ); - -extern void AILCALL AIL_apply_lowpass( void* dest, void const* src, void const* src_end, LOWPASS_INFO* lp_in, S32 op ); - - -#if defined(IS_WIN32) || defined(IS_GENERICDIG) -extern S32 AILCALL get_system_speaker_configuration(MSS_MC_SPEC *channel_spec); -#endif - - -#ifdef IS_BE - - #ifdef IS_PPC - - #ifdef IS_XENON - - #define LE_SWAP32( ptr ) __loadwordbytereverse(0,ptr) - - #define LE_SWAP32_OFS( ptr,ofs ) __loadwordbytereverse(ofs,ptr) - - #define STORE_LE_SWAP32( ptr, val ) __storewordbytereverse ( (U32)(val), 0, ptr ) - - #elif (defined(IS_PS3) && !defined(IS_SPU)) || defined(IS_MAC) - #define LE_SWAP32( ptr ) ld_le32(ptr) - #define LE_SWAP32_OFS( ptr, ofs ) ld_le32_ofs(ptr,ofs) - // the char* is not required, but works around a GCC bug - #define STORE_LE_SWAP32( ptr, val ) st_le32( (char*)(ptr), (U32)(val) ) - #elif defined(IS_WIIU) - - #define LE_SWAP32(ptr) (*(__bytereversed unsigned int *)(ptr)) - #define LE_SWAP32_OFS(ptr, ofs) (*(__bytereversed unsigned int *)AIL_ptr_add(ptr, ofs)) - - #define STORE_LE_SWAP32( ptr, val ) (*(__bytereversed unsigned int *)(ptr) = (val)) - - #define STORE_LE_SWAP16_OFS( ptr, val, const_ofs ) (*(__bytereversed unsigned short*)(AIL_ptr_add(ptr, const_ofs))) = (val) - #else - #define LE_SWAP32( ptr ) __lwbrx((void*)(ptr),0) - #define LE_SWAP32_OFS( ptr,ofs ) __lwbrx((void*)(ptr),ofs) - - #define STORE_LE_SWAP32( ptr, val ) __stwbrx( (U32)(val), ptr, 0 ) - #endif - - #elif defined(IS_SPU) - - static U32 inline LE_SWAP32(void const * src) __attribute__((always_inline)); - static U32 inline LE_SWAP32(void const * src) - { - U32 i = (*((U32*)src)); - vec_uint4 v = spu_promote( i, 0 ); - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 3, 2, 1, 0, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15})); - i = spu_extract( v, 0 ); - return i; - } - - static U32 inline LE_SWAP32_OFS(void const * src,S32 ofs) __attribute__((always_inline)); - static U32 inline LE_SWAP32_OFS(void const * src,S32 ofs) - { - U32 i = (*((U32*)(((char*)src)+ofs))); - vec_uint4 v = spu_promote( i, 0 ); - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 3, 2, 1, 0, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15})); - i = spu_extract( v, 0 ); - return i; - } - - #define STORE_LE_SWAP32( ptr, val )\ - { \ - U32 tmp = (U32) val; \ - vec_uint4 v = spu_promote( tmp, 0 ); \ - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 3, 2, 1, 0, 4, 5, 6, 7, \ - 8, 9, 10, 11, 12, 13, 14, 15})); \ - tmp = spu_extract( v, 0 ); \ - *((U32 *)(((char*)ptr)+0)) = tmp; \ - } - - #define STORE_LE_SWAP32_OFS( ptr, val, ofs )\ - { \ - U32 tmp = (U32) val; \ - vec_uint4 v = spu_promote( tmp, 0 ); \ - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 3, 2, 1, 0, 4, 5, 6, 7, \ - 8, 9, 10, 11, 12, 13, 14, 15})); \ - tmp = spu_extract( v, 0 ); \ - *((U32 *)(((char*)ptr)+ofs)) = tmp; \ - } - - #else - - #define LE_SWAP32(ptr) \ - ( ( ( ( *((U32 *)(ptr) ) ) << 24 ) ) | \ - ( ( ( *((U32 *)(ptr) ) ) << 8 ) & 0x00FF0000 ) | \ - ( ( ( *((U32 *)(ptr) ) ) >> 8 ) & 0x0000FF00 ) | \ - ( ( ( *((U32 *)(ptr) ) ) >> 24 ) ) ) - - #define LE_SWAP32_OFS(ptr,ofs) \ - ( ( ( ( *((U32 *)AIL_ptr_add(ptr,ofs) ) ) << 24 ) ) | \ - ( ( ( *((U32 *)AIL_ptr_add(ptr,ofs) ) ) << 8 ) & 0x00FF0000 ) | \ - ( ( ( *((U32 *)AIL_ptr_add(ptr,ofs) ) ) >> 8 ) & 0x0000FF00 ) | \ - ( ( ( *((U32 *)AIL_ptr_add(ptr,ofs) ) ) >> 24 ) ) ) - - #define STORE_LE_SWAP32( ptr, val ) { *((U32 *)ptr) = \ - ( ( ( ( ((U32)(val) ) ) << 24 ) ) | \ - ( ( ( ((U32)(val) ) ) << 8 ) & 0x00FF0000 ) | \ - ( ( ( ((U32)(val) ) ) >> 8 ) & 0x0000FF00 ) | \ - ( ( ( ((U32)(val) ) ) >> 24 ) ) ); } - - #endif - - #if defined( IS_PPC ) - - #ifdef IS_XENON - unsigned short __loadshortbytereverse (int offset, const void * base); - unsigned long __loadwordbytereverse (int offset, const void * base); - - void __storeshortbytereverse (unsigned short val, int offset, void * base); - void __storewordbytereverse (unsigned int val, int offset, void * base); - - #define LE_SWAP16( ptr ) __loadshortbytereverse (0,(S16 *)ptr) - - #define LE_SWAP16_OFS( ptr, const_ofs ) __loadshortbytereverse (const_ofs,(S16 *)ptr) - - #define STORE_LE_SWAP16( ptr, val ) __storeshortbytereverse ( (U16)(val), 0, (S16 *)ptr ) - - #define STORE_LE_SWAP16_OFS( ptr, val, const_ofs ) __storeshortbytereverse ( (U16)(val), const_ofs, (S16 *)ptr ) - #else - - #if (defined(IS_PS3) && !defined(IS_SPU)) || defined(IS_MAC) - - #define __fsel( outf, cmp, inf1, inf2 ) \ - __asm__ __volatile__ ("fsel %0,%1,%2,%3" : "=f" (outf) : "f" (cmp), "f" (inf1), "f" (inf2)); - - static inline float fclip1(float sample ) - { - float ret; - - __fsel( ret, sample + 1.0f, sample, -1.0f ); - __fsel( ret, sample - 1.0f, 1.0f, ret ); - return( ret ); - } - - static __inline__ U16 ld_le16(const S16 *addr) - { - U16 val; - __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr)); - return val; - } - - static __inline__ U16 ld_le16_ofs(const S16 *addr, U64 const_ofs ) - { - U16 val; - __asm__ __volatile__ ("lhbrx %0,%1,%2" : "=r" (val) : "b" (const_ofs), "r" (addr)); - return val; - } - - static __inline__ void st_le16(S16 *addr, const U16 val) - { - __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); - } - - static __inline__ void st_le16_ofs(S16 *addr, U64 const_ofs, const U16 val) - { - __asm__ __volatile__ ("sthbrx %2,%1,%3" : "=m" (*addr) : "b" (const_ofs), "r" (val), "r" (addr)); - } - - static __inline__ U32 ld_le32(const void *addr) - { - U32 val; - - __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" ((U32*)addr) ); - return val; - } - - static __inline__ U32 ld_le32_ofs(const void *addr, U64 const_ofs ) - { - U32 val; - __asm__ __volatile__ ("lwbrx %0,%1,%2" : "=r" (val) : "b" (const_ofs), "r" (addr)); - return val; - } - -/* static __inline__ void st_le32_ofs(void *addr, U64 const_ofs, const U32 val) - { - __asm__ __volatile__ ("stwbrx %2,%1,%3" : "=m" (*(U32*)addr) : "b" (const_ofs), "r" (val), "r" ((U32*)addr)); - }*/ - - static __inline__ void st_le32(void *addr, const U32 val) - { //todo, weird hacks to make this work with GCC - __asm__ __volatile__ ("stwbrx %1,%3,%2" : "=m" (*(U32*)addr) : "r" (val), "r" ((U32*)addr), "O"(0) ); - } - - #define LE_SWAP16( ptr ) ld_le16 ((S16 *)ptr) - - #define LE_SWAP16_OFS( ptr, const_ofs ) ld_le16_ofs ((S16 *)ptr, const_ofs) - - #define STORE_LE_SWAP16( ptr, val ) st_le16( (S16 *)ptr, (U16)(val) ) - - #define STORE_LE_SWAP16_OFS( ptr, val, const_ofs ) st_le16_ofs( (S16 *)ptr, const_ofs, (U16)(val) ) - #elif defined(IS_WIIU) - - #define LE_SWAP16(ptr) (*(__bytereversed unsigned short *)(ptr)) - #define LE_SWAP16_OFS(ptr, ofs) (*(__bytereversed unsigned short *)AIL_ptr_add(ptr, ofs)) - - #define STORE_LE_SWAP16( ptr, val ) (*(__bytereversed unsigned short *)(ptr) = (val)) - - #else - #define LE_SWAP16( ptr ) __lhbrx((S16 *)ptr,0) - - #define LE_SWAP16_OFS( ptr, const_ofs ) __lhbrx((S16 *)ptr,const_ofs) - - #define STORE_LE_SWAP16( ptr, val ) __sthbrx( (U16)(val), (S16 *)ptr, 0 ) - - #define STORE_LE_SWAP16_OFS( ptr, val, const_ofs ) __sthbrx( (U16)(val), (S16 *)ptr, const_ofs ) - #endif - #endif - - #elif defined( IS_SPU ) - - static U32 inline LE_SWAP16(void const * src) __attribute__((always_inline)); - static U32 inline LE_SWAP16(void const * src) - { - U32 i = (*((U16*)src)); - vec_uint4 v = spu_promote( i, 0 ); - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 0, 1, 3, 2, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15})); - i = spu_extract( v, 0 ); - return i; - } - - static U32 inline LE_SWAP16_OFS(void const * src, S32 ofs) __attribute__((always_inline)); - static U32 inline LE_SWAP16_OFS(void const * src, S32 ofs) - { - U32 i = (*((U16*)(((char*)src)+ofs))); - vec_uint4 v = spu_promote( i, 0 ); - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 0, 1, 3, 2, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15})); - i = spu_extract( v, 0 ); - return i; - } - - #define STORE_LE_SWAP16( ptr, val )\ - { \ - U32 tmp = (U16) val; \ - vec_uint4 v = spu_promote( tmp, 0 ); \ - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 0, 1, 3, 2, 4, 5, 6, 7, \ - 8, 9, 10, 11, 12, 13, 14, 15})); \ - tmp = spu_extract( v, 0 ); \ - *((U16 *)(((char*)ptr)+0)) = tmp; \ - } - - #define STORE_LE_SWAP16_OFS( ptr, val, ofs )\ - { \ - U32 tmp = (U16) val; \ - vec_uint4 v = spu_promote( tmp, 0 ); \ - v = (vec_uint4)spu_shuffle( v, v, ((vec_uchar16){ 0, 1, 3, 2, 4, 5, 6, 7, \ - 8, 9, 10, 11, 12, 13, 14, 15})); \ - tmp = spu_extract( v, 0 ); \ - *((U16 *)(((char*)ptr)+ofs)) = tmp;\ - } - - #else - - #define LE_SWAP16(ptr) \ - ( ( U16 ) \ - ( ( ( ( *((U16 *)(ptr) ) ) << 8 ) ) | \ - ( ( ( *((U16 *)(ptr) ) ) >> 8 ) ) ) \ - ) - - #define LE_SWAP16_OFS(ptr,const_ofs) \ - ( ( U16 ) \ - ( ( ( ( *((U16 *)(AIL_ptr_add(ptr,const_ofs)) ) ) << 8 ) ) | \ - ( ( ( *((U16 *)(AIL_ptr_add(ptr,const_ofs)) ) ) >> 8 ) ) ) \ - ) - - #define STORE_LE_SWAP16( ptr, val ) { *((U16*)ptr) = ( \ - ( ( ( ((U16)(val) ) ) << 8 ) ) | \ - ( ( ( ((U16)(val) ) ) >> 8 ) ) ); } - - #define STORE_LE_SWAP16_OFS( ptr, val, const_ofs ) { *((U16*)AIL_ptr_add(ptr,const_ofs)) = ( \ - ( ( ( ((U16)(val) ) ) << 8 ) ) | \ - ( ( ( ((U16)(val) ) ) >> 8 ) ) ); } - - #endif - - #define BE_SWAP32( ptr ) ( *((U32 *)(ptr) ) ) - #define BE_SWAP16( ptr ) ( *((U16 *)(ptr) ) ) - - #define MEM_LE_SWAP32(n) *((U32*)n) = LE_SWAP32(n); - #define MEM_LE_SWAP16(n) *((U16*)n) = (U16) LE_SWAP16(n); - - #define MEM_BE_SWAP32(n) - #define MEM_BE_SWAP16(n) - - // unaligned versions - #define BEU_SWAP32( ptr ) ( *((U32 *)(ptr) ) ) - #define BEU_SWAP16( ptr ) ( *((U16 *)(ptr) ) ) - - #define LEU_SWAP32(ptr) LE_SWAP32(ptr) - #define LEU_SWAP16(ptr) LE_SWAP16(ptr) - - #define STORE_LEU_SWAP32( ptr, val ) STORE_LE_SWAP32( ptr, val ) - #define STORE_LEU_SWAP16( ptr, val ) STORE_LE_SWAP16( ptr, val ) - - #define MEM_LEU_SWAP32(n) *((U32*)n) = LEU_SWAP32(n); - #define MEM_LEU_SWAP16(n) *((U32*)n) = LEU_SWAP32(n); - -#else // IS_BE - - #define LE_SWAP32( ptr ) ( *((U32 *)(ptr) ) ) - #define LE_SWAP32_OFS( ptr,const_ofs ) ( *((U32 *)AIL_ptr_add(ptr,const_ofs) ) ) - #define LE_SWAP16( ptr ) ( *((U16 *)(ptr) ) ) - - #define LE_SWAP16_OFS( ptr, const_ofs ) ( *((U16 *)(AIL_ptr_add(ptr,const_ofs)) ) ) - - #define STORE_LE_SWAP32( ptr, val ) { *((U32*)(ptr))=(U32)(val); } - #define STORE_LE_SWAP16( ptr, val ) { *((U16*)(ptr))=(U16)(val); } - #define STORE_LE_SWAP16_OFS( ptr, val, const_ofs ) { *((U16*)((((U8*)ptr)+const_ofs)))=(U16)(val); } - - #define BE_SWAP32(ptr) \ - ( ( ( ( *((U32 *)(ptr) ) ) << 24 ) ) | \ - ( ( ( *((U32 *)(ptr) ) ) << 8 ) & 0x00FF0000 ) | \ - ( ( ( *((U32 *)(ptr) ) ) >> 8 ) & 0x0000FF00 ) | \ - ( ( ( *((U32 *)(ptr) ) ) >> 24 ) ) ) - - #define BE_SWAP16(ptr) \ - ( ( U16 ) \ - ( ( ( ( *((U16 *)(ptr) ) ) << 8 ) ) | \ - ( ( ( *((U16 *)(ptr) ) ) >> 8 ) ) ) \ - ) - -#if defined(IS_PSP) - - #define putunaligned4(temp, s ) \ - __asm__("swl %1,3+%0" : "+m"(*(s)): "r"(temp)); \ - __asm__("swr %1,%0" : "+m"(*(s)) : "r"(temp)); - - #define getunaligned4(temp, s ) \ - __asm__("lwl %0,3+%1" : "=r"(temp) : "o"(*(U32*)(s))); \ - __asm__("lwr %0,%1" : "+r"(temp) : "o"(*(U32*)(s)) ); - - static inline U32 LEU_SWAP32( void * ptr ) - { - U32 ret; - getunaligned4( ret, ptr ); - return( ret ); - } - - static inline U32 BEU_SWAP32( void * ptr ) - { - U32 ret; - - getunaligned4( ret, ptr ); - ret = ( ret << 24 ) | ( ( ret << 8 ) & 0x00ff0000 ) | ( ( ret >> 8 ) & 0x0000ff00 ) | ( ret >> 24 ); - return( ret ); - } - - #define LEU_SWAP16(ptr) \ - ( ( U16 ) \ - ( ( ( ( ((U32)(((U8 *)(ptr))[1]) ) ) << 8 ) ) | \ - ( ( ( ((U32)(((U8 *)(ptr))[0]) ) ) ) ) ) \ - ) - #define BEU_SWAP16(ptr) \ - ( ( U16 ) \ - ( ( ( ( ((U32)(((U8 *)(ptr))[0]) ) ) << 8 ) ) | \ - ( ( ( ((U32)(((U8 *)(ptr))[1]) ) ) ) ) ) \ - ) - - #define STORE_LEU_SWAP32( ptr, val ) { register U32 __v = (U32)val; register U32 * __p = (U32*)ptr; putunaligned4( __v, __p ); } - #define STORE_LEU_SWAP16( ptr, val ) { register U16 __v = (U16)val; ((U8*)(ptr))[0]=(U8)val; ((U8*)(ptr))[1]=(U8)(val>>8);} - -#else - - #define LEU_SWAP32(ptr) LE_SWAP32(ptr) - #define LEU_SWAP16(ptr) LE_SWAP16(ptr) - - #define BEU_SWAP32(ptr) BE_SWAP32(ptr) - #define BEU_SWAP16(ptr) BE_SWAP16(ptr) - - #define STORE_LEU_SWAP32( ptr, val ) STORE_LE_SWAP32( ptr, val ) - #define STORE_LEU_SWAP16( ptr, val ) STORE_LE_SWAP16( ptr, val ) - -#endif - - #define MEM_LEU_SWAP32(n) - #define MEM_LEU_SWAP16(n) - - #define MEM_LE_SWAP32(n) - #define MEM_LE_SWAP16(n) - - #define MEM_BE_SWAP32(n) *((U32*)n) = BE_SWAP32(n); - #define MEM_BE_SWAP16(n) *((U16*)n) = BE_SWAP16(n); - -#endif - - - -#if defined(IS_MAC) || defined(IS_WII) || defined(IS_IPHONE) - -#ifdef IS_X86 - -static inline U32 mult64addsubandshift( U32 mt1, U32 mt2, U32 addv, U32 subv, U32 shift ) -{ - U32 retv; - - unsigned long long value; - value = (unsigned long long)mt1 * mt2; - value += addv; - value -= subv; - value = (signed long long )value >> (signed long long )shift; - retv = (U32)value; - - return( retv ); - -} - - -static U32 __inline mult64anddiv(U32 a,U32 b, U32 c) -{ - U32 retv; - unsigned long long value; - value = (unsigned long long)a * b; - value /= c; - retv = (U32)value; - return( retv ); -} - -static U32 __inline shift64addsubanddiv( U32 val, U32 shift,U32 addv, U32 subv, U32 divv) -{ - U32 retv; - unsigned long long value; - value = (unsigned long long)val; - value <<= shift; - value += addv; - value -= subv; - value = (signed long long ) value / (signed long long ) divv; - retv = (U32)value; - return( retv ); -} - -#elif defined(IS_IPHONE) - -#define WRITE_MONO_SAMPLE( dest, fOut ) \ -{ \ - if (fOut > 32767.0F) *dest++ = 32767; \ - else if (fOut < -32768.0F) *dest++ = -32768; \ - else *dest++ = (S16) fOut; \ -} - -static U32 __inline mult64addsubandshift( U32 mt1, U32 mt2, U32 addv, U32 subv, U32 shift ) -{ - U32 retv; - unsigned long long value; - value = (unsigned long long)mt1 * mt2; - value += addv; - value -= subv; - value = (signed long long )value >> (signed long long )shift; - retv = (U32)value; - return( retv ); -} - -static U32 __inline mult64anddiv(U32 a,U32 b, U32 c) -{ - U32 retv; - unsigned long long value; - value = (unsigned long long)a * b; - value /= c; - retv = (U32)value; - return( retv ); -} - -static U32 __inline shift64addsubanddiv( U32 val, U32 shift,U32 addv, U32 subv, U32 divv) -{ - U32 retv; - unsigned long long value; - value = (unsigned long long)val; - value <<= shift; - value += addv; - value -= subv; - value = (signed long long ) value / (signed long long ) divv; - retv = (U32)value; - return( retv ); -} - -#else - -// -// These three dudes help deal with u64s in hi,lo format -// - -#define mul64hilo(_hi,_lo,_mt1,_mt2) \ - __asm \ - { \ - mulhwu _hi, _mt1, _mt2; \ - mullw _lo, _mt1, _mt2 \ - } \ - - -#define imul64hilo(_hi,_lo,_mt1,_mt2) \ - __asm \ - { \ - mulhw _hi, _mt1, _mt2; \ - mullw _lo, _mt1, _mt2 \ - } \ - - -#define add64hilo(_hi,_lo,_hisub,_losub) \ - __asm \ - { \ - addc _lo, _losub, _lo; \ - adde _hi, _hisub, _hi \ - } \ - - -#define sub64hilo(_hi,_lo,_hisub,_losub) \ - __asm \ - { \ - subfc _lo, _losub, _lo; \ - subfe _hi, _hisub, _hi \ - } \ - -#define carry_check( q, r, c, d ) \ - if ( r < c ) \ - { \ - --q; \ - r += d; \ - if ( r >= d ) \ - { \ - if ( r < c ) \ - { \ - --q; \ - r += d; \ - } \ - } \ - } - -// The PPC mac doesnt' have intrinsics like CW -#ifdef IS_MAC -static U32 __cntlzw(U32 in) -{ - U32 ret; - asm ("cntlzw %0, %1\n": "=r" (ret): "r" (in)); - return ret; -} -#endif - -static inline U32 div64with16( U32 nlo, U32 nhi, U32 d ) -{ - U32 dlo, dhi; - U32 rlo, rhi; - U32 qhi, qlo; - U32 carry; - - dhi = d >> 16; - dlo = d & 0xffff; - - qhi = nhi / dhi; - rhi = nhi % dhi; - - carry = qhi * dlo; - - rhi = ( rhi << 16 ) | ( nlo >> 16 ); - - carry_check( qhi, rhi, carry, d ); - rhi -= carry; - - qlo = rhi / dhi; - rlo = rhi % dhi; - carry = qlo * dlo; - - qhi <<= 16; - - rlo = ( rlo << 16 ) | ( nlo & 0xffff ); - carry_check( qlo, rlo, carry, d ); - -// rlo -= carry; - - return( qhi | qlo ); -} - -static U32 inline mult64anddiv( register U32 a, register U32 b,U32 d ) -{ -/* register U32 hi, lo; - register U32 mt1, mt2, d; - - mt1=m1; - mt2=m2; - d=dv; - - mul64hilo( hi, lo, mt1, mt2 ); - - return( div64(hi,lo,d) ); -*/ - U32 lz; - register U32 nhi=0, nlo=0; - - mul64hilo( nhi, nlo, a, b ); - - if ( ( d & ( d - 1 ) ) == 0 ) - { - lz = (U32) __cntlzw( d ); - - // Shift for powers of 2. - return( ( nhi << ( lz + 1 ) ) | ( nlo >> ( 31 - lz ) ) ); - } - - if ( nhi == 0 ) - { - return( nlo / d ); - } - - lz = (U32) __cntlzw( d ); - - d <<= lz; - nhi = ( nhi << lz ) + ( nlo >> ( 32 - lz ) ); - nlo <<= lz; - - return( div64with16( nlo, nhi, d ) ); - -} - -static U32 inline mult64andshift( U32 m1,U32 m2,U32 shift ) -{ - register U32 hi, lo; - register U32 mt1, mt2; - - mt1=m1; - mt2=m2; - - mul64hilo( hi, lo, mt1, mt2 ); - - return( ( hi << (32 - shift ) ) + ( lo >> shift ) ); -} - -static U32 inline mult64addsubandshift( U32 m1, U32 m2, U32 av, U32 sv, U32 shift ) -{ - register U32 hi=0, lo=0; - register U32 mt1, mt2; - register U32 addv; - register U32 subv; - register U32 zero = 0; - - mt1=m1; - mt2=m2; - addv=av; - subv=sv; - - mul64hilo(hi,lo,mt1,mt2); - add64hilo( hi, lo, zero, addv ); - sub64hilo( hi, lo, zero, subv ); - - return( ( hi << (32 - shift ) ) + ( lo >> shift ) ); -} - -static U32 __inline shift64addsubanddiv( U32 val, U32 shift,U32 av, U32 sv, U32 divv) -{ - register U32 hi, lo; - register U32 addv; - register U32 subv; - register U32 d; - register U32 zero = 0; - U32 lz; - - addv=av; - subv=sv; - d=divv; - - hi = val >> ( 32 - shift ); - lo = val << shift; - add64hilo( hi, lo, zero, addv ); - sub64hilo( hi, lo, zero, subv ); - - if ( hi & 0x80000000 ) - { - register U32 ihi = hi; - register U32 ilo = lo; - hi = lo = 0; - sub64hilo( hi, lo, ihi, ilo ); - - if ( ( d & ( d - 1 ) ) == 0 ) - { - lz = (U32) __cntlzw( d ); - - // Shift for powers of 2. - return( (U32) -(S32) ( ( hi << ( lz + 1 ) ) | ( lo >> ( 31 - lz ) ) ) ); - } - - if ( hi == 0 ) - { - return( (U32) -(S32) ( lo / d ) ); - } - - return( (U32) -(S32) div64with16( lo,hi,d ) ); - } - - if ( ( d & ( d - 1 ) ) == 0 ) - { - lz = (U32) __cntlzw( d ); - - // Shift for powers of 2. - return( ( hi << ( lz + 1 ) ) | ( lo >> ( 31 - lz ) ) ); - } - - if ( hi == 0 ) - { - return( lo / d ); - } - - return( div64with16( lo,hi,d ) ); -} - -#define WRITE_MONO_SAMPLE( dest, fOut ) \ -{ \ - if (fOut > 32767.0F) STORE_LE_SWAP16( dest, 32767 ); \ - else if (fOut < -32768.0F) STORE_LE_SWAP16( dest, -32768 ); \ - else STORE_LE_SWAP16( dest, (S16) fOut ); \ - ++dest; \ -} - -#endif - -#else - -#if ( defined(IS_X86) && defined(IS_WIN32API) ) || defined(IS_LINUX) || defined(__RADSEKRIT2__) - -// -// Macros to aid in writing to build buffers -// - -#define WRITE_MONO_SAMPLE( dest, fOut ) \ -{ \ - if (fOut > 32767.0F) *dest++ = 32767; \ - else if (fOut < -32768.0F) *dest++ = -32768; \ - else *dest++ = (S16) fOut; \ -} - -static U32 __inline mult64addsubandshift( U32 mt1, U32 mt2, U32 addv, U32 subv, U32 shift ) -{ - U32 retv; - -#ifdef __GNUC__ - unsigned long long value; - value = (unsigned long long)mt1 * mt2; - value += addv; - value -= subv; - value = (signed long long )value >> (signed long long )shift; - retv = (U32)value; -#else -#ifdef IS_WIN64 - U64 value; - value = (U64) mt1 * mt2; - value += addv; - value -= subv; - value = (S64) value >> (S64) shift; - retv = (U32) value; -#else - __asm - { - mov eax,[mt1] - mov ecx,[mt2] - mul ecx - add eax,[addv] - adc edx,0 - sub eax,[subv] - sbb edx,0 - mov ecx,[shift] - shrd eax,edx,cl - mov [retv], eax - } -#endif -#endif - return( retv ); -} - -static U32 __inline mult64anddiv(U32 a,U32 b, U32 c) -{ - U32 retv; - -#ifdef __GNUC__ - unsigned long long value; - value = (unsigned long long)a * b; - value /= c; - retv = (U32)value; -#else -#ifdef IS_WIN64 - U64 value; - value = (U64) a * b; - value /= c; - retv = (U32) value; -#else - __asm - { - mov eax,[a] - mov ecx,[b] - mul ecx - mov ecx,[c] - div ecx - mov [retv], eax - } -#endif -#endif - return( retv ); -} - -static U32 __inline shift64addsubanddiv( U32 val, U32 shift,U32 addv, U32 subv, U32 divv) -{ - U32 retv; -#ifdef __GNUC__ - unsigned long long value; - value = (unsigned long long)val; - value <<= shift; - value += addv; - value -= subv; - value = (signed long long ) value / (signed long long ) divv; - retv = (U32)value; -#else -#ifdef IS_WIN64 - U64 value; - value = (U64) val; - value <<= shift; - value += addv; - value -= subv; - value = (S64) value / (S64) divv; - retv = (U32) value; -#else - __asm - { - xor edx, edx - mov eax, [val] - mov ecx, [shift] - shld edx, eax, cl - shl eax, cl - add eax, [addv] - adc edx, 0 - sub eax, [subv] - sbb edx, 0 - mov ecx, [divv] - idiv ecx - mov [retv], eax - } -#endif -#endif - return( retv ); -} - -#else - -#ifdef __WATCOMC__ - -#else - -#if defined( IS_XENON ) - -#define toU64(v) ((U64)((U32)(v))) -#define toS64(v) ((S64)((S32)(v))) - -#define mult64anddiv(mt1,mt2,d) ((U32)((toU64(mt1)*toU64(mt2))/toU64(d))) - -#define mult64addsubandshift(mt1,mt2,addv,subv,d) ((U32)((((S64)((toU64(mt1)*toU64(mt2))+toU64(addv)))-toS64(subv))>>toS64(d))) - -#define shift64addsubanddiv(val,shift,addv,subv,divv) ((U32)(((S64)((toU64(val)< 32767.0F) STORE_LE_SWAP16( dest, 32767 ); \ - else if (fOut < -32768.0F) STORE_LE_SWAP16( dest, -32768 ); \ - else STORE_LE_SWAP16( dest, (S16) fOut ); \ - ++dest; \ -} - - -#else - -#if defined( IS_PSP ) || defined(IS_3DS) || defined(IS_PSP2) || defined(__RADANDROID__) - - -#define toU64(v) ((U64)((U32)(v))) -#define toS64(v) ((S64)((S32)(v))) - -#define mult64anddiv(mt1,mt2,d) ((U32)((toU64(mt1)*toU64(mt2))/toU64(d))) - -#define mult64addsubandshift(mt1,mt2,addv,subv,d) ((U32)((((S64)((toU64(mt1)*toU64(mt2))+toU64(addv)))-toS64(subv))>>toS64(d))) - -#define shift64addsubanddiv(val,shift,addv,subv,divv) ((U32)(((S64)((toU64(val)< 32767.0F) *dest++ = 32767; \ - else if (fOut < -32768.0F) *dest++ = -32768; \ - else *dest++ = (S16) fOut; \ -} - -#elif defined(IS_WIIU) - -#define toU64(v) ((U64)((U32)(v))) -#define toS64(v) ((S64)((S32)(v))) - -#define mult64anddiv(mt1,mt2,d) ((U32)((toU64(mt1)*toU64(mt2))/toU64(d))) - -#define mult64addsubandshift(mt1,mt2,addv,subv,d) ((U32)((((S64)((toU64(mt1)*toU64(mt2))+toU64(addv)))-toS64(subv))>>toS64(d))) - -#define shift64addsubanddiv(val,shift,addv,subv,divv) ((U32)(((S64)((toU64(val)< 32767.0F) STORE_LE_SWAP16( dest, 32767 ); \ - else if (fOut < -32768.0F) STORE_LE_SWAP16( dest, -32768 ); \ - else STORE_LE_SWAP16( dest, (S16) fOut ); \ - ++dest; \ -} - - - -#elif defined( IS_PS3 ) && !defined( IS_SPU ) - -#define toU64(v) ((U64)((U32)(v))) -#define toS64(v) ((S64)((S32)(v))) - -#define mult64anddiv(mt1,mt2,d) ((U32)((toU64(mt1)*toU64(mt2))/toU64(d))) - -#define mult64addsubandshift(mt1,mt2,addv,subv,d) ((U32)((((S64)((toU64(mt1)*toU64(mt2))+toU64(addv)))-toS64(subv))>>toS64(d))) - -#define shift64addsubanddiv(val,shift,addv,subv,divv) ((U32)(((S64)((toU64(val)< 32767.0F) *dest = (S16)(U16)0xff7f; \ - else if (fOut < -32768.0F) *dest = (S16)(U16)0x0080; \ - else STORE_LE_SWAP16( dest, (S16) fOut ) \ - ++dest; \ -} - -#define toU64(v) ((U64)((U32)(v))) -#define toS64(v) ((S64)((S32)(v))) - -#define mult64anddiv(mt1,mt2,d) ((U32)((toU64(mt1)*toU64(mt2))/toU64(d))) - -#define mult64addsubandshift(mt1,mt2,addv,subv,d) ((U32)((((S64)((toU64(mt1)*toU64(mt2))+toU64(addv)))-toS64(subv))>>toS64(d))) - -#define shift64addsubanddiv(val,shift,addv,subv,divv) ((U32)(((S64)((toU64(val)< - - static int stacksizehas( int v ) - { - vector signed int val; - __asm__("or %0,$1,$1" : "=r"(val) ); - - if ( val[1] < ( v + 2048 ) ) { MSSBreakPoint(); } - return v; - } - #define spu_alloc(bytes) (void*)alloca( stacksizehas( ( ( bytes ) + 15 ) & ~15 ) ) - #else - #include - #define spu_alloc(bytes) (void*)alloca( ( ( bytes ) + 15 ) & ~15 ) - #endif - -#endif - -#else - -#define SPU_NAME( flt, name ) static void AILCALL name -#define addstackmark() - -#endif - -// -// low-level utility memory file routines -// - -typedef struct _MEMDUMP -{ - void* buffer[1024]; // up to 64 MB - U8* current; - U32 size; - U32 totalsize; - U32 curbufnum; - U32 lastbufnum; - U32 curpos; - S32 error; - S32 expandable; - U32 eachbuf; - U32 firstbuf; -} MEMDUMP; - -// This typedef occurs in mss.h as well. -//typedef struct _MEMDUMP* HMEMDUMP; - -DXDEC HMEMDUMP AILCALL AIL_mem_open(void* addr,U32 size); - -DXDEC HMEMDUMP AILCALL AIL_mem_create(void); -DXDEC HMEMDUMP AILCALL AIL_mem_create_from_existing(void* addr, U32 size); // do not delete pointer passed in - -DXDEC S32 AILCALL AIL_mem_close(HMEMDUMP m, void** buf, U32* size); - -DXDEC U32 -#if defined(IS_WIN32API) -__cdecl -#endif -AIL_mem_printf(HMEMDUMP m, char const* fmt, ...); - -DXDEC U32 AILCALL AIL_mem_printc(HMEMDUMP m, char c); - -DXDEC U32 AILCALL AIL_mem_prints(HMEMDUMP m, char const* s); - -DXDEC U32 AILCALL AIL_mem_write(HMEMDUMP m, void const* s, U32 bytes); - -DXDEC U32 AILCALL AIL_mem_read(HMEMDUMP m, void* s, U32 bytes); - -DXDEC U32 AILCALL AIL_mem_seek(HMEMDUMP m, U32 pos); - -DXDEC U32 AILCALL AIL_mem_size(HMEMDUMP m); - -DXDEC U32 AILCALL AIL_mem_pos(HMEMDUMP m); - -DXDEC S32 AILCALL AIL_mem_error(HMEMDUMP m); - - - -#define DIG_PROCESS_BUFFER_SIZE 2048 - -extern U8 *ASI_mem_src_ptr; -extern S32 ASI_mem_src_len; -extern S32 ASI_mem_src_pos; - - -extern S32 AILCALLBACK ASI_mem_stream_CB(UINTa user, //) - void *dest, - S32 bytes_requested, - S32 offset); - -#if 1 - -#if 0 //used to be a IS_LINUX - -#else - -DXDEC S32 AILCALL AIL_stricmp(const char *s1, const char *s2); -DXDEC S32 AILCALL AIL_strnicmp( const char *s1, const char *s2, U32 maxlen); - -#if defined(IS_MAC) || defined(IS_LINUX) || defined(IS_3DS) || defined(IS_IPHONE) || defined(IS_PSP2) || defined(IS_WIIU) || defined(__RADSEKRIT2__) || defined(__RADANDROID__) - -#ifdef IS_PSP2 -#ifdef __cplusplus -} -#endif -#endif - -#include -#include // for abs(). - -#ifdef IS_PSP2 -#ifdef __cplusplus -extern "C" { -#endif -#endif - - -#define AIL_memcpy memcpy -#define AIL_memmove memmove -#define AIL_strcpy strcpy -#define AIL_strcmp strcmp -#define AIL_strlen strlen -#define AIL_strcat strcat -#define AIL_memset memset -#define AIL_ptr_add(ptr,off) ((void*)(((U8*)(ptr))+(off))) -#define AIL_ptr_dif(p1,p2) ((SINTa)((SINTa) p1) - ((SINTa) p2)) -#define AIL_ptr_alloc_clone(x) ((void*)x) -#define AIL_ptr_free_clone(x) - -#ifdef __cplusplus -} - template inline T AILptradd( T ptr, U32 off ) { return( T(AIL_ptr_add( ptr, off )) ); } - #define AIL_ptr_inc_clone(x,y) x=AILptradd(x,y) -extern "C" { -#endif - -#define AIL_ptr_fixup_clone(x) -#define AIL_ptr_lt(x,y) (((UINTa)x) < ((UINTa)y)) -#define AIL_ptr_ge(x,y) (((UINTa)x) >= ((UINTa)y)) -#define AIL_ptr_eq(x,y) (((UINTa)x) == ((UINTa)y)) -#define AIL_ptr_ne(x,y) (((UINTa)x) != ((UINTa)y)) -#define AIL_ptr_lin_addr(x) ((UINTa)(x)) - -#define AIL_abs abs -#define AIL_memcmp memcmp - -#else // not mac or linux - -#ifdef IS_WIN32API - -#define AIL_abs abs - -#ifdef IS_XENON - -typedef void *PVOID; -typedef int INT; -typedef unsigned long ULONG_PTR; -typedef ULONG_PTR SIZE_T; - -PVOID -__stdcall -XMemSet( - PVOID pDest, - INT c, - size_t count - ); - -PVOID -__stdcall -XMemCpy( - PVOID pDest, - const void* pSrc, - size_t count - ); - -char * __cdecl strcpy( char *_Dest, const char * _Source); - -#define AIL_memcpy XMemCpy -#define AIL_memset XMemSet - -#else - -#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(__NT__) || defined(__WIN32__) - #include - void * __cdecl memcpy(void *, const void *, size_t); - void * __cdecl memset(void *, int, size_t); - char * __cdecl strcpy(char *, const char *); -#endif - -#define AIL_memcpy memcpy -#define AIL_memset memset - -#endif - -#if defined(IS_XENON) -#include -#endif - -#define AIL_memmove memmove - -#define AIL_memcmp memcmp - -#define AIL_strcpy strcpy - -#define AIL_strcmp strcmp - -#define AIL_strlen strlen - -#define AIL_strcat strcat - -#define AIL_ptr_add(ptr,off) ((void*)(((U8*)(ptr))+(off))) - -#define AIL_ptr_dif(p1,p2) ((SINTa)((SINTa) p1) - ((SINTa) p2)) - -#define AIL_ptr_alloc_clone(x) ((void*)x) - -#define AIL_ptr_free_clone(x) - -#ifdef __cplusplus -} - template inline T AILptradd( T ptr, U32 off ) { return( T(AIL_ptr_add( ptr, off )) ); } - #define AIL_ptr_inc_clone(x,y) x=AILptradd(x,y) -extern "C" { -#endif - -#define AIL_ptr_fixup_clone(x) - -#define AIL_ptr_lt(x,y) (((UINTa)x) < ((UINTa)y)) - -#define AIL_ptr_ge(x,y) (((UINTa)x) >= ((UINTa)y)) - -#define AIL_ptr_eq(x,y) (((UINTa)x) == ((UINTa)y)) - -#define AIL_ptr_ne(x,y) (((UINTa)x) != ((UINTa)y)) - -#define AIL_ptr_lin_addr(x) ((UINTa)(x)) - -#else - -#if defined(IS_PSP) - -#define AIL_memmove memmove - -#define AIL_memcpy memcpy - -#define AIL_memset memset - -#define AIL_memcmp memcmp - -#define AIL_strcpy strcpy - -#define AIL_strcmp strcmp - -#define AIL_stricmp strcasecmp - -#define AIL_strnicmp strncasecmp - -#define AIL_strlen strlen - -#define AIL_strcat strcat - -#define AIL_ptr_add(ptr,off) ((void*)(((U8*)(ptr))+(off))) - -#define AIL_ptr_dif(p1,p2) ((SINTa)((SINTa) p1) - ((SINTa) p2)) - -#define AIL_ptr_alloc_clone(x) ((void*)x) - -#define AIL_ptr_free_clone(x) - -#ifdef __cplusplus -} - template inline T AILptradd( T ptr, U32 off ) { return( T(AIL_ptr_add( ptr, off )) ); } - #define AIL_ptr_inc_clone(x,y) x=AILptradd(x,y) -extern "C" { -#endif - -#define AIL_ptr_fixup_clone(x) - -#define AIL_ptr_lt(x,y) (((UINTa)x) < ((UINTa)y)) - -#define AIL_ptr_ge(x,y) (((UINTa)x) >= ((UINTa)y)) - -#define AIL_ptr_eq(x,y) (((UINTa)x) == ((UINTa)y)) - -#define AIL_ptr_ne(x,y) (((UINTa)x) != ((UINTa)y)) - -#define AIL_ptr_lin_addr(x) ((UINTa)(x)) - -static inline S32 AIL_abs(S32 v) { return( ( v >=0 ) ? v : -v ); } - - -#elif defined(IS_PS3) - -#define AIL_memmove memmove - -#define AIL_memcpy memcpy - -#define AIL_memset memset - -#define AIL_memcmp memcmp - -#define AIL_strcpy strcpy - -#define AIL_strcmp strcmp - -#define AIL_stricmp strcasecmp_ascii - -#define AIL_strnicmp strncasecmp_ascii - -#define AIL_strlen strlen - -#define AIL_strcat strcat - -#define AIL_ptr_add(ptr,off) ((void*)(((U8*)(ptr))+(off))) - -#define AIL_ptr_dif(p1,p2) ((SINTa)((SINTa) p1) - ((SINTa) p2)) - -#define AIL_ptr_alloc_clone(x) ((void*)x) - -#define AIL_ptr_free_clone(x) - -#ifdef __cplusplus -} - template inline T AILptradd( T ptr, U32 off ) { return( T(AIL_ptr_add( ptr, off )) ); } - #define AIL_ptr_inc_clone(x,y) x=AILptradd(x,y) -extern "C" { -#endif - -#define AIL_ptr_fixup_clone(x) - -#define AIL_ptr_lt(x,y) (((UINTa)x) < ((UINTa)y)) - -#define AIL_ptr_ge(x,y) (((UINTa)x) >= ((UINTa)y)) - -#define AIL_ptr_eq(x,y) (((UINTa)x) == ((UINTa)y)) - -#define AIL_ptr_ne(x,y) (((UINTa)x) != ((UINTa)y)) - -#define AIL_ptr_lin_addr(x) ((UINTa)(x)) - -static inline S32 AIL_abs(S32 v) { return( ( v >=0 ) ? v : -v ); } - -#else - -#ifdef IS_WII - -#define AIL_memcpy memcpy - -#define AIL_memmove memmove - -#define AIL_strcpy strcpy - -#define AIL_strcmp strcmp - -#define AIL_strlen strlen - -#define AIL_strcat strcat - -#define AIL_memset memset - -#define AIL_ptr_add(ptr,off) ((void*)(((U8*)(ptr))+(off))) - -#define AIL_ptr_dif(p1,p2) ((SINTa)((SINTa) p1) - ((SINTa) p2)) - -#define AIL_ptr_alloc_clone(x) ((void*)x) - -#define AIL_ptr_free_clone(x) - -#ifdef __cplusplus -} - template inline T AILptradd( T ptr, U32 off ) { return( T(AIL_ptr_add( ptr, off )) ); } - #define AIL_ptr_inc_clone(x,y) x=AILptradd(x,y) -extern "C" { -#endif - -#define AIL_ptr_fixup_clone(x) - -#define AIL_ptr_lt(x,y) (((UINTa)x) < ((UINTa)y)) - -#define AIL_ptr_ge(x,y) (((UINTa)x) >= ((UINTa)y)) - -#define AIL_ptr_eq(x,y) (((UINTa)x) == ((UINTa)y)) - -#define AIL_ptr_ne(x,y) (((UINTa)x) != ((UINTa)y)) - -#define AIL_ptr_lin_addr(x) ((UINTa)(x)) - -#ifndef __cplusplus -int abs( int ); -#endif - -#define AIL_abs abs -#define AIL_memcmp memcmp - -#endif - -#endif - -#endif - -#endif - -#endif - -#endif - -#ifndef AIL_ptr_inc_clone -#define AIL_ptr_inc_clone(x,y) AIL_ptr_inc_clone_ref((void * *)(void*) &(x),y) -#endif -#define AIL_ptr_from_clone(clone,hptr) (AIL_ptr_add(hptr,AIL_ptr_dif(clone,hptr))) - - -#ifdef IS_32 - -#define MSS_do_cb1(type,addr,ds,param1) \ - (addr)(param1) - -#define MSS_do_cb3(type,addr,ds,param1,param2,param3) \ - (addr)(param1,param2,param3) - -#define MSS_do_cb4(type,addr,ds,param1,param2,param3,param4) \ - (addr)(param1,param2,param3,param4) - -#define MSS_do_cb1_with_ret(ret,type,addr,ds,param1) \ - ret = (addr)(param1) - -#define MSS_do_cb3_with_ret(ret,type,addr,ds,param1,param2,param3) \ - ret = (addr)(param1,param2,param3) - -#define MSS_do_cb4_with_ret(ret,type,addr,ds,param1,param2,param3,param4) \ - ret = (addr)(param1,param2,param3,param4) - -#define MSS_do_cb5_with_ret(ret,type,addr,ds,param1,param2,param3,param4,param5) \ - ret = (addr)(param1,param2,param3,param4,param5) - -#endif - -#if (defined(IS_MAC) && defined( IS_X86 )) || defined(IS_LINUX) - - -#define MSS_CB_STACK_ALIGN( name ) \ -void MSS_CALLBACK_ALIGNED_NAME(name)(void)\ -{\ - asm (\ - "mov $16,%%eax\n" \ - "sub $64,%%esp\n" \ - "add %%esp, %%eax\n" \ - "and $0xfffffff0,%%eax\n" \ - "movups 8(%%ebp), %%xmm0\n" \ - "movaps %%xmm0, (%%eax)\n" \ - "movl %%esp, 32(%%eax)\n" \ - "mov %%eax,%%esp\n" \ - "call *%0\n" \ - "movl 32(%%esp), %%esp\n" \ - "add $64,%%esp\n" \ - : : "r" (name) : "eax"); \ -} - -#define MSS_DEF_CB_STACK_ALIGN( name ) DXDEF MSS_CB_STACK_ALIGN( name ) -#define MSS_CB_STACK_ALIGN_DEC( name ) void MSS_CALLBACK_ALIGNED_NAME(name)(void); - -#else - -#define MSS_CB_STACK_ALIGN( name ) -#define MSS_DEF_CB_STACK_ALIGN( name ) -#define MSS_CB_STACK_ALIGN_DEC( name ) - -#endif - -#ifdef IS_XENON - -#define XWAVE_FORMAT_XMA 0x0165 - -typedef MSS_STRUCT XXMASTREAMFORMAT -{ - U32 PsuedoBytesPerSec; // Used by encoder - U32 SampleRate; // Sample rate for the stream. - U32 LoopStart; // Loop start offset (in bits). - U32 LoopEnd; // Loop end offset (in bits). - - // Format for SubframeData: eeee ssss. - // e: Subframe number of loop end point [0,3]. - // s: Number of subframes to skip before decoding and outputting at the loop start point [1,4]. - - U8 SubframeData; // Data for decoding subframes. See above. - U8 Channels; // Number of channels in the stream (1 or 2). - U16 ChannelMask; // Channel assignments for the channels in the stream (same as - // lower 16 bits of dwChannelMask in WAVEFORMATEXTENSIBLE). -} XXMASTREAMFORMAT; - -typedef MSS_STRUCT XXMAWAVEFORMAT -{ - U16 FormatTag; // Audio format type (always WAVE_FORMAT_XMA). - U16 BitsPerSample; // Bit depth (currently required to be 16). - U16 EncodeOptions; // Options for XMA encoder/decoder. - U16 LargestSkip; // Largest skip used in interleaving streams. - U16 NumStreams; // Number of interleaved audio streams. - U8 LoopCount; // Number of loop repetitions (255 == infinite). - U8 Version; // Version of the encoder that generated this. - XXMASTREAMFORMAT XmaStreams[1]; // Format info for each stream (can grow based on wNumStreams). -} XXMAWAVEFORMAT; - -#endif - -extern U32 SS_granularity(HSAMPLE S); - -extern S32 MC_open_output_filter(C8 const *name, //) - HDIGDRIVER driver, - S32 is_matrix_filter); - -extern void AILCALL MSS_mixer_mc_copy ( MSS_BB * build, - S32 n_build_buffers, - void * lpWaveAddr, - S32 hw_format, -#ifdef IS_X86 - S32 use_MMX, -#endif - S32 samples_per_buffer, - S32 physical_channels_per_sample ); - -extern void AILCALL MSS_mixer_adpcm_decode( void * dest, - void const * in, - S32 out_len, - S32 in_len, - S32 input_format, - ADPCMDATA *adpcm_data ); -// -// Prototypes for ADPCM decode routines -// - -extern void ASMLINK DecodeADPCM_STEREO( ASMPARM void *out, - ASMPARM void const *in, - ASMPARM S32 out_len, - ASMPARM S32 in_len, - ASMPARM ADPCMDATA *adpcm_data); - -extern void ASMLINK DecodeADPCM_MONO( ASMPARM void *out, - ASMPARM void const *in, - ASMPARM S32 out_len, - ASMPARM S32 in_len, - ASMPARM ADPCMDATA *adpcm_data); - -extern void ASMLINK DecodeADPCM_MONO_8( ASMPARM void *out, - ASMPARM void const *in, - ASMPARM S32 out_len, - ASMPARM S32 in_len, - ASMPARM ADPCMDATA *adpcm_data); - - -// -// .VOC file header -// - -typedef MSS_STRUCT -{ - S8 ID_string[20]; - - U16 data_offset; - U16 version; - U16 ID_code; -} -VOC; - -typedef MSS_STRUCT _ADPCMOUT { - U32 riffmark; - U32 rifflen; - U32 wavemark; - U32 fmtmark; - U32 fmtlen; - U16 fmttag; - U16 channels; - U32 sampersec; - U32 avepersec; - U16 blockalign; - U16 bitspersam; - S16 extra; - S16 samples_per_block; - U32 factmark; - U32 factlen; - U32 samples; - U32 datamark; - U32 datalen; -} ADPCMOUT; - -typedef MSS_STRUCT _WAVEOUT { - U32 riffmark; - U32 rifflen; - U32 wavemark; - U32 fmtmark; - U32 fmtlen; - U16 fmttag; - U16 channels; - U32 sampersec; - U32 avepersec; - U16 blockalign; - U16 bitspersam; - U32 datamark; - U32 datalen; -} WAVEOUT; - -typedef MSS_STRUCT _WAVEOUTEXT { - U32 riffmark; - U32 rifflen; - U32 wavemark; - U32 fmtmark; - U32 fmtlen; - U16 fmttag; - U16 channels; - U32 sampersec; - U32 avepersec; - U16 blockalign; - U16 bitspersam; - U16 size; - U16 sampbits; - U32 chanmask; - U8 subfmt[16]; - U32 datamark; - U32 datalen; -} WAVEOUTEXT; - -F32 evaluate_graph(MSSGRAPHPOINT const* graph, S32 cnt, F32 x); - -// -// platform allocators -// - -void * AILCALLBACK platform_alloc(UINTa size); -void AILCALLBACK platform_free( void * ptr ); - - -// -// Abstracted IO structures. -// - -#ifdef IS_WII -#define MAX_PLATFILE_SPECIFIC_SIZE 512 -#else -#define MAX_PLATFILE_SPECIFIC_SIZE 32 -#endif -typedef struct PLATFORM_FILE -{ - char plat_specific[MAX_PLATFILE_SPECIFIC_SIZE]; // needs to be at the front for wii - U32 offset; // current offset in to our "file" - U32 start_pos; // offset of our "file" from the start of the physical file. - U32 file_length; // length of our "file" - S32 dont_close; // nonzero if we don't own the file handle, so when done, don't close. - U32 raw_length; // length of the entire file that we might be "inside of" -} PLATFORM_FILE; - -typedef struct FNVALUES -{ - char const * filename; - U32 size; - U32 start; -} FNVALUES; - -typedef struct FHVALUES -{ - S32 hand; - S32 length; - S32 pos; -} FHVALUES; - -// -// Functions implemented per platform. -// -extern int Platform_OpenFile(struct PLATFORM_FILE* i_File, char const * fn); -extern void Platform_SeekFromBeginning(PLATFORM_FILE* i_File, S32 i_Offset); -extern U32 Platform_ReadFile(PLATFORM_FILE* i_File, void* o_Buffer, U32 i_ReadBytes); -extern void Platform_CloseFile(PLATFORM_FILE* i_File); - -DXDEC void AILCALL AIL_set_event_settings(void* i_Settings); - -// Auditioner Declarations -//----------------------------------------------------------------------------- -S32 Audition_Status(); -S32 Audition_Pump(); -void* Audition_OpenBank(char const* i_FileName); -S32 Audition_OpenComplete(void* i_Bank); -void Audition_CloseBank(void* i_Bank); - -void Audition_Suppress(S32 i_IsSuppressed); -void Audition_FrameStart(); -void Audition_FrameEnd(); -void Audition_DefragStart(); -void Audition_SetBlend(U64 i_EventId, char const* i_Name); -void Audition_SetPersist(U64 i_EventId, char const* i_Name, char const* i_Preset); -void Audition_Event(char const* i_EventName, U64 i_EventId, U64 i_Filter, S32 i_Exists, void* i_InitBlock, S32 i_InitBlockLen); -void Audition_Sound(U64 i_EventId, U64 i_SoundId, char const* i_Sound, char const* i_Label, float i_Volume, S32 i_Delay, float i_Pitch); -void Audition_SoundComplete(U64 i_SoundId); -void Audition_SoundPlaying(U64 i_SoundId); -void Audition_SoundFlags(U64 i_SoundId, S32 i_Flags); -void Audition_SoundLimited(U64 i_SoundId, char const* i_Label); -void Audition_SoundEvicted(U64 i_SoundId, U64 i_ForSound, S32 i_Reason); -void Audition_Control(U64 i_EventId, char const* i_Labels, U8 i_ControlType, U64 i_Filter); -void Audition_SoundBus(U64 i_SoundId, U8 i_BusIndex); - -void Audition_Error(U64 i_Id, char const* i_Details); - -void Audition_AsyncQueued(U64 i_RelevantId, S32 i_AsyncId, char const* i_Asset); -void Audition_AsyncLoad(S32 i_AsyncId, S32 i_ExpectedData); -void Audition_AsyncError(S32 i_AsyncId); -void Audition_AsyncComplete(S32 i_AsyncId, S32 i_DataLoaded); -void Audition_AsyncCancel(S32 i_AsyncId); -void Audition_ListenerPosition(float x, float y, float z); -void Audition_SoundPosition(U64 i_Sound, float x, float y, float z); -void Audition_SendCPU(HDIGDRIVER i_Driver); -void Audition_UpdateDataCount(S32 i_CurrentDataLoaded); -void Audition_SendCount(S32 i_SoundCount); -void Audition_HandleSystemLoad(S32 i_Avail, S32 i_Total); -void Audition_VarState(char const* i_Var, U64 i_SoundId, S32 i_Int, void* i_4ByteValue); -void Audition_RampState(char const* i_Ramp, U64 i_SoundId, S32 i_Type, float i_Current); -void Audition_SoundState(U64 i_SoundId, float i_FinalVol, float i_3DVol, float i_BlendVol, float i_BlendPitch, float i_RampVol, float i_RampWet, float i_RampLp, float i_RampRate); -void Audition_ClearState(); -void Audition_CompletionEvent(U64 i_CompletionEventId, U64 i_ParentSoundId); -void Audition_AddRamp(U64 i_ParentSoundId, S32 i_Type, char const* i_Name, char const* i_LabelQuery, U64 i_EventId); - -#if defined(IS_WIN32API) || defined(IS_WII) - #pragma pack(pop) -#endif -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/tmapi.h b/Minecraft.Client/Platform/Windows64/Miles/include/tmapi.h deleted file mode 100644 index 4ff673be0..000000000 --- a/Minecraft.Client/Platform/Windows64/Miles/include/tmapi.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once -// This is the null header file used to remove Telemetry calls. - -#define TMERR_DISABLED 1 - -#define tmTick(...) -#define tmPause(...) -#define tmEnter(...) -#define tmLeave(...) -#define tmThreadName(...) TMERR_DISABLED -#define tmMutexName(...) TMERR_DISABLED -#define tmTryLock(...) TMERR_DISABLED -#define tmEndTryLock(...) -#define tmSetMutexState(...) -#define tmAlloc(...) -#define tmRealloc(...) -#define tmFree(...) -#define tmPlot(...) -#define tmBlob(...) TMERR_DISABLED -#define tmBlobEx(...) TMERR_DISABLED -#define tmMessage(...) -#define tmEmitAccumulationZones(...) TMERR_DISABLED -#define tmEnterAccumulationZone(...) TMERR_DISABLED -#define tmLeaveAccumulationZone(...) TMERR_DISABLED -#define tmZone(...) -#define tmSetLockState(...) -#define tmLockName(...) -#define tmSendCallStack(...) -#define tmAllocEx(...) - -#define NTELEMETRY 1 - -#define TM_CONTEXT_LITE(val) ((char*)(val)) -#define TM_CONTEXT_FULL(val) ((char*)(val)) - -typedef char* HTELEMETRY; diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/aud32.lib b/Minecraft.Client/Platform/Windows64/Miles/lib/aud32.lib deleted file mode 100644 index 22381e183..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/aud32.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/mss32.lib b/Minecraft.Client/Platform/Windows64/Miles/lib/mss32.lib deleted file mode 100644 index a8f621135..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/mss32.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/mss32midi.lib b/Minecraft.Client/Platform/Windows64/Miles/lib/mss32midi.lib deleted file mode 100644 index 0c6552613..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/mss32midi.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/mss64.lib b/Minecraft.Client/Platform/Windows64/Miles/lib/mss64.lib deleted file mode 100644 index fa857a7a3..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/mss64.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/mss64midi.lib b/Minecraft.Client/Platform/Windows64/Miles/lib/mss64midi.lib deleted file mode 100644 index 693bcdb73..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/mss64midi.lib and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/binkawin64.asi b/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/binkawin64.asi deleted file mode 100644 index 4d1638575..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/binkawin64.asi and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64dolby.flt b/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64dolby.flt deleted file mode 100644 index 8ae0cd636..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64dolby.flt and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64ds3d.flt b/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64ds3d.flt deleted file mode 100644 index 878f85197..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64ds3d.flt and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64dsp.flt b/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64dsp.flt deleted file mode 100644 index bff22dfc4..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64dsp.flt and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64eax.flt b/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64eax.flt deleted file mode 100644 index cef72c1d4..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64eax.flt and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64srs.flt b/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64srs.flt deleted file mode 100644 index a0bf7d007..000000000 Binary files a/Minecraft.Client/Platform/Windows64/Miles/lib/redist64/mss64srs.flt and /dev/null differ diff --git a/Minecraft.Client/Platform/Windows64/Sentient/MinecraftTelemetry.h b/Minecraft.Client/Platform/Windows64/Sentient/MinecraftTelemetry.h deleted file mode 100644 index c5b92a321..000000000 --- a/Minecraft.Client/Platform/Windows64/Sentient/MinecraftTelemetry.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "SentientTelemetryCommon.h" -#include "TelemetryEnum.h" -#include "SentientStats.h" \ No newline at end of file diff --git a/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h b/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h deleted file mode 100644 index ab5b6bd48..000000000 --- a/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h +++ /dev/null @@ -1,159 +0,0 @@ -// 4J-PB - -// The ATG Framework is a common set of C++ class libraries that is used by the -// samples in the XDK, and was developed by the Advanced Technology Group (ATG). -// The ATG Framework offers a clean and consistent format for the samples. These -// classes define functions used by all the samples. The ATG Framework together -// with the samples demonstrates best practices and innovative techniques for -// Xbox 360. There are many useful sections of code in the samples. You are -// encouraged to incorporate this code into your titles. - -//------------------------------------------------------------------------------------- -// AtgXmlParser.h -// -// XMLParser and SAX interface declaration -// -// Xbox Advanced Technology Group -// Copyright (C) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------------------------------- - -#pragma once -#ifndef ATGXMLPARSER_H -#define ATGXMLPARSER_H - -namespace ATG { - -//----------------------------------------------------------------------------- -// error returns from XMLParse -//----------------------------------------------------------------------------- -#define _ATGFAC 0x61B -#define E_COULD_NOT_OPEN_FILE MAKE_HRESULT(1, _ATGFAC, 0x0001) -#define E_INVALID_XML_SYNTAX MAKE_HRESULT(1, _ATGFAC, 0x0002) - -const uint32_t XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; -const uint32_t XML_MAX_NAME_LENGTH = 128; -const uint32_t XML_READ_BUFFER_SIZE = 2048; -const uint32_t XML_WRITE_BUFFER_SIZE = 2048; - -// No tag can be longer than XML_WRITE_BUFFER_SIZE - an error will be returned -// if it is - -//------------------------------------------------------------------------------------- -struct XMLAttribute { - wchar_t* strName; - uint32_t NameLen; - wchar_t* strValue; - uint32_t ValueLen; -}; - -//------------------------------------------------------------------------------------- -class ISAXCallback { - friend class XMLParser; - -public: - ISAXCallback() {}; - virtual ~ISAXCallback() {}; - - virtual int32_t StartDocument() = 0; - virtual int32_t EndDocument() = 0; - - virtual int32_t ElementBegin(const wchar_t* strName, uint32_t NameLen, - const XMLAttribute* pAttributes, - uint32_t NumAttributes) = 0; - virtual int32_t ElementContent(const wchar_t* strData, uint32_t DataLen, - bool More) = 0; - virtual int32_t ElementEnd(const wchar_t* strName, uint32_t NameLen) = 0; - - virtual int32_t CDATABegin() = 0; - virtual int32_t CDATAData(const wchar_t* strCDATA, uint32_t CDATALen, - bool bMore) = 0; - virtual int32_t CDATAEnd() = 0; - - virtual void Error(int32_t hError, const char* strMessage) = 0; - - virtual void SetParseProgress(uint32_t dwProgress) {} - - const char* GetFilename() { return m_strFilename; } - uint32_t GetLineNumber() { return m_LineNum; } - uint32_t GetLinePosition() { return m_LinePos; } - -private: - const char* m_strFilename; - uint32_t m_LineNum; - uint32_t m_LinePos; -}; - -//------------------------------------------------------------------------------------- -class XMLParser { -public: - XMLParser(); - ~XMLParser(); - - // Register an interface inheiriting from ISAXCallback - void RegisterSAXCallbackInterface(ISAXCallback* pISAXCallback); - - // Get the registered interface - ISAXCallback* GetSAXCallbackInterface(); - - // ParseXMLFile returns one of the following: - // E_COULD_NOT_OPEN_FILE - couldn't open the file - // E_INVALID_XML_SYNTAX - bad XML syntax according to this parser - // E_NOINTERFACE - RegisterSAXCallbackInterface not called - // E_ABORT - callback returned a fail code - // S_OK - file parsed and completed - - int32_t ParseXMLFile(const char* strFilename); - - // Parses from a buffer- if you pass a wchar_t buffer (and cast it), it - // will - // correctly detect it and use unicode instead. Return codes are - // the same as for ParseXMLFile - - int32_t ParseXMLBuffer(const char* strBuffer, uint32_t uBufferSize); - -private: - int32_t MainParseLoop(); - - int32_t AdvanceCharacter(bool bOkToFail = false); - void SkipNextAdvance(); - - int32_t ConsumeSpace(); - int32_t ConvertEscape(); - int32_t AdvanceElement(); - int32_t AdvanceName(); - int32_t AdvanceAttrVal(); - int32_t AdvanceCDATA(); - int32_t AdvanceComment(); - - void FillBuffer(); - -#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation - void Error(int32_t hRet, - _In_z_ _Printf_format_string_ const char* strFormat, ...); -#else - void Error(int32_t hRet, const char* strFormat, ...); -#endif - - ISAXCallback* m_pISAXCallback; - - void* m_hFile; - const char* m_pInXMLBuffer; - uint32_t m_uInXMLBufferCharsLeft; - uint32_t m_dwCharsTotal; - uint32_t m_dwCharsConsumed; - - uint8_t m_pReadBuf[XML_READ_BUFFER_SIZE + 2]; // room for a trailing NULL - wchar_t m_pWriteBuf[XML_WRITE_BUFFER_SIZE]; - - uint8_t* m_pReadPtr; - wchar_t* m_pWritePtr; // write pointer within m_pBuf - - bool m_bUnicode; // true = 16-bits, false = 8-bits - bool m_bReverseBytes; // true = reverse bytes, false = don't reverse - - bool m_bSkipNextAdvance; - wchar_t m_Ch; // Current character being parsed -}; - -} // namespace ATG - -#endif diff --git a/Minecraft.Client/Platform/Windows64/Xbox_BuildVer.h b/Minecraft.Client/Platform/Windows64/Xbox_BuildVer.h deleted file mode 100644 index ed6c609a7..000000000 --- a/Minecraft.Client/Platform/Windows64/Xbox_BuildVer.h +++ /dev/null @@ -1,60 +0,0 @@ - -#pragma once - -#define VER_PRODUCTMAJORVERSION 0 -#define VER_PRODUCTMINORVERSION 0 -#define VER_PRODUCTBUILD 170 -#define VER_PRODUCTBUILD_QFE 0 - -#define VER_FILEVERSION_STRING "1.1" -#define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING -#define VER_FILEVERSION_STRING_W L"1.1" -#define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W - -#define VER_FILEBETA_STR "" -#undef VER_FILEVERSION -#define VER_FILEVERSION \ - VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, \ - VER_PRODUCTBUILD_QFE -#define VER_PRODUCTVERSION \ - VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, \ - VER_PRODUCTBUILD_QFE - -#if (VER_PRODUCTBUILD < 10) -#define VER_FILEBPAD "000" -#define VER_FILEBPAD_W L"000" -#elif (VER_PRODUCTBUILD < 100) -#define VER_FILEBPAD "00" -#define VER_FILEBPAD_W L"00" -#elif (VER_PRODUCTBUILD < 1000) -#define VER_FILEBPAD "0" -#define VER_FILEBPAD_W L"0" -#else -#define VER_FILEBPAD -#define VER_FILEBPAD_W -#endif - -#define VER_WIDE_PREFIX(x) L##x - -#define VER_FILEVERSION_STR2(x, y) \ - VER_FILEVERSION_STRING "." VER_FILEBPAD #x "." #y -#define VER_FILEVERSION_STR2_W(x, y) \ - VER_FILEVERSION_STRING_W L"." VER_FILEBPAD_W VER_WIDE_PREFIX( \ - #x) L"." VER_WIDE_PREFIX(#y) -#define VER_FILEVERSION_STR1(x, y) VER_FILEVERSION_STR2(x, y) -#define VER_FILEVERSION_STR1_W(x, y) VER_FILEVERSION_STR2_W(x, y) - -#undef VER_FILEVERSION_STR -#define VER_FILEVERSION_STR \ - VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) -#define VER_PRODUCTVERSION_STR \ - VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) - -#define VER_FILEVERSION_STR_W \ - VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) -#define VER_PRODUCTVERSION_STR_W \ - VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) - -#if (VER_PRODUCTBUILD_QFE >= 256) -#error "QFE number cannot exceed 255" -#endif diff --git a/Minecraft.Client/Platform/stdafx.h b/Minecraft.Client/Platform/stdafx.h deleted file mode 100644 index ab8d08080..000000000 --- a/Minecraft.Client/Platform/stdafx.h +++ /dev/null @@ -1,153 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -// #include -// #include - -#define __STR2__(x) #x -#define __STR1__(x) __STR2__(x) -#define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : 4J Warning Msg: " - -// use - #pragma message(__LOC__"Need to do something here") - -#include -#include -#include -#include -#include - -#ifdef __linux__ -#include "../Platform/Linux/Stubs/LinuxStubs.h" -#endif - -#ifdef _WINDOWS64 -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#include -#include -#include -#include -#include -using namespace DirectX; - -#define HRESULT_SUCCEEDED(hr) (((int32_t)(hr)) >= 0) -#endif - -#include "../../Minecraft.World/Platform/x64headers/extraX64.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "../../Minecraft.World/Util/Definitions.h" -#include "../../Minecraft.World/Util/Class.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" -#include "../../Minecraft.World/Util/SharedConstants.h" -#include "../../Minecraft.World/Util/Random.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" -#include "../../Minecraft.World/Util/PerformanceTimer.h" - -#ifdef _WINDOWS64 -#include "../Platform/Windows64/4JLibs/inc/4J_Input.h" -#include "../Platform/Windows64/4JLibs/inc/4J_Profile.h" -#include "../Platform/Windows64/4JLibs/inc/4J_Render.h" -#include "../Platform/Windows64/4JLibs/inc/4J_Storage.h" -#else -#include "4J_Input.h" -#include "4J_Profile.h" -#include "4J_Render.h" -#include "4J_Storage.h" -#endif - -#include "../Textures/Textures.h" -#include "../UI/Font.h" -#include "../ClientConstants.h" -#include "../UI/Gui.h" -#include "../UI/Screen.h" -#include "../UI/ScreenSizeCalculator.h" -#include "../Minecraft.h" -#include "../Utils/MemoryTracker.h" -#include "stubs.h" -#include "../Textures/BufferedImage.h" - -#include "../Platform/Common/Network/GameNetworkManager.h" - -#include "../Platform/Common/UI/UIEnums.h" -#include "../Platform/Common/UI/UIStructs.h" -#include "../Platform/Common/App_Defines.h" -#include "../Platform/Common/App_enums.h" -#include "../Platform/Common/Tutorial/TutorialEnum.h" -#include "../Platform/Common/App_structs.h" - -#include "../Platform/Common/Consoles_App.h" -#include "../Platform/Common/Minecraft_Macros.h" -#include "../Platform/Common/BuildVer.h" - -// This is generated at build time via scripts/pack_loc.py -#include "strings.h" - -#ifdef _WINDOWS64 -#include "../Platform/Windows64/Sentient/MinecraftTelemetry.h" -#include "../Platform/Windows64/Windows64_App.h" -#include "../Platform/Windows64/Sentient/DynamicConfigurations.h" -#include "../Platform/Windows64/Sentient/SentientTelemetryCommon.h" -#include "../Platform/Windows64/GameConfig/Minecraft.spa.h" -#include "../Platform/Windows64/XML/ATGXmlParser.h" -#include "../Platform/Windows64/Social/SocialManager.h" -#include "../Platform/Common/Audio/SoundEngine.h" -#include "../Platform/Windows64/Iggy/include/iggy.h" -#include "../Platform/Windows64/Iggy/gdraw/gdraw_d3d11.h" -#include "../Platform/Windows64/Windows64_UIController.h" -#else -// Linux build: keep the Linux runtime/controller path and use the supported -// Linux/Windows64 metadata headers only. -#include "../Platform/Linux/Linux_App.h" -#include "../Platform/Linux/Iggy/include/iggy.h" -#include "../Platform/Linux/Sentient/SentientTelemetryCommon.h" -#include "../Platform/Linux/Sentient/DynamicConfigurations.h" -#include "../Platform/Windows64/GameConfig/Minecraft.spa.h" -#include "../Platform/Common/Audio/SoundEngine.h" -#include "../Platform/Linux/Linux_UIController.h" -#include "../Platform/Linux/Social/SocialManager.h" -#endif - -#include "../Platform/Common/ConsoleGameMode.h" -#include "../Platform/Common/Console_Debug_enum.h" -#include "../Platform/Common/Console_Awards_enum.h" -#include "../Platform/Common/Tutorial/TutorialMode.h" -#include "../Platform/Common/Tutorial/Tutorial.h" -#include "../Platform/Common/Tutorial/FullTutorialMode.h" -#include "../Platform/Common/Trial/TrialMode.h" -#include "../Platform/Common/GameRules/ConsoleGameRules.h" -#include "../Platform/Common/GameRules/ConsoleSchematicFile.h" -#include "../Platform/Common/Colours/ColourTable.h" -#include "../Platform/Common/DLC/DLCSkinFile.h" -#include "../Platform/Common/DLC/DLCManager.h" -#include "../Platform/Common/DLC/DLCPack.h" -#include "../Platform/Common/Telemetry/TelemetryManager.h" - -#include "extraX64client.h" - -#ifdef _FINAL_BUILD -#define printf BREAKTHECOMPILE -#define wprintf BREAKTHECOMPILE -#undef OutputDebugString -#define OutputDebugString BREAKTHECOMPILE -#define OutputDebugStringA BREAKTHECOMPILE -#define OutputDebugStringW BREAKTHECOMPILE -#endif - -void MemSect(int sect); diff --git a/Minecraft.Client/Textures/BufferedImage.cpp b/Minecraft.Client/Source Files/BufferedImage.cpp similarity index 96% rename from Minecraft.Client/Textures/BufferedImage.cpp rename to Minecraft.Client/Source Files/BufferedImage.cpp index 8a624960d..cdfdcd314 100644 --- a/Minecraft.Client/Textures/BufferedImage.cpp +++ b/Minecraft.Client/Source Files/BufferedImage.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "Textures.h" -#include "../../Minecraft.World/Util/PathHelper.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" -#include "BufferedImage.h" +#include "../../Minecraft.World/Header Files/stdafx.h" +#include "../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../net/minecraft/client/renderer/Textures.h" +#include "../../Minecraft.World/Header Files/PathHelper.h" +#include "../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +#include "../Header Files/BufferedImage.h" #if defined(__linux__) #include #endif diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Source Files/Extrax64Stubs.cpp similarity index 98% rename from Minecraft.Client/Platform/Extrax64Stubs.cpp rename to Minecraft.Client/Source Files/Extrax64Stubs.cpp index 68656798a..a7108d5f8 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Source Files/Extrax64Stubs.cpp @@ -1,20 +1,20 @@ -#include "stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" // #include #if defined(_WINDOWS64) -#include "../Platform/Windows64/Sentient/SentientManager.h" -#include "../GameState/StatsCounter.h" -#include "../Platform/Windows64/Social/SocialManager.h" -#include "../Platform/Windows64/Sentient/DynamicConfigurations.h" +#include "../Windows64/Source Files/Sentient/SentientManager.h" +#include "../net/minecraft/stats/StatsCounter.h" +#include "../Windows64/Source Files/Social/SocialManager.h" +#include "../Windows64/Source Files/Sentient/DynamicConfigurations.h" #elif defined(__linux__) // On Linux, stdafx.h already provides Orbis-compatible Sentient/Dynamic headers // via #pragma once. Pull in SentientManager for CSentientManager class // declaration and StatsCounter; CSocialManager is provided as inline stubs via -// Platform/Linux/Social/SocialManager.h. -#include "../Platform/Linux/Sentient/SentientManager.h" -#include "../GameState/StatsCounter.h" +// Linux/Social/SocialManager.h. +#include "../Windows64/Source Files/Sentient/SentientManager.h" +#include "../net/minecraft/stats/StatsCounter.h" #else -#include "../GameState/StatsCounter.h" +#include "../net/minecraft/stats/StatsCounter.h" #endif #if defined(_WINDOWS64) diff --git a/Minecraft.Client/Utils/FrameProfiler.cpp b/Minecraft.Client/Source Files/FrameProfiler.cpp similarity index 98% rename from Minecraft.Client/Utils/FrameProfiler.cpp rename to Minecraft.Client/Source Files/FrameProfiler.cpp index fbaebbb1d..4883fa790 100644 --- a/Minecraft.Client/Utils/FrameProfiler.cpp +++ b/Minecraft.Client/Source Files/FrameProfiler.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "FrameProfiler.h" +#include "../../Minecraft.World/Header Files/stdafx.h" +#include "../Header Files/FrameProfiler.h" #ifdef ENABLE_FRAME_PROFILER diff --git a/Minecraft.Client/Rendering/glWrapper.cpp b/Minecraft.Client/Source Files/glWrapper.cpp similarity index 97% rename from Minecraft.Client/Rendering/glWrapper.cpp rename to Minecraft.Client/Source Files/glWrapper.cpp index f328063c9..30ff4db7d 100644 --- a/Minecraft.Client/Rendering/glWrapper.cpp +++ b/Minecraft.Client/Source Files/glWrapper.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" #if !defined(__linux__) -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/IO/Streams/ByteBuffer.h" +#include "../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" void glViewport(int x, int y, int w, int h) { // We don't really need anything here because minecraft doesn't current do diff --git a/Minecraft.Client/Platform/stdafx.cpp b/Minecraft.Client/Source Files/stdafx.cpp similarity index 83% rename from Minecraft.Client/Platform/stdafx.cpp rename to Minecraft.Client/Source Files/stdafx.cpp index 4fbe6db5e..bcf4779d8 100644 --- a/Minecraft.Client/Platform/stdafx.cpp +++ b/Minecraft.Client/Source Files/stdafx.cpp @@ -2,7 +2,7 @@ // Minecraft.Client.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information -#include "stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file diff --git a/Minecraft.Client/Platform/stubs.cpp b/Minecraft.Client/Source Files/stubs.cpp similarity index 95% rename from Minecraft.Client/Platform/stubs.cpp rename to Minecraft.Client/Source Files/stubs.cpp index ba7c2bd5c..6c607e5c5 100644 --- a/Minecraft.Client/Platform/stubs.cpp +++ b/Minecraft.Client/Source Files/stubs.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" #if defined(__linux__) diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10_shaders.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10_shaders.inl similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d10_shaders.inl rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d10_shaders.inl diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d11.cpp b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp similarity index 98% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d11.cpp rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp index d8655ff36..84a271182 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d11.cpp +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp @@ -1,4 +1,4 @@ -#include "../../../../../Minecraft.World/Platform/stdafx.h" // 4J +#include "../../../../Minecraft.World/Header Files/stdafx.h" // 4J // gdraw_d3d11.cpp - author: Fabian Giesen - copyright 2011 RAD Game Tools // diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d11.h b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d11.h rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.h diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shaders.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_gl_shaders.inl similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shaders.inl rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_gl_shaders.inl diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shared.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_gl_shared.inl similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shared.inl rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_gl_shared.inl diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_shared.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_shared.inl similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_shared.inl rename to Minecraft.Client/Windows64/Iggy/gdraw/gdraw_shared.inl diff --git a/Minecraft.Client/Platform/Linux/Iggy/include/gdraw.h b/Minecraft.Client/Windows64/Iggy/include/gdraw.h similarity index 99% rename from Minecraft.Client/Platform/Linux/Iggy/include/gdraw.h rename to Minecraft.Client/Windows64/Iggy/include/gdraw.h index 7ca675cdf..f7212e5db 100644 --- a/Minecraft.Client/Platform/Linux/Iggy/include/gdraw.h +++ b/Minecraft.Client/Windows64/Iggy/include/gdraw.h @@ -6,7 +6,7 @@ #ifndef __RAD_INCLUDE_GDRAW_H__ #define __RAD_INCLUDE_GDRAW_H__ -#include "../../../Windows64/Miles/include/rrcore.h" +#include "../../Miles Sound System/Include/rrcore.h" #define IDOC diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/iggy.h b/Minecraft.Client/Windows64/Iggy/include/iggy.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/include/iggy.h rename to Minecraft.Client/Windows64/Iggy/include/iggy.h diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/iggyexpruntime.h b/Minecraft.Client/Windows64/Iggy/include/iggyexpruntime.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/include/iggyexpruntime.h rename to Minecraft.Client/Windows64/Iggy/include/iggyexpruntime.h diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/iggyperfmon.h b/Minecraft.Client/Windows64/Iggy/include/iggyperfmon.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/include/iggyperfmon.h rename to Minecraft.Client/Windows64/Iggy/include/iggyperfmon.h diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h b/Minecraft.Client/Windows64/Iggy/include/rrCore.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h rename to Minecraft.Client/Windows64/Iggy/include/rrCore.h diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/mss.h b/Minecraft.Client/Windows64/Miles Sound System/Include/mss.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Miles/include/mss.h rename to Minecraft.Client/Windows64/Miles Sound System/Include/mss.h diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h b/Minecraft.Client/Windows64/Miles Sound System/Include/rrcore.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h rename to Minecraft.Client/Windows64/Miles Sound System/Include/rrcore.h diff --git a/Minecraft.Client/Platform/Windows64/Resource.h b/Minecraft.Client/Windows64/Resource.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Resource.h rename to Minecraft.Client/Windows64/Resource.h diff --git a/Minecraft.Client/Platform/Windows64/Leaderboards/WindowsLeaderboardManager.cpp b/Minecraft.Client/Windows64/Source Files/Leaderboards/WindowsLeaderboardManager.cpp similarity index 78% rename from Minecraft.Client/Platform/Windows64/Leaderboards/WindowsLeaderboardManager.cpp rename to Minecraft.Client/Windows64/Source Files/Leaderboards/WindowsLeaderboardManager.cpp index c317739f3..b6f2b7660 100644 --- a/Minecraft.Client/Platform/Windows64/Leaderboards/WindowsLeaderboardManager.cpp +++ b/Minecraft.Client/Windows64/Source Files/Leaderboards/WindowsLeaderboardManager.cpp @@ -1,4 +1,4 @@ -#include "../../../../Minecraft.World/Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "WindowsLeaderboardManager.h" diff --git a/Minecraft.Client/Platform/Windows64/Leaderboards/WindowsLeaderboardManager.h b/Minecraft.Client/Windows64/Source Files/Leaderboards/WindowsLeaderboardManager.h similarity index 95% rename from Minecraft.Client/Platform/Windows64/Leaderboards/WindowsLeaderboardManager.h rename to Minecraft.Client/Windows64/Source Files/Leaderboards/WindowsLeaderboardManager.h index a6e93e5ad..19653de2b 100644 --- a/Minecraft.Client/Platform/Windows64/Leaderboards/WindowsLeaderboardManager.h +++ b/Minecraft.Client/Windows64/Source Files/Leaderboards/WindowsLeaderboardManager.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Common/Leaderboards/LeaderboardManager.h" +#include "../../../Common/Source Files/Leaderboards/LeaderboardManager.h" class WindowsLeaderboardManager : public LeaderboardManager { public: diff --git a/Minecraft.Client/Platform/Windows64/Sentient/DynamicConfigurations.h b/Minecraft.Client/Windows64/Source Files/Sentient/DynamicConfigurations.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Sentient/DynamicConfigurations.h rename to Minecraft.Client/Windows64/Source Files/Sentient/DynamicConfigurations.h diff --git a/Minecraft.Client/Platform/Linux/Sentient/MinecraftTelemetry.h b/Minecraft.Client/Windows64/Source Files/Sentient/MinecraftTelemetry.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Sentient/MinecraftTelemetry.h rename to Minecraft.Client/Windows64/Source Files/Sentient/MinecraftTelemetry.h diff --git a/Minecraft.Client/Platform/Linux/Sentient/SentientManager.h b/Minecraft.Client/Windows64/Source Files/Sentient/SentientManager.h similarity index 100% rename from Minecraft.Client/Platform/Linux/Sentient/SentientManager.h rename to Minecraft.Client/Windows64/Source Files/Sentient/SentientManager.h diff --git a/Minecraft.Client/Platform/Windows64/Sentient/SentientStats.h b/Minecraft.Client/Windows64/Source Files/Sentient/SentientStats.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Sentient/SentientStats.h rename to Minecraft.Client/Windows64/Source Files/Sentient/SentientStats.h diff --git a/Minecraft.Client/Platform/Windows64/Sentient/SentientTelemetryCommon.h b/Minecraft.Client/Windows64/Source Files/Sentient/SentientTelemetryCommon.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Sentient/SentientTelemetryCommon.h rename to Minecraft.Client/Windows64/Source Files/Sentient/SentientTelemetryCommon.h diff --git a/Minecraft.Client/Platform/Windows64/Sentient/TelemetryEnum.h b/Minecraft.Client/Windows64/Source Files/Sentient/TelemetryEnum.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Sentient/TelemetryEnum.h rename to Minecraft.Client/Windows64/Source Files/Sentient/TelemetryEnum.h diff --git a/Minecraft.Client/Platform/Windows64/Social/SocialManager.h b/Minecraft.Client/Windows64/Source Files/Social/SocialManager.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Social/SocialManager.h rename to Minecraft.Client/Windows64/Source Files/Social/SocialManager.h diff --git a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp similarity index 96% rename from Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp rename to Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp index d0c2943ad..97e3ba640 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp @@ -1,41 +1,41 @@ // Minecraft.cpp : Defines the entry point for the application. // -#include "../../../Minecraft.World/Platform/stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #include #include -#include "GameConfig/Minecraft.spa.h" -#include "../../MinecraftServer.h" -#include "../../Player/LocalPlayer.h" -#include "../../../Minecraft.World/Items/ItemInstance.h" -#include "../../../Minecraft.World/Items/MapItem.h" -#include "../../../Minecraft.World/Recipes/Recipes.h" -#include "../../../Minecraft.World/Recipes/Recipy.h" -#include "../../../Minecraft.World/Util/Language.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Util/AABB.h" -#include "../../../Minecraft.World/Util/Vec3.h" -#include "../../../Minecraft.World/Level/Level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../Header Files/Minecraft.spa.h" +#include "../../net/minecraft/server/MinecraftServer.h" +#include "../../net/minecraft/client/player/LocalPlayer.h" +#include "../../../Minecraft.World/net/minecraft/world/item/ItemInstance.h" +#include "../../../Minecraft.World/net/minecraft/world/item/MapItem.h" +#include "../../../Minecraft.World/net/minecraft/world/item/crafting/Recipes.h" +#include "../../../Minecraft.World/net/minecraft/world/item/crafting/Recipy.h" +#include "../../../Minecraft.World/net/minecraft/locale/Language.h" +#include "../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" +#include "../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" -#include "../../Network/ClientConnection.h" -#include "../../Player/User.h" -#include "../../../Minecraft.World/Network/Socket.h" -#include "../../../Minecraft.World/Util/ThreadName.h" -#include "../../GameState/StatsCounter.h" -#include "../../UI/Screens/ConnectScreen.h" +#include "../../net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../net/minecraft/client/User.h" +#include "../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../Minecraft.World/ConsoleHelpers/ThreadName.h" +#include "../../net/minecraft/stats/StatsCounter.h" +#include "../../net/minecraft/client/multiplayer/ConnectScreen.h" // #include "Social/SocialManager.h" -// #include "../Common/Leaderboards/LeaderboardManager.h" +// #include "../../Common/Source Files/Leaderboards/LeaderboardManager.h" // #include "../Common/XUI/XUI_Scene_Container.h" // #include "NetworkManager.h" -#include "../../Rendering/Tesselator.h" -#include "../../GameState/Options.h" +#include "../../net/minecraft/client/renderer/Tesselator.h" +#include "../../net/minecraft/client/Options.h" #include "Sentient/SentientManager.h" -#include "../../Textures/Textures.h" -#include "Resource.h" -#include "../../../Minecraft.World/IO/Streams/Compression.h" -#include "../../../Minecraft.World/Level/Storage/OldChunkStorage.h" +#include "../../net/minecraft/client/renderer/Textures.h" +#include "../Resource.h" +#include "../../../Minecraft.World/Header Files/compression.h" +#include "../../../Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h" HINSTANCE hMyInst; LRESULT CALLBACK DlgProc(HWND hWndDlg, uint32_t Msg, WPARAM wParam, diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp similarity index 88% rename from Minecraft.Client/Platform/Windows64/Windows64_App.cpp rename to Minecraft.Client/Windows64/Windows64_App.cpp index c9371b695..18972b8e5 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -1,14 +1,14 @@ -#include "../../../Minecraft.World/Platform/stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" #include "../Common/Consoles_App.h" -#include "../../Player/User.h" -#include "../../Minecraft.h" -#include "../../MinecraftServer.h" -#include "../../Network/PlayerList.h" -#include "../../Player/ServerPlayer.h" -#include "../../../Minecraft.World/Level/Level.h" -#include "../../../Minecraft.World/Level/Storage/LevelSettings.h" -#include "../../../Minecraft.World/WorldGen/Biomes/BiomeSource.h" -#include "../../../Minecraft.World/Level/Storage/LevelType.h" +#include "../net/minecraft/client/User.h" +#include "../net/minecraft/client/Minecraft.h" +#include "../net/minecraft/server/MinecraftServer.h" +#include "../net/minecraft/server/PlayerList.h" +#include "../net/minecraft/server/level/ServerPlayer.h" +#include "../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../Minecraft.World/net/minecraft/world/level/LevelSettings.h" +#include "../../Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h" +#include "../../Minecraft.World/net/minecraft/world/level/LevelType.h" #include "Windows64_App.h" CConsoleMinecraftApp app; diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.h b/Minecraft.Client/Windows64/Windows64_App.h similarity index 100% rename from Minecraft.Client/Platform/Windows64/Windows64_App.h rename to Minecraft.Client/Windows64/Windows64_App.h diff --git a/Minecraft.Client/Platform/Windows64/Windows64_UIController.cpp b/Minecraft.Client/Windows64/Windows64_UIController.cpp similarity index 97% rename from Minecraft.Client/Platform/Windows64/Windows64_UIController.cpp rename to Minecraft.Client/Windows64/Windows64_UIController.cpp index cd5a5c24b..7aa1e414b 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_UIController.cpp +++ b/Minecraft.Client/Windows64/Windows64_UIController.cpp @@ -1,9 +1,9 @@ -#include "../../../Minecraft.World/Platform/stdafx.h" +#include "../../Minecraft.World/Header Files/stdafx.h" #include "Windows64_UIController.h" // Temp -#include "../../Minecraft.h" -#include "../../Textures/Textures.h" +#include "../net/minecraft/client/Minecraft.h" +#include "../net/minecraft/client/renderer/Textures.h" #define _ENABLEIGGY diff --git a/Minecraft.Client/Platform/Windows64/Windows64_UIController.h b/Minecraft.Client/Windows64/Windows64_UIController.h similarity index 95% rename from Minecraft.Client/Platform/Windows64/Windows64_UIController.h rename to Minecraft.Client/Windows64/Windows64_UIController.h index d574a4fa8..fec203922 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_UIController.h +++ b/Minecraft.Client/Windows64/Windows64_UIController.h @@ -1,6 +1,6 @@ #pragma once -#include "../Common/UI/UIController.h" +#include "../Common/Source Files/UI/UIController.h" class ConsoleUIController : public UIController { private: diff --git a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp b/Minecraft.Client/Windows64/XML/ATGXmlParser.cpp similarity index 99% rename from Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp rename to Minecraft.Client/Windows64/XML/ATGXmlParser.cpp index 6ee5dc9f1..ec633dccf 100644 --- a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Windows64/XML/ATGXmlParser.cpp @@ -16,7 +16,7 @@ // Copyright (C) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------------- -#include "../../../../Minecraft.World/Platform/stdafx.h" +#include "../../../Minecraft.World/Header Files/stdafx.h" #include "ATGXmlParser.h" #include diff --git a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.h b/Minecraft.Client/Windows64/XML/ATGXmlParser.h similarity index 100% rename from Minecraft.Client/Platform/Common/XML/ATGXmlParser.h rename to Minecraft.Client/Windows64/XML/ATGXmlParser.h diff --git a/Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h b/Minecraft.Client/Windows64/XML/xmlFilesCallback.h similarity index 100% rename from Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h rename to Minecraft.Client/Windows64/XML/xmlFilesCallback.h diff --git a/Minecraft.Client/Rendering/Camera.cpp b/Minecraft.Client/net/minecraft/client/Camera.cpp similarity index 88% rename from Minecraft.Client/Rendering/Camera.cpp rename to Minecraft.Client/net/minecraft/client/Camera.cpp index f95c729b4..a12084949 100644 --- a/Minecraft.Client/Rendering/Camera.cpp +++ b/Minecraft.Client/net/minecraft/client/Camera.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Camera.h" -#include "../Utils/MemoryTracker.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Level/TilePos.h" +#include "MemoryTracker.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/TilePos.h" float Camera::xPlayerOffs = 0.0f; float Camera::yPlayerOffs = 0.0f; diff --git a/Minecraft.Client/Rendering/Camera.h b/Minecraft.Client/net/minecraft/client/Camera.h similarity index 85% rename from Minecraft.Client/Rendering/Camera.h rename to Minecraft.Client/net/minecraft/client/Camera.h index 894a01967..3b3a4b088 100644 --- a/Minecraft.Client/Rendering/Camera.h +++ b/Minecraft.Client/net/minecraft/client/Camera.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" class TilePos; class Vec3; diff --git a/Minecraft.Client/ClientConstants.cpp b/Minecraft.Client/net/minecraft/client/ClientConstants.cpp similarity index 78% rename from Minecraft.Client/ClientConstants.cpp rename to Minecraft.Client/net/minecraft/client/ClientConstants.cpp index b4a495c15..2892e33f8 100644 --- a/Minecraft.Client/ClientConstants.cpp +++ b/Minecraft.Client/net/minecraft/client/ClientConstants.cpp @@ -1,4 +1,4 @@ -#include "Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "ClientConstants.h" const std::wstring ClientConstants::VERSION_STRING = diff --git a/Minecraft.Client/ClientConstants.h b/Minecraft.Client/net/minecraft/client/ClientConstants.h similarity index 100% rename from Minecraft.Client/ClientConstants.h rename to Minecraft.Client/net/minecraft/client/ClientConstants.h diff --git a/Minecraft.Client/GameState/DemoUser.cpp b/Minecraft.Client/net/minecraft/client/DemoUser.cpp similarity index 54% rename from Minecraft.Client/GameState/DemoUser.cpp rename to Minecraft.Client/net/minecraft/client/DemoUser.cpp index b38394972..daeb39fae 100644 --- a/Minecraft.Client/GameState/DemoUser.cpp +++ b/Minecraft.Client/net/minecraft/client/DemoUser.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "DemoUser.h" DemoUser::DemoUser() : User(L"DemoUser", L"n/a") {} \ No newline at end of file diff --git a/Minecraft.Client/GameState/DemoUser.h b/Minecraft.Client/net/minecraft/client/DemoUser.h similarity index 71% rename from Minecraft.Client/GameState/DemoUser.h rename to Minecraft.Client/net/minecraft/client/DemoUser.h index 6a3818904..c48893749 100644 --- a/Minecraft.Client/GameState/DemoUser.h +++ b/Minecraft.Client/net/minecraft/client/DemoUser.h @@ -1,5 +1,5 @@ #pragma once -#include "../Player/User.h" +#include "User.h" class DemoUser : public User { public: diff --git a/Minecraft.Client/UI/GuiMessage.cpp b/Minecraft.Client/net/minecraft/client/GuiMessage.cpp similarity index 66% rename from Minecraft.Client/UI/GuiMessage.cpp rename to Minecraft.Client/net/minecraft/client/GuiMessage.cpp index 961c9e04b..4cd5e54b0 100644 --- a/Minecraft.Client/UI/GuiMessage.cpp +++ b/Minecraft.Client/net/minecraft/client/GuiMessage.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "GuiMessage.h" GuiMessage::GuiMessage(const std::wstring& string) { diff --git a/Minecraft.Client/UI/GuiMessage.h b/Minecraft.Client/net/minecraft/client/GuiMessage.h similarity index 100% rename from Minecraft.Client/UI/GuiMessage.h rename to Minecraft.Client/net/minecraft/client/GuiMessage.h diff --git a/Minecraft.Client/Input/KeyMapping.cpp b/Minecraft.Client/net/minecraft/client/KeyMapping.cpp similarity index 68% rename from Minecraft.Client/Input/KeyMapping.cpp rename to Minecraft.Client/net/minecraft/client/KeyMapping.cpp index c439bde54..cc366a1a4 100644 --- a/Minecraft.Client/Input/KeyMapping.cpp +++ b/Minecraft.Client/net/minecraft/client/KeyMapping.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "KeyMapping.h" KeyMapping::KeyMapping(const std::wstring& name, int key) { diff --git a/Minecraft.Client/Input/KeyMapping.h b/Minecraft.Client/net/minecraft/client/KeyMapping.h similarity index 100% rename from Minecraft.Client/Input/KeyMapping.h rename to Minecraft.Client/net/minecraft/client/KeyMapping.h diff --git a/Minecraft.Client/Rendering/Lighting.cpp b/Minecraft.Client/net/minecraft/client/Lighting.cpp similarity index 89% rename from Minecraft.Client/Rendering/Lighting.cpp rename to Minecraft.Client/net/minecraft/client/Lighting.cpp index 4182a9fe3..6a7ca71a5 100644 --- a/Minecraft.Client/Rendering/Lighting.cpp +++ b/Minecraft.Client/net/minecraft/client/Lighting.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Lighting.h" -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" -#include "../../Minecraft.World/Util/Vec3.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" FloatBuffer* Lighting::lb = new FloatBuffer(16); diff --git a/Minecraft.Client/Rendering/Lighting.h b/Minecraft.Client/net/minecraft/client/Lighting.h similarity index 100% rename from Minecraft.Client/Rendering/Lighting.h rename to Minecraft.Client/net/minecraft/client/Lighting.h diff --git a/Minecraft.Client/Utils/MemoryTracker.cpp b/Minecraft.Client/net/minecraft/client/MemoryTracker.cpp similarity index 84% rename from Minecraft.Client/Utils/MemoryTracker.cpp rename to Minecraft.Client/net/minecraft/client/MemoryTracker.cpp index 918ab9338..2613bd462 100644 --- a/Minecraft.Client/Utils/MemoryTracker.cpp +++ b/Minecraft.Client/net/minecraft/client/MemoryTracker.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "MemoryTracker.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/IO/Streams/ByteBuffer.h" -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" std::unordered_map MemoryTracker::GL_LIST_IDS; std::vector MemoryTracker::TEXTURE_IDS; diff --git a/Minecraft.Client/Utils/MemoryTracker.h b/Minecraft.Client/net/minecraft/client/MemoryTracker.h similarity index 100% rename from Minecraft.Client/Utils/MemoryTracker.h rename to Minecraft.Client/net/minecraft/client/MemoryTracker.h diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/net/minecraft/client/Minecraft.cpp similarity index 97% rename from Minecraft.Client/Minecraft.cpp rename to Minecraft.Client/net/minecraft/client/Minecraft.cpp index 2305f0ed9..b3e7353c8 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/net/minecraft/client/Minecraft.cpp @@ -1,77 +1,77 @@ #include #include -#include "Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Minecraft.h" -#include "GameState/GameMode.h" -#include "UI/Screens/PauseScreen.h" -#include "Utils/Timer.h" -#include "Rendering/EntityRenderers/ProgressRenderer.h" -#include "Rendering/LevelRenderer.h" -#include "Rendering/Particles/ParticleEngine.h" -#include "Player/MultiPlayerLocalPlayer.h" -#include "Player/User.h" -#include "Textures/Textures.h" -#include "Rendering/GameRenderer.h" -#include "Rendering/Models/HumanoidModel.h" -#include "GameState/Options.h" -#include "Textures/Packs/TexturePackRepository.h" -#include "GameState/StatsCounter.h" -#include "Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "Rendering/EntityRenderers/TileEntityRenderDispatcher.h" -#include "GameState/SurvivalMode.h" -#include "Rendering/Chunk.h" -#include "GameState/CreativeMode.h" -#include "Level/DemoLevel.h" -#include "Level/MultiPlayerLevel.h" -#include "Player/MultiPlayerLocalPlayer.h" -#include "GameState/DemoUser.h" -#include "Rendering/Particles/GuiParticles.h" -#include "UI/Screen.h" -#include "UI/Screens/DeathScreen.h" -#include "UI/Screens/ErrorScreen.h" -#include "UI/Screens/TitleScreen.h" -#include "UI/Screens/InventoryScreen.h" +#include "../server/level/GameMode.h" +#include "gui/PauseScreen.h" +#include "Timer.h" +#include "ProgressRenderer.h" +#include "renderer/LevelRenderer.h" +#include "particle/ParticleEngine.h" +#include "multiplayer/MultiPlayerLocalPlayer.h" +#include "User.h" +#include "renderer/Textures.h" +#include "renderer/GameRenderer.h" +#include "model/HumanoidModel.h" +#include "Options.h" +#include "skins/TexturePackRepository.h" +#include "../stats/StatsCounter.h" +#include "renderer/entity/EntityRenderDispatcher.h" +#include "renderer/tileentity/TileEntityRenderDispatcher.h" +#include "../server/level/SurvivalMode.h" +#include "renderer/Chunk.h" +#include "../server/level/CreativeMode.h" +#include "level/DemoLevel.h" +#include "multiplayer/MultiPlayerLevel.h" +#include "multiplayer/MultiPlayerLocalPlayer.h" +#include "DemoUser.h" +#include "gui/particle/GuiParticles.h" +#include "gui/Screen.h" +#include "gui/DeathScreen.h" +#include "gui/ErrorScreen.h" +#include "title/TitleScreen.h" +#include "gui/inventory/InventoryScreen.h" #if defined(ENABLE_JAVA_GUIS) -#include "UI/Screens/CreativeInventoryScreen.h" +#include "gui/inventory/CreativeInventoryScreen.h" #endif -#include "UI/Screens/InBedChatScreen.h" -#include "UI/Screens/AchievementPopup.h" -#include "Input/Input.h" -#include "Rendering/FrustumCuller.h" -#include "Rendering/Camera.h" +#include "gui/InBedChatScreen.h" +#include "gui/achievement/AchievementPopup.h" +#include "player/Input.h" +#include "renderer/culling/FrustumCuller.h" +#include "Camera.h" -#include "../Minecraft.World/Entities/MobEffect.h" -#include "../Minecraft.World/Util/Difficulty.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../Minecraft.World/IO/Files/File.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../Minecraft.World/Headers/net.minecraft.h" -#include "../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../Minecraft.World/Platform/System.h" -#include "../Minecraft.World/IO/Streams/ByteBuffer.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../Minecraft.World/Platform/Minecraft.World.h" -#include "Network/ClientConnection.h" -#include "../Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../Minecraft.World/WorldGen/Features/StrongholdFeature.h" -#include "../Minecraft.World/Entities/Mobs/Villager.h" -#include "../Minecraft.World/Level/Storage/SparseLightStorage.h" -#include "../Minecraft.World/Level/Storage/SparseDataStorage.h" -#include "../Minecraft.World/Blocks/TileEntities/ChestTileEntity.h" -#include "Textures/TextureManager.h" -#include "Platform/Common/UI/IUIScene_CreativeMenu.h" -#include "Platform/Common/UI/UIFontData.h" -#include "Textures/Packs/DLCTexturePack.h" +#include "../../../../Minecraft.World/net/minecraft/world/effect/MobEffect.h" +#include "../../../../Minecraft.World/net/minecraft/world/Difficulty.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/Header Files/Minecraft.World.h" +#include "multiplayer/ClientConnection.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/npc/Villager.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h" +#include "renderer/texture/TextureManager.h" +#include "../../../Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.h" +#include "../../../Common/Source Files/UI/UIFontData.h" +#include "skins/DLCTexturePack.h" // #define DISABLE_SPU_CODE // 4J Turning this on will change the graph at the bottom of the debug overlay diff --git a/Minecraft.Client/Minecraft.h b/Minecraft.Client/net/minecraft/client/Minecraft.h similarity index 97% rename from Minecraft.Client/Minecraft.h rename to Minecraft.Client/net/minecraft/client/Minecraft.h index 751fec019..0dd991155 100644 --- a/Minecraft.Client/Minecraft.h +++ b/Minecraft.Client/net/minecraft/client/Minecraft.h @@ -37,10 +37,10 @@ class ItemInHandRenderer; class LevelSettings; class ColourTable; class MultiPlayerGameMode; -#include "../Minecraft.World/IO/Files/File.h" -#include "../Minecraft.World/Network/Packets/DisconnectPacket.h" -#include "../Minecraft.World/Util/C4JThread.h" -#include "Textures/ResourceLocation.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h" +#include "../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" +#include "resources/ResourceLocation.h" #if defined(linux) #undef linux diff --git a/Minecraft.Client/GameState/Options.cpp b/Minecraft.Client/net/minecraft/client/Options.cpp similarity index 94% rename from Minecraft.Client/GameState/Options.cpp rename to Minecraft.Client/net/minecraft/client/Options.cpp index 082afb702..db33cea89 100644 --- a/Minecraft.Client/GameState/Options.cpp +++ b/Minecraft.Client/net/minecraft/client/Options.cpp @@ -1,18 +1,18 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Options.h" -#include "../Input/KeyMapping.h" -#include "../Rendering/LevelRenderer.h" -#include "../Textures/Textures.h" -#include "../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../Minecraft.World/Util/Language.h" -#include "../../Minecraft.World/IO/Files/File.h" -#include "../../Minecraft.World/IO/Streams/BufferedReader.h" -#include "../../Minecraft.World/IO/Streams/DataInputStream.h" -#include "../../Minecraft.World/IO/Streams/InputStreamReader.h" -#include "../../Minecraft.World/IO/Files/FileInputStream.h" -#include "../../Minecraft.World/IO/Files/FileOutputStream.h" -#include "../../Minecraft.World/IO/Streams/DataOutputStream.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "KeyMapping.h" +#include "renderer/LevelRenderer.h" +#include "renderer/Textures.h" +#include "../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../Minecraft.World/net/minecraft/locale/Language.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" // 4J - the Option sub-class used to be an java enumerated type, trying to // emulate that functionality here diff --git a/Minecraft.Client/GameState/Options.h b/Minecraft.Client/net/minecraft/client/Options.h similarity index 98% rename from Minecraft.Client/GameState/Options.h rename to Minecraft.Client/net/minecraft/client/Options.h index b727da4a0..56e70004c 100644 --- a/Minecraft.Client/GameState/Options.h +++ b/Minecraft.Client/net/minecraft/client/Options.h @@ -2,7 +2,7 @@ class Minecraft; class KeyMapping; -#include "../../Minecraft.World/IO/Files/File.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/File.h" class Options { public: diff --git a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp b/Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp similarity index 94% rename from Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp rename to Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp index 68ed3dbad..abe1b3fd6 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../Tesselator.h" -#include "../../Textures/Textures.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "renderer/Tesselator.h" +#include "renderer/Textures.h" #include "ProgressRenderer.h" -#include "../../../Minecraft.World/Platform/System.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/System.h" std::recursive_mutex ProgressRenderer::s_progress; diff --git a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h b/Minecraft.Client/net/minecraft/client/ProgressRenderer.h similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h rename to Minecraft.Client/net/minecraft/client/ProgressRenderer.h index 5de0a6c95..65d6d6390 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h +++ b/Minecraft.Client/net/minecraft/client/ProgressRenderer.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../../../Minecraft.World/Util/ProgressListener.h" +#include "../../../../Minecraft.World/net/minecraft/util/ProgressListener.h" class ProgressRenderer : public ProgressListener { public: diff --git a/Minecraft.Client/Utils/Timer.cpp b/Minecraft.Client/net/minecraft/client/Timer.cpp similarity index 96% rename from Minecraft.Client/Utils/Timer.cpp rename to Minecraft.Client/net/minecraft/client/Timer.cpp index ef654c8ed..8784f8206 100644 --- a/Minecraft.Client/Utils/Timer.cpp +++ b/Minecraft.Client/net/minecraft/client/Timer.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Timer.h" -#include "../../Minecraft.World/Platform/System.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/System.h" Timer::Timer(float ticksPerSecond) { // 4J - added initialisers diff --git a/Minecraft.Client/Utils/Timer.h b/Minecraft.Client/net/minecraft/client/Timer.h similarity index 100% rename from Minecraft.Client/Utils/Timer.h rename to Minecraft.Client/net/minecraft/client/Timer.h diff --git a/Minecraft.Client/Player/User.cpp b/Minecraft.Client/net/minecraft/client/User.cpp similarity index 89% rename from Minecraft.Client/Player/User.cpp rename to Minecraft.Client/net/minecraft/client/User.cpp index 6d0c21bfd..e86d6dc03 100644 --- a/Minecraft.Client/Player/User.cpp +++ b/Minecraft.Client/net/minecraft/client/User.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "User.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" std::vector User::allowedTiles; diff --git a/Minecraft.Client/Player/User.h b/Minecraft.Client/net/minecraft/client/User.h similarity index 100% rename from Minecraft.Client/Player/User.h rename to Minecraft.Client/net/minecraft/client/User.h diff --git a/Minecraft.Client/UI/Button.cpp b/Minecraft.Client/net/minecraft/client/gui/Button.cpp similarity index 95% rename from Minecraft.Client/UI/Button.cpp rename to Minecraft.Client/net/minecraft/client/gui/Button.cpp index ced455e3b..1b2347301 100644 --- a/Minecraft.Client/UI/Button.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/Button.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Button.h" -#include "../Textures/Textures.h" +#include "../renderer/Textures.h" #ifdef ENABLE_JAVA_GUIS ResourceLocation GUI_GUI_LOCATION = ResourceLocation(TN_GUI_GUI); diff --git a/Minecraft.Client/UI/Button.h b/Minecraft.Client/net/minecraft/client/gui/Button.h similarity index 100% rename from Minecraft.Client/UI/Button.h rename to Minecraft.Client/net/minecraft/client/gui/Button.h diff --git a/Minecraft.Client/UI/Screens/ChatScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/ChatScreen.cpp similarity index 88% rename from Minecraft.Client/UI/Screens/ChatScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/ChatScreen.cpp index 35e3cf6f9..7f0f9f75b 100644 --- a/Minecraft.Client/UI/Screens/ChatScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/ChatScreen.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ChatScreen.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Util/SharedConstants.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" const std::wstring ChatScreen::allowedChars = SharedConstants::acceptableLetters; diff --git a/Minecraft.Client/UI/Screens/ChatScreen.h b/Minecraft.Client/net/minecraft/client/gui/ChatScreen.h similarity index 95% rename from Minecraft.Client/UI/Screens/ChatScreen.h rename to Minecraft.Client/net/minecraft/client/gui/ChatScreen.h index ce20f5a62..3be4521f7 100644 --- a/Minecraft.Client/UI/Screens/ChatScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/ChatScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class ChatScreen : public Screen { protected: diff --git a/Minecraft.Client/UI/Screens/ConfirmScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/ConfirmScreen.cpp similarity index 90% rename from Minecraft.Client/UI/Screens/ConfirmScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/ConfirmScreen.cpp index 17133b288..0052f0dcc 100644 --- a/Minecraft.Client/UI/Screens/ConfirmScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/ConfirmScreen.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ConfirmScreen.h" -#include "../SmallButton.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "SmallButton.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" ConfirmScreen::ConfirmScreen(Screen* parent, const std::wstring& title1, const std::wstring& title2, int id) { diff --git a/Minecraft.Client/UI/Screens/ConfirmScreen.h b/Minecraft.Client/net/minecraft/client/gui/ConfirmScreen.h similarity index 96% rename from Minecraft.Client/UI/Screens/ConfirmScreen.h rename to Minecraft.Client/net/minecraft/client/gui/ConfirmScreen.h index d400c70cd..5933ff0e4 100644 --- a/Minecraft.Client/UI/Screens/ConfirmScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/ConfirmScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class ConfirmScreen : public Screen { private: diff --git a/Minecraft.Client/UI/Screens/ControlsScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/ControlsScreen.cpp similarity index 91% rename from Minecraft.Client/UI/Screens/ControlsScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/ControlsScreen.cpp index 908fcff1f..6516ebea8 100644 --- a/Minecraft.Client/UI/Screens/ControlsScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/ControlsScreen.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ControlsScreen.h" -#include "../../GameState/Options.h" -#include "../SmallButton.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "../Options.h" +#include "SmallButton.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" ControlsScreen::ControlsScreen(Screen* lastScreen, Options* options) { // 4J - added initialisers diff --git a/Minecraft.Client/UI/Screens/ControlsScreen.h b/Minecraft.Client/net/minecraft/client/gui/ControlsScreen.h similarity index 96% rename from Minecraft.Client/UI/Screens/ControlsScreen.h rename to Minecraft.Client/net/minecraft/client/gui/ControlsScreen.h index 3132fb451..4055c2f42 100644 --- a/Minecraft.Client/UI/Screens/ControlsScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/ControlsScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class Options; diff --git a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp similarity index 95% rename from Minecraft.Client/UI/Screens/CreateWorldScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp index 4270190c2..f3d848c3c 100644 --- a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "CreateWorldScreen.h" -#include "../EditBox.h" -#include "../Button.h" -#include "../../GameState/SurvivalMode.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../../Minecraft.World/Util/SharedConstants.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../MinecraftServer.h" -#include "../../GameState/Options.h" +#include "EditBox.h" +#include "Button.h" +#include "../../server/level/SurvivalMode.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../server/MinecraftServer.h" +#include "../Options.h" #include "MessageScreen.h" #include diff --git a/Minecraft.Client/UI/Screens/CreateWorldScreen.h b/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.h similarity index 98% rename from Minecraft.Client/UI/Screens/CreateWorldScreen.h rename to Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.h index ba38b2ec3..704df772e 100644 --- a/Minecraft.Client/UI/Screens/CreateWorldScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class EditBox; class LevelStorageSource; diff --git a/Minecraft.Client/UI/Screens/DeathScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/DeathScreen.cpp similarity index 87% rename from Minecraft.Client/UI/Screens/DeathScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/DeathScreen.cpp index c4765fcad..70d62fd97 100644 --- a/Minecraft.Client/UI/Screens/DeathScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/DeathScreen.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "DeathScreen.h" -#include "../Button.h" -#include "../../Player/MultiPlayerLocalPlayer.h" +#include "Button.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" #include "PauseScreen.h" -#include "TitleScreen.h" +#include "../title/TitleScreen.h" void DeathScreen::init() { buttons.clear(); diff --git a/Minecraft.Client/UI/Screens/DeathScreen.h b/Minecraft.Client/net/minecraft/client/gui/DeathScreen.h similarity index 93% rename from Minecraft.Client/UI/Screens/DeathScreen.h rename to Minecraft.Client/net/minecraft/client/gui/DeathScreen.h index 382f0e5b6..96e0d6260 100644 --- a/Minecraft.Client/UI/Screens/DeathScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/DeathScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class DeathScreen : public Screen { public: diff --git a/Minecraft.Client/UI/EditBox.cpp b/Minecraft.Client/net/minecraft/client/gui/EditBox.cpp similarity index 95% rename from Minecraft.Client/UI/EditBox.cpp rename to Minecraft.Client/net/minecraft/client/gui/EditBox.cpp index da48457e7..9b30e79a8 100644 --- a/Minecraft.Client/UI/EditBox.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/EditBox.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "EditBox.h" -#include "../../Minecraft.World/Util/SharedConstants.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" EditBox::EditBox(Screen* screen, Font* font, int x, int y, int width, int height, const std::wstring& value) { diff --git a/Minecraft.Client/UI/EditBox.h b/Minecraft.Client/net/minecraft/client/gui/EditBox.h similarity index 100% rename from Minecraft.Client/UI/EditBox.h rename to Minecraft.Client/net/minecraft/client/gui/EditBox.h diff --git a/Minecraft.Client/UI/Screens/EnchantmentScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/EnchantmentScreen.cpp similarity index 95% rename from Minecraft.Client/UI/Screens/EnchantmentScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/EnchantmentScreen.cpp index 24d239382..04bc6285a 100644 --- a/Minecraft.Client/UI/Screens/EnchantmentScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/EnchantmentScreen.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "EnchantmentScreen.h" #include #include #include #include -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/EnchantmentMenu.h" -#include "../../../Minecraft.World/Containers/Slot.h" -#include "../../Rendering/Models/BookModel.h" -#include "../../../Minecraft.Client/Minecraft.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../Lighting.h" +#include "../renderer/Textures.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/Slot.h" +#include "../model/BookModel.h" +#include "../Minecraft.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // container classes (and iggy too) diff --git a/Minecraft.Client/UI/Screens/EnchantmentScreen.h b/Minecraft.Client/net/minecraft/client/gui/EnchantmentScreen.h similarity index 89% rename from Minecraft.Client/UI/Screens/EnchantmentScreen.h rename to Minecraft.Client/net/minecraft/client/gui/EnchantmentScreen.h index 96a7a6af6..8d9f87859 100644 --- a/Minecraft.Client/UI/Screens/EnchantmentScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/EnchantmentScreen.h @@ -1,7 +1,7 @@ #pragma once -#include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Containers/EnchantmentMenu.h" +#include "inventory/AbstractContainerScreen.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h" class EnchantmentScreen : public AbstractContainerScreen { public: diff --git a/Minecraft.Client/UI/Screens/ErrorScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/ErrorScreen.cpp similarity index 90% rename from Minecraft.Client/UI/Screens/ErrorScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/ErrorScreen.cpp index 19e0542fb..241faa634 100644 --- a/Minecraft.Client/UI/Screens/ErrorScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/ErrorScreen.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ErrorScreen.h" ErrorScreen::ErrorScreen(const std::wstring& title, diff --git a/Minecraft.Client/UI/Screens/ErrorScreen.h b/Minecraft.Client/net/minecraft/client/gui/ErrorScreen.h similarity index 93% rename from Minecraft.Client/UI/Screens/ErrorScreen.h rename to Minecraft.Client/net/minecraft/client/gui/ErrorScreen.h index 4c46d36ff..b65f921b4 100644 --- a/Minecraft.Client/UI/Screens/ErrorScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/ErrorScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class ErrorScreen : public Screen { private: diff --git a/Minecraft.Client/UI/Font.cpp b/Minecraft.Client/net/minecraft/client/gui/Font.cpp similarity index 97% rename from Minecraft.Client/UI/Font.cpp rename to Minecraft.Client/net/minecraft/client/gui/Font.cpp index 9971cec29..69d1c2714 100644 --- a/Minecraft.Client/UI/Font.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/Font.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Textures/Textures.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../renderer/Textures.h" #include "Font.h" -#include "../GameState/Options.h" -#include "../Rendering/Tesselator.h" -#include "../Textures/ResourceLocation.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/Headers/net.minecraft.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Util/Random.h" +#include "../Options.h" +#include "../renderer/Tesselator.h" +#include "../resources/ResourceLocation.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" Font::Font(Options* options, const std::wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation* textureLocation, int cols, diff --git a/Minecraft.Client/UI/Font.h b/Minecraft.Client/net/minecraft/client/gui/Font.h similarity index 100% rename from Minecraft.Client/UI/Font.h rename to Minecraft.Client/net/minecraft/client/gui/Font.h diff --git a/Minecraft.Client/UI/Gui.cpp b/Minecraft.Client/net/minecraft/client/gui/Gui.cpp similarity index 96% rename from Minecraft.Client/UI/Gui.cpp rename to Minecraft.Client/net/minecraft/client/gui/Gui.cpp index e5ec7ca2b..1a03c3d30 100644 --- a/Minecraft.Client/UI/Gui.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/Gui.cpp @@ -1,35 +1,35 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Gui.h" -#include "../Rendering/EntityRenderers/ItemRenderer.h" -#include "../Rendering/GameRenderer.h" -#include "../GameState/Options.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "../Textures/Textures.h" -#include "../Textures/TextureAtlas.h" -#include "../GameState/GameMode.h" -#include "../Rendering/Lighting.h" -#include "Screens/ChatScreen.h" -#include "../Level/MultiPlayerLevel.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.food.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Level/LevelData.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Platform/System.h" -#include "../../Minecraft.World/Util/Language.h" -#include "../Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Minecraft.World/Level/Dimensions/Dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../Rendering/EntityRenderers/EnderDragonRenderer.h" -#include "../../Minecraft.World/Headers/net.minecraft.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../Minecraft.World/Level/LevelChunk.h" -#include "../../Minecraft.World/WorldGen/Biomes/Biome.h" -#include "../../Minecraft.World/Entities/Mobs/SharedMonsterAttributes.h" -#include "../../Minecraft.World/AI/Attributes/AttributeInstance.h" +#include "../renderer/entity/ItemRenderer.h" +#include "../renderer/GameRenderer.h" +#include "../Options.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../renderer/Textures.h" +#include "../renderer/texture/TextureAtlas.h" +#include "../../server/level/GameMode.h" +#include "../Lighting.h" +#include "ChatScreen.h" +#include "../multiplayer/MultiPlayerLevel.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/Language.h" +#include "../renderer/entity/EntityRenderDispatcher.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/Dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../renderer/entity/EnderDragonRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/biome/Biome.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/SharedMonsterAttributes.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeInstance.h" ResourceLocation Gui::PUMPKIN_BLUR_LOCATION = ResourceLocation(TN__BLUR__MISC_PUMPKINBLUR); diff --git a/Minecraft.Client/UI/Gui.h b/Minecraft.Client/net/minecraft/client/gui/Gui.h similarity index 96% rename from Minecraft.Client/UI/Gui.h rename to Minecraft.Client/net/minecraft/client/gui/Gui.h index 1fb274e00..a5570110e 100644 --- a/Minecraft.Client/UI/Gui.h +++ b/Minecraft.Client/net/minecraft/client/gui/Gui.h @@ -1,8 +1,8 @@ #pragma once #include #include "GuiComponent.h" -#include "GuiMessage.h" -#include "../../../Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h" +#include "../GuiMessage.h" +#include "../renderer/entity/ItemRenderer.h" class Random; class Minecraft; diff --git a/Minecraft.Client/UI/GuiComponent.cpp b/Minecraft.Client/net/minecraft/client/gui/GuiComponent.cpp similarity index 98% rename from Minecraft.Client/UI/GuiComponent.cpp rename to Minecraft.Client/net/minecraft/client/gui/GuiComponent.cpp index d9149f2c8..391b062c3 100644 --- a/Minecraft.Client/UI/GuiComponent.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/GuiComponent.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "GuiComponent.h" -#include "../Rendering/Tesselator.h" +#include "../renderer/Tesselator.h" void GuiComponent::hLine(int x0, int x1, int y, int col) { if (x1 < x0) { diff --git a/Minecraft.Client/UI/GuiComponent.h b/Minecraft.Client/net/minecraft/client/gui/GuiComponent.h similarity index 100% rename from Minecraft.Client/UI/GuiComponent.h rename to Minecraft.Client/net/minecraft/client/gui/GuiComponent.h diff --git a/Minecraft.Client/UI/Screens/HopperScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/HopperScreen.cpp similarity index 73% rename from Minecraft.Client/UI/Screens/HopperScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/HopperScreen.cpp index df3b3af9a..ae06bb0f5 100644 --- a/Minecraft.Client/UI/Screens/HopperScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/HopperScreen.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "HopperScreen.h" -#include "../../Textures/Textures.h" -#include "../../Player/LocalPlayer.h" -#include "../Font.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../Minecraft.World/Containers/HopperMenu.h" +#include "../renderer/Textures.h" +#include "../player/LocalPlayer.h" +#include "Font.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/HopperMenu.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // container classes diff --git a/Minecraft.Client/UI/Screens/HopperScreen.h b/Minecraft.Client/net/minecraft/client/gui/HopperScreen.h similarity index 90% rename from Minecraft.Client/UI/Screens/HopperScreen.h rename to Minecraft.Client/net/minecraft/client/gui/HopperScreen.h index e3e3d1eb4..6137ded26 100644 --- a/Minecraft.Client/UI/Screens/HopperScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/HopperScreen.h @@ -1,6 +1,6 @@ #pragma once #include -#include "AbstractContainerScreen.h" +#include "inventory/AbstractContainerScreen.h" class HopperTileEntity; class MinecartHopper; diff --git a/Minecraft.Client/UI/Screens/InBedChatScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/InBedChatScreen.cpp similarity index 82% rename from Minecraft.Client/UI/Screens/InBedChatScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/InBedChatScreen.cpp index 2c15026d2..7f8b4857e 100644 --- a/Minecraft.Client/UI/Screens/InBedChatScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/InBedChatScreen.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "InBedChatScreen.h" -#include "../Button.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "Button.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" void InBedChatScreen::init() { Keyboard::enableRepeatEvents(true); diff --git a/Minecraft.Client/UI/Screens/InBedChatScreen.h b/Minecraft.Client/net/minecraft/client/gui/InBedChatScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/InBedChatScreen.h rename to Minecraft.Client/net/minecraft/client/gui/InBedChatScreen.h diff --git a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/JoinMultiplayerScreen.cpp similarity index 94% rename from Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/JoinMultiplayerScreen.cpp index b25a3d1ab..a4fb3dbbc 100644 --- a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/JoinMultiplayerScreen.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "JoinMultiplayerScreen.h" -#include "../Button.h" -#include "../EditBox.h" -#include "../../GameState/Options.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "Button.h" +#include "EditBox.h" +#include "../Options.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" JoinMultiplayerScreen::JoinMultiplayerScreen(Screen* lastScreen) { ipEdit = nullptr; diff --git a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h b/Minecraft.Client/net/minecraft/client/gui/JoinMultiplayerScreen.h similarity index 96% rename from Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h rename to Minecraft.Client/net/minecraft/client/gui/JoinMultiplayerScreen.h index 78bce6115..8ec479267 100644 --- a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/JoinMultiplayerScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class EditBox; class Button; diff --git a/Minecraft.Client/UI/Screens/MerchantScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp similarity index 86% rename from Minecraft.Client/UI/Screens/MerchantScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp index f7e5a51e5..6883e972c 100644 --- a/Minecraft.Client/UI/Screens/MerchantScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp @@ -1,22 +1,22 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "MerchantScreen.h" #include #include -#include "../TradeSwitchButton.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../Rendering/EntityRenderers/ItemRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/MerchantMenu.h" -#include "../../../Minecraft.World/Containers/Slot.h" -#include "../../../Minecraft.World/Containers/MerchantContainer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Network/ClientConnection.h" -#include "../../../Minecraft.World/IO/Streams/ByteArrayOutputStream.h" -#include "../../../Minecraft.World/IO/Streams/DataOutputStream.h" -#include "../../../Minecraft.World/Util/Rarity.h" +#include "TradeSwitchButton.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../Lighting.h" +#include "../renderer/Textures.h" +#include "../renderer/entity/ItemRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/Slot.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" +#include "../Minecraft.h" +#include "../multiplayer/ClientConnection.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/Rarity.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // container classes (and iggy too) diff --git a/Minecraft.Client/UI/Screens/MerchantScreen.h b/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.h similarity index 77% rename from Minecraft.Client/UI/Screens/MerchantScreen.h rename to Minecraft.Client/net/minecraft/client/gui/MerchantScreen.h index 4a40bbb72..d3e613d3e 100644 --- a/Minecraft.Client/UI/Screens/MerchantScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.h @@ -1,8 +1,8 @@ #pragma once -#include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Containers/MerchantMenu.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" +#include "inventory/AbstractContainerScreen.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" class TradeSwitchButton; diff --git a/Minecraft.Client/UI/Screens/MessageScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/MessageScreen.cpp similarity index 88% rename from Minecraft.Client/UI/Screens/MessageScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/MessageScreen.cpp index 9cf8415d5..fa12cc957 100644 --- a/Minecraft.Client/UI/Screens/MessageScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/MessageScreen.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "MessageScreen.h" MessageScreen::MessageScreen(const std::wstring& message) { diff --git a/Minecraft.Client/UI/Screens/MessageScreen.h b/Minecraft.Client/net/minecraft/client/gui/MessageScreen.h similarity index 94% rename from Minecraft.Client/UI/Screens/MessageScreen.h rename to Minecraft.Client/net/minecraft/client/gui/MessageScreen.h index 62b4ee280..c4b5cc272 100644 --- a/Minecraft.Client/UI/Screens/MessageScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/MessageScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class MessageScreen : public Screen { private: diff --git a/Minecraft.Client/Rendering/Minimap.cpp b/Minecraft.Client/net/minecraft/client/gui/Minimap.cpp similarity index 95% rename from Minecraft.Client/Rendering/Minimap.cpp rename to Minecraft.Client/net/minecraft/client/gui/Minimap.cpp index 2003f4f1d..d4a68f578 100644 --- a/Minecraft.Client/Rendering/Minimap.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/Minimap.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "../Minecraft.h" #include "Minimap.h" -#include "../UI/Font.h" -#include "../GameState/Options.h" -#include "../Textures/Textures.h" -#include "Tesselator.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.saveddata.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.material.h" +#include "Font.h" +#include "../Options.h" +#include "../renderer/Textures.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" int Minimap::LUT[256]; // 4J added bool Minimap::genLUT = true; // 4J added diff --git a/Minecraft.Client/Rendering/Minimap.h b/Minecraft.Client/net/minecraft/client/gui/Minimap.h similarity index 91% rename from Minecraft.Client/Rendering/Minimap.h rename to Minecraft.Client/net/minecraft/client/gui/Minimap.h index 0fd927d5e..4bdd4a358 100644 --- a/Minecraft.Client/Rendering/Minimap.h +++ b/Minecraft.Client/net/minecraft/client/gui/Minimap.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Items/MapItem.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/MapItem.h" class Options; class Font; class Textures; diff --git a/Minecraft.Client/UI/Screens/NameEntryScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/NameEntryScreen.cpp similarity index 93% rename from Minecraft.Client/UI/Screens/NameEntryScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/NameEntryScreen.cpp index c5a0d62f2..fb3d27668 100644 --- a/Minecraft.Client/UI/Screens/NameEntryScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/NameEntryScreen.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "NameEntryScreen.h" -#include "../Button.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "Button.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" const std::wstring NameEntryScreen::allowedChars = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 " diff --git a/Minecraft.Client/UI/Screens/NameEntryScreen.h b/Minecraft.Client/net/minecraft/client/gui/NameEntryScreen.h similarity index 96% rename from Minecraft.Client/UI/Screens/NameEntryScreen.h rename to Minecraft.Client/net/minecraft/client/gui/NameEntryScreen.h index 2f0babddd..454178657 100644 --- a/Minecraft.Client/UI/Screens/NameEntryScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/NameEntryScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class NameEntryScreen : public Screen { private: diff --git a/Minecraft.Client/UI/Screens/OptionsScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/OptionsScreen.cpp similarity index 92% rename from Minecraft.Client/UI/Screens/OptionsScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/OptionsScreen.cpp index b20a9ee21..14197f043 100644 --- a/Minecraft.Client/UI/Screens/OptionsScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/OptionsScreen.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "OptionsScreen.h" -#include "../SmallButton.h" -#include "../SlideButton.h" -#include "../../GameState/Options.h" +#include "SmallButton.h" +#include "SlideButton.h" +#include "../Options.h" #include "ControlsScreen.h" #include "VideoSettingsScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" OptionsScreen::OptionsScreen(Screen* lastScreen, Options* options) { title = L"Options"; // 4J added diff --git a/Minecraft.Client/UI/Screens/OptionsScreen.h b/Minecraft.Client/net/minecraft/client/gui/OptionsScreen.h similarity index 95% rename from Minecraft.Client/UI/Screens/OptionsScreen.h rename to Minecraft.Client/net/minecraft/client/gui/OptionsScreen.h index 509162eff..8019cb143 100644 --- a/Minecraft.Client/UI/Screens/OptionsScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/OptionsScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class Options; class OptionsScreen : public Screen { diff --git a/Minecraft.Client/UI/Screens/PauseScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp similarity index 86% rename from Minecraft.Client/UI/Screens/PauseScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp index 11dd9e84a..020fe21ed 100644 --- a/Minecraft.Client/UI/Screens/PauseScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "PauseScreen.h" -#include "../Button.h" -#include "../../GameState/StatsCounter.h" +#include "Button.h" +#include "../../stats/StatsCounter.h" #include "MessageScreen.h" #include "OptionsScreen.h" -#include "TitleScreen.h" -#include "../../Level/MultiPlayerLevel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Player/LocalPlayer.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../MinecraftServer.h" +#include "../title/TitleScreen.h" +#include "../multiplayer/MultiPlayerLevel.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../player/LocalPlayer.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../server/MinecraftServer.h" PauseScreen::PauseScreen() { saveStep = 0; diff --git a/Minecraft.Client/UI/Screens/PauseScreen.h b/Minecraft.Client/net/minecraft/client/gui/PauseScreen.h similarity index 95% rename from Minecraft.Client/UI/Screens/PauseScreen.h rename to Minecraft.Client/net/minecraft/client/gui/PauseScreen.h index ef67c9f14..8b69dadaf 100644 --- a/Minecraft.Client/UI/Screens/PauseScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/PauseScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class PauseScreen : public Screen { private: diff --git a/Minecraft.Client/UI/Screens/RenameWorldScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/RenameWorldScreen.cpp similarity index 82% rename from Minecraft.Client/UI/Screens/RenameWorldScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/RenameWorldScreen.cpp index 5448489a5..911c58211 100644 --- a/Minecraft.Client/UI/Screens/RenameWorldScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/RenameWorldScreen.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "RenameWorldScreen.h" -#include "../EditBox.h" -#include "../Button.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" +#include "EditBox.h" +#include "Button.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" RenameWorldScreen::RenameWorldScreen(Screen* lastScreen, const std::wstring& levelId) { diff --git a/Minecraft.Client/UI/Screens/RenameWorldScreen.h b/Minecraft.Client/net/minecraft/client/gui/RenameWorldScreen.h similarity index 96% rename from Minecraft.Client/UI/Screens/RenameWorldScreen.h rename to Minecraft.Client/net/minecraft/client/gui/RenameWorldScreen.h index 11f5ed41d..dc8f356b1 100644 --- a/Minecraft.Client/UI/Screens/RenameWorldScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/RenameWorldScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class Button; class EditBox; diff --git a/Minecraft.Client/UI/Screens/RepairScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/RepairScreen.cpp similarity index 92% rename from Minecraft.Client/UI/Screens/RepairScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/RepairScreen.cpp index 54b18362b..7f253586d 100644 --- a/Minecraft.Client/UI/Screens/RepairScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/RepairScreen.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "RepairScreen.h" #include #include #include -#include "../EditBox.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/AnvilMenu.h" -#include "../../../Minecraft.World/Containers/Slot.h" -#include "../../../Minecraft.Client/Network/ClientConnection.h" -#include "../../../Minecraft.Client/Minecraft.h" +#include "EditBox.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../Lighting.h" +#include "../renderer/Textures.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/AnvilMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/Slot.h" +#include "../multiplayer/ClientConnection.h" +#include "../Minecraft.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // IUIScene_AnvilMenu (from iggy UI) diff --git a/Minecraft.Client/UI/Screens/RepairScreen.h b/Minecraft.Client/net/minecraft/client/gui/RepairScreen.h similarity index 78% rename from Minecraft.Client/UI/Screens/RepairScreen.h rename to Minecraft.Client/net/minecraft/client/gui/RepairScreen.h index b5352a939..e8f6d740b 100644 --- a/Minecraft.Client/UI/Screens/RepairScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/RepairScreen.h @@ -1,9 +1,9 @@ #pragma once -#include "../../Platform/stdafx.h" -#include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Containers/AnvilMenu.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.ContainerListener.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "inventory/AbstractContainerScreen.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/AnvilMenu.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.ContainerListener.h" class EditBox; diff --git a/Minecraft.Client/UI/Screen.cpp b/Minecraft.Client/net/minecraft/client/gui/Screen.cpp similarity index 96% rename from Minecraft.Client/UI/Screen.cpp rename to Minecraft.Client/net/minecraft/client/gui/Screen.cpp index 210bd242f..a3c23390a 100644 --- a/Minecraft.Client/UI/Screen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/Screen.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Screen.h" #include "Button.h" -#include "../Rendering/Particles/GuiParticles.h" -#include "../Rendering/Tesselator.h" -#include "../Textures/Textures.h" -#include "../../Minecraft.World/Util/SoundTypes.h" +#include "particle/GuiParticles.h" +#include "../renderer/Tesselator.h" +#include "../renderer/Textures.h" +#include "../../../../../Minecraft.World/Header Files/SoundTypes.h" Screen::Screen() // 4J added { diff --git a/Minecraft.Client/UI/Screen.h b/Minecraft.Client/net/minecraft/client/gui/Screen.h similarity index 100% rename from Minecraft.Client/UI/Screen.h rename to Minecraft.Client/net/minecraft/client/gui/Screen.h diff --git a/Minecraft.Client/UI/ScreenSizeCalculator.cpp b/Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.cpp similarity index 90% rename from Minecraft.Client/UI/ScreenSizeCalculator.cpp rename to Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.cpp index 611287552..ada56e7b5 100644 --- a/Minecraft.Client/UI/ScreenSizeCalculator.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ScreenSizeCalculator.h" -#include "../GameState/Options.h" +#include "../Options.h" // who the fuck thought this was a good idea ScreenSizeCalculator::ScreenSizeCalculator(Options* options, int width, diff --git a/Minecraft.Client/UI/ScreenSizeCalculator.h b/Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.h similarity index 100% rename from Minecraft.Client/UI/ScreenSizeCalculator.h rename to Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.h diff --git a/Minecraft.Client/UI/ScrolledSelectionList.cpp b/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp similarity index 93% rename from Minecraft.Client/UI/ScrolledSelectionList.cpp rename to Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp index c91d92f64..1e3a245d2 100644 --- a/Minecraft.Client/UI/ScrolledSelectionList.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ScrolledSelectionList.h" #include "Button.h" -#include "../Rendering/Tesselator.h" -#include "../Textures/Textures.h" -#include "../../Minecraft.World/Platform/System.h" +#include "../renderer/Tesselator.h" +#include "../renderer/Textures.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" ScrolledSelectionList::ScrolledSelectionList(Minecraft* minecraft, int width, int height, int y0, int y1, diff --git a/Minecraft.Client/UI/ScrolledSelectionList.h b/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.h similarity index 100% rename from Minecraft.Client/UI/ScrolledSelectionList.h rename to Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.h diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/SelectWorldScreen.cpp similarity index 96% rename from Minecraft.Client/UI/Screens/SelectWorldScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/SelectWorldScreen.cpp index 150df4da6..d005cb28c 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/SelectWorldScreen.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SelectWorldScreen.h" -#include "../Button.h" +#include "Button.h" #include "ConfirmScreen.h" #include "CreateWorldScreen.h" #include "RenameWorldScreen.h" -#include "../../GameState/DemoMode.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" +#include "../../server/level/DemoMode.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" SelectWorldScreen::SelectWorldScreen(Screen* lastScreen) { // 4J - added initialisers diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.h b/Minecraft.Client/net/minecraft/client/gui/SelectWorldScreen.h similarity index 97% rename from Minecraft.Client/UI/Screens/SelectWorldScreen.h rename to Minecraft.Client/net/minecraft/client/gui/SelectWorldScreen.h index 39b56c32f..0012b5879 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/SelectWorldScreen.h @@ -1,6 +1,6 @@ #pragma once -#include "../Screen.h" -#include "../ScrolledSelectionList.h" +#include "Screen.h" +#include "ScrolledSelectionList.h" class LevelSummary; class Button; class Tesselator; diff --git a/Minecraft.Client/UI/SlideButton.cpp b/Minecraft.Client/net/minecraft/client/gui/SlideButton.cpp similarity index 95% rename from Minecraft.Client/UI/SlideButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/SlideButton.cpp index a82956f67..4c5e7b41b 100644 --- a/Minecraft.Client/UI/SlideButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/SlideButton.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SlideButton.h" SlideButton::SlideButton(int id, int x, int y, const Options::Option* option, diff --git a/Minecraft.Client/UI/SlideButton.h b/Minecraft.Client/net/minecraft/client/gui/SlideButton.h similarity index 94% rename from Minecraft.Client/UI/SlideButton.h rename to Minecraft.Client/net/minecraft/client/gui/SlideButton.h index f2db25366..91db3302c 100644 --- a/Minecraft.Client/UI/SlideButton.h +++ b/Minecraft.Client/net/minecraft/client/gui/SlideButton.h @@ -1,6 +1,6 @@ #pragma once #include "Button.h" -#include "../GameState/Options.h" +#include "../Options.h" class Minecraft; class SlideButton : public Button { diff --git a/Minecraft.Client/UI/SmallButton.cpp b/Minecraft.Client/net/minecraft/client/gui/SmallButton.cpp similarity index 90% rename from Minecraft.Client/UI/SmallButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/SmallButton.cpp index 4b7a05612..52d160508 100644 --- a/Minecraft.Client/UI/SmallButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/SmallButton.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SmallButton.h" SmallButton::SmallButton(int id, int x, int y, const std::wstring& msg) diff --git a/Minecraft.Client/UI/SmallButton.h b/Minecraft.Client/net/minecraft/client/gui/SmallButton.h similarity index 92% rename from Minecraft.Client/UI/SmallButton.h rename to Minecraft.Client/net/minecraft/client/gui/SmallButton.h index 2638c60a9..6d68d0513 100644 --- a/Minecraft.Client/UI/SmallButton.h +++ b/Minecraft.Client/net/minecraft/client/gui/SmallButton.h @@ -1,6 +1,6 @@ #pragma once #include "Button.h" -#include "../GameState/Options.h" +#include "../Options.h" class SmallButton : public Button { private: diff --git a/Minecraft.Client/UI/TradeSwitchButton.cpp b/Minecraft.Client/net/minecraft/client/gui/TradeSwitchButton.cpp similarity index 74% rename from Minecraft.Client/UI/TradeSwitchButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/TradeSwitchButton.cpp index 860a2c43f..ac7dc4e04 100644 --- a/Minecraft.Client/UI/TradeSwitchButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/TradeSwitchButton.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TradeSwitchButton.h" -#include "../Textures/Textures.h" -#include "../Rendering/Tesselator.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/MerchantMenu.h" +#include "../renderer/Textures.h" +#include "../renderer/Tesselator.h" +#include "../Minecraft.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) #ifdef ENABLE_JAVA_GUIS diff --git a/Minecraft.Client/UI/TradeSwitchButton.h b/Minecraft.Client/net/minecraft/client/gui/TradeSwitchButton.h similarity index 100% rename from Minecraft.Client/UI/TradeSwitchButton.h rename to Minecraft.Client/net/minecraft/client/gui/TradeSwitchButton.h diff --git a/Minecraft.Client/UI/Screens/VideoSettingsScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/VideoSettingsScreen.cpp similarity index 92% rename from Minecraft.Client/UI/Screens/VideoSettingsScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/VideoSettingsScreen.cpp index bab30504c..d6e19e2a2 100644 --- a/Minecraft.Client/UI/Screens/VideoSettingsScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/VideoSettingsScreen.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "VideoSettingsScreen.h" -#include "../SmallButton.h" -#include "../SlideButton.h" -#include "../../GameState/Options.h" +#include "SmallButton.h" +#include "SlideButton.h" +#include "../Options.h" #include "ControlsScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" // 4jcraft #define ITEM_COUNT 10 diff --git a/Minecraft.Client/UI/Screens/VideoSettingsScreen.h b/Minecraft.Client/net/minecraft/client/gui/VideoSettingsScreen.h similarity index 94% rename from Minecraft.Client/UI/Screens/VideoSettingsScreen.h rename to Minecraft.Client/net/minecraft/client/gui/VideoSettingsScreen.h index bbeb74698..e4aa2189b 100644 --- a/Minecraft.Client/UI/Screens/VideoSettingsScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/VideoSettingsScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "Screen.h" class Options; class VideoSettingsScreen : public Screen { diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.cpp b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp similarity index 87% rename from Minecraft.Client/UI/Screens/AchievementPopup.cpp rename to Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp index 7e4ef16b3..cfc3d3865 100644 --- a/Minecraft.Client/UI/Screens/AchievementPopup.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "AchievementPopup.h" -#include "../../Rendering/EntityRenderers/ItemRenderer.h" +#include "../../renderer/entity/ItemRenderer.h" #include "../Font.h" -#include "../../Textures/Textures.h" -#include "../../Rendering/Lighting.h" -#include "../../../Minecraft.World/Platform/System.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../../Minecraft.World/Util/SharedConstants.h" +#include "../../renderer/Textures.h" +#include "../../Lighting.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../../Minecraft.World/net/minecraft/SharedConstants.h" AchievementPopup::AchievementPopup(Minecraft* mc) { // 4J - added initialisers diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.h b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.h similarity index 100% rename from Minecraft.Client/UI/Screens/AchievementPopup.h rename to Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.h diff --git a/Minecraft.Client/UI/Screens/AchievementScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp similarity index 87% rename from Minecraft.Client/UI/Screens/AchievementScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp index 4754bcbbb..3e85bd6eb 100644 --- a/Minecraft.Client/UI/Screens/AchievementScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "AchievementScreen.h" #include "../SmallButton.h" -#include "../../GameState/Options.h" -#include "../../Input/KeyMapping.h" +#include "../../Options.h" +#include "../../KeyMapping.h" #include "../Font.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../GameState/StatsCounter.h" -#include "../../Rendering/EntityRenderers/ItemRenderer.h" -#include "../../../Minecraft.World/Platform/System.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../Lighting.h" +#include "../../renderer/Textures.h" +#include "../../../stats/StatsCounter.h" +#include "../../renderer/entity/ItemRenderer.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" AchievementScreen::AchievementScreen(StatsCounter* statsCounter) { // 4J - added initialisers diff --git a/Minecraft.Client/UI/Screens/AchievementScreen.h b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.h similarity index 94% rename from Minecraft.Client/UI/Screens/AchievementScreen.h rename to Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.h index 9c8a1223d..7c9aa42a8 100644 --- a/Minecraft.Client/UI/Screens/AchievementScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.h @@ -1,6 +1,6 @@ #pragma once #include "../Screen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.stats.h" +#include "../../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" class StatsCounter; class AchievementScreen : public Screen { diff --git a/Minecraft.Client/UI/Screens/StatsScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/achievement/StatsScreen.cpp similarity index 97% rename from Minecraft.Client/UI/Screens/StatsScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/achievement/StatsScreen.cpp index de2cdf9c8..8024390bb 100644 --- a/Minecraft.Client/UI/Screens/StatsScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/achievement/StatsScreen.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "StatsScreen.h" -#include "../../GameState/StatsCounter.h" -#include "../../Rendering/EntityRenderers/ItemRenderer.h" +#include "../../../stats/StatsCounter.h" +#include "../../renderer/entity/ItemRenderer.h" #include "../Button.h" #include "../Font.h" -#include "../../Rendering/Lighting.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../Lighting.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" const float StatsScreen::SLOT_TEX_SIZE = 128.0f; ItemRenderer* StatsScreen::itemRenderer = nullptr; diff --git a/Minecraft.Client/UI/Screens/StatsScreen.h b/Minecraft.Client/net/minecraft/client/gui/achievement/StatsScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/StatsScreen.h rename to Minecraft.Client/net/minecraft/client/gui/achievement/StatsScreen.h diff --git a/Minecraft.Client/UI/AbstractBeaconButton.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractBeaconButton.cpp similarity index 88% rename from Minecraft.Client/UI/AbstractBeaconButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/AbstractBeaconButton.cpp index 92b49e881..4a4d95c74 100644 --- a/Minecraft.Client/UI/AbstractBeaconButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractBeaconButton.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "AbstractBeaconButton.h" -#include "../Textures/Textures.h" -#include "../../../Minecraft.Client/Minecraft.h" +#include "../../renderer/Textures.h" +#include "../../Minecraft.h" #include // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) diff --git a/Minecraft.Client/UI/AbstractBeaconButton.h b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractBeaconButton.h similarity index 95% rename from Minecraft.Client/UI/AbstractBeaconButton.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/AbstractBeaconButton.h index 3254f4912..9b7601aa3 100644 --- a/Minecraft.Client/UI/AbstractBeaconButton.h +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractBeaconButton.h @@ -1,5 +1,5 @@ #pragma once -#include "Button.h" +#include "../Button.h" class ResourceLocation; diff --git a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractContainerScreen.cpp similarity index 95% rename from Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/AbstractContainerScreen.cpp index 6222807b9..5f991d465 100644 --- a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractContainerScreen.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "AbstractContainerScreen.h" -#include "../../Rendering/EntityRenderers/ItemRenderer.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/Lighting.h" -#include "../../GameState/GameMode.h" -#include "../../Input/KeyMapping.h" -#include "../../GameState/Options.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../renderer/entity/ItemRenderer.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../Lighting.h" +#include "../../../server/level/GameMode.h" +#include "../../KeyMapping.h" +#include "../../Options.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" ItemRenderer* AbstractContainerScreen::itemRenderer = new ItemRenderer(); diff --git a/Minecraft.Client/UI/Screens/AbstractContainerScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/AbstractContainerScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/AbstractContainerScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/AbstractContainerScreen.h diff --git a/Minecraft.Client/UI/BeaconCancelButton.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconCancelButton.cpp similarity index 78% rename from Minecraft.Client/UI/BeaconCancelButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconCancelButton.cpp index 081029e4c..2176560f6 100644 --- a/Minecraft.Client/UI/BeaconCancelButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconCancelButton.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "BeaconCancelButton.h" -#include "Screens/BeaconScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "BeaconScreen.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) #ifdef ENABLE_JAVA_GUIS diff --git a/Minecraft.Client/UI/BeaconCancelButton.h b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconCancelButton.h similarity index 100% rename from Minecraft.Client/UI/BeaconCancelButton.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconCancelButton.h diff --git a/Minecraft.Client/UI/BeaconConfirmButton.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconConfirmButton.cpp similarity index 78% rename from Minecraft.Client/UI/BeaconConfirmButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconConfirmButton.cpp index 00871f6e1..43bee5cf1 100644 --- a/Minecraft.Client/UI/BeaconConfirmButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconConfirmButton.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "BeaconConfirmButton.h" -#include "Screens/BeaconScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "BeaconScreen.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) #ifdef ENABLE_JAVA_GUIS diff --git a/Minecraft.Client/UI/BeaconConfirmButton.h b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconConfirmButton.h similarity index 100% rename from Minecraft.Client/UI/BeaconConfirmButton.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconConfirmButton.h diff --git a/Minecraft.Client/UI/BeaconPowerButton.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconPowerButton.cpp similarity index 74% rename from Minecraft.Client/UI/BeaconPowerButton.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconPowerButton.cpp index 958badfe7..a2aa4192e 100644 --- a/Minecraft.Client/UI/BeaconPowerButton.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconPowerButton.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "BeaconPowerButton.h" -#include "Screens/BeaconScreen.h" -#include "../../../Minecraft.World/Entities/MobEffect.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../Textures/Textures.h" -#include "Textures/ResourceLocation.h" +#include "BeaconScreen.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/effect/MobEffect.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../renderer/Textures.h" +#include "../../resources/ResourceLocation.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) #ifdef ENABLE_JAVA_GUIS diff --git a/Minecraft.Client/UI/BeaconPowerButton.h b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconPowerButton.h similarity index 80% rename from Minecraft.Client/UI/BeaconPowerButton.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconPowerButton.h index fc6e40266..e91acbc1f 100644 --- a/Minecraft.Client/UI/BeaconPowerButton.h +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconPowerButton.h @@ -1,6 +1,6 @@ #pragma once #include "AbstractBeaconButton.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.effect.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" class BeaconScreen; diff --git a/Minecraft.Client/UI/Screens/BeaconScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp similarity index 90% rename from Minecraft.Client/UI/Screens/BeaconScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp index d44378d83..8023681c8 100644 --- a/Minecraft.Client/UI/Screens/BeaconScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "BeaconScreen.h" -#include "../BeaconConfirmButton.h" -#include "../BeaconCancelButton.h" -#include "../BeaconPowerButton.h" +#include "BeaconConfirmButton.h" +#include "BeaconCancelButton.h" +#include "BeaconPowerButton.h" #include #include -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/Slot.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Network/ClientConnection.h" -#include "../../../Minecraft.World/IO/Streams/ByteArrayOutputStream.h" -#include "../../../Minecraft.World/IO/Streams/DataOutputStream.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../Lighting.h" +#include "../../renderer/Textures.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/Slot.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../Minecraft.h" +#include "../../multiplayer/ClientConnection.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // container classes (and iggy too) diff --git a/Minecraft.Client/UI/Screens/BeaconScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.h similarity index 79% rename from Minecraft.Client/UI/Screens/BeaconScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.h index 03a9db927..d57427873 100644 --- a/Minecraft.Client/UI/Screens/BeaconScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.h @@ -1,8 +1,8 @@ #pragma once #include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Containers/BeaconMenu.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/BeaconMenu.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" class BeaconConfirmButton; class BeaconCancelButton; diff --git a/Minecraft.Client/UI/Screens/BrewingStandScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/BrewingStandScreen.cpp similarity index 84% rename from Minecraft.Client/UI/Screens/BrewingStandScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/BrewingStandScreen.cpp index 1d1239c2a..0e4a793a2 100644 --- a/Minecraft.Client/UI/Screens/BrewingStandScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BrewingStandScreen.cpp @@ -1,15 +1,15 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "BrewingStandScreen.h" #include #include #include -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/BrewingStandMenu.h" -#include "../../../Minecraft.World/Containers/Slot.h" -#include "../../../Minecraft.Client/Minecraft.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../Lighting.h" +#include "../../renderer/Textures.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/Slot.h" +#include "../../Minecraft.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // container classes diff --git a/Minecraft.Client/UI/Screens/BrewingStandScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/BrewingStandScreen.h similarity index 73% rename from Minecraft.Client/UI/Screens/BrewingStandScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/BrewingStandScreen.h index 12f834ed7..33e5761c2 100644 --- a/Minecraft.Client/UI/Screens/BrewingStandScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/BrewingStandScreen.h @@ -1,8 +1,8 @@ #pragma once #include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Containers/BrewingStandMenu.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" class BrewingStandScreen : public AbstractContainerScreen { public: diff --git a/Minecraft.Client/UI/Screens/ContainerScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/ContainerScreen.cpp similarity index 82% rename from Minecraft.Client/UI/Screens/ContainerScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/ContainerScreen.cpp index 9e073a6e6..2784baa73 100644 --- a/Minecraft.Client/UI/Screens/ContainerScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/ContainerScreen.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ContainerScreen.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../renderer/Textures.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" ContainerScreen::ContainerScreen(std::shared_ptr inventory, std::shared_ptr container) diff --git a/Minecraft.Client/UI/Screens/ContainerScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/ContainerScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/ContainerScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/ContainerScreen.h diff --git a/Minecraft.Client/UI/Screens/CraftingScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/CraftingScreen.cpp similarity index 75% rename from Minecraft.Client/UI/Screens/CraftingScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/CraftingScreen.cpp index 666c66878..31a2089bb 100644 --- a/Minecraft.Client/UI/Screens/CraftingScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/CraftingScreen.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "CraftingScreen.h" -#include "../../Textures/Textures.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" +#include "../../renderer/Textures.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" #ifdef ENABLE_JAVA_GUIS ResourceLocation GUI_CRAFTING_LOCATION = ResourceLocation(TN_GUI_CRAFTING); diff --git a/Minecraft.Client/UI/Screens/CraftingScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/CraftingScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/CraftingScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/CraftingScreen.h diff --git a/Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp similarity index 95% rename from Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp index 741835b54..6d6f30609 100644 --- a/Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "CreativeInventoryScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Containers/Inventory.h" -#include "../../../Minecraft.World/Containers/SimpleContainer.h" -#include "../../../Minecraft.World/Containers/Slot.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/Inventory.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/SimpleContainer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/Slot.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" #include "../../Minecraft.h" -#include "../../Textures/Textures.h" -#include "../../Rendering/EntityRenderers/ItemRenderer.h" -#include "../../Rendering/Lighting.h" -#include "../../../Minecraft.World/Containers/InventoryMenu.h" +#include "../../renderer/Textures.h" +#include "../../renderer/entity/ItemRenderer.h" +#include "../../Lighting.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/InventoryMenu.h" #include #include diff --git a/Minecraft.Client/UI/Screens/CreativeInventoryScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/CreativeInventoryScreen.h similarity index 92% rename from Minecraft.Client/UI/Screens/CreativeInventoryScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/CreativeInventoryScreen.h index e8fd36877..2f6b7df36 100644 --- a/Minecraft.Client/UI/Screens/CreativeInventoryScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/CreativeInventoryScreen.h @@ -1,8 +1,8 @@ #pragma once #include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Containers/AbstractContainerMenu.h" -#include "../../Platform/Common/UI/IUIScene_CreativeMenu.h" -#include "../../Player/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h" +#include "../../../../../Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" class Player; class SimpleContainer; diff --git a/Minecraft.Client/UI/Screens/FurnaceScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/FurnaceScreen.cpp similarity index 76% rename from Minecraft.Client/UI/Screens/FurnaceScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/FurnaceScreen.cpp index 170aedb61..eb2469ab5 100644 --- a/Minecraft.Client/UI/Screens/FurnaceScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/FurnaceScreen.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "FurnaceScreen.h" -#include "../../Textures/Textures.h" -#include "../../Player/LocalPlayer.h" +#include "../../renderer/Textures.h" +#include "../../player/LocalPlayer.h" #include "../Font.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h" #ifdef ENABLE_JAVA_GUIS ResourceLocation GUI_FURNACE_LOCATION = ResourceLocation(TN_GUI_FURNACE); diff --git a/Minecraft.Client/UI/Screens/FurnaceScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/FurnaceScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/FurnaceScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/FurnaceScreen.h diff --git a/Minecraft.Client/UI/Screens/HorseInventoryScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/HorseInventoryScreen.cpp similarity index 86% rename from Minecraft.Client/UI/Screens/HorseInventoryScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/HorseInventoryScreen.cpp index f6de569c9..23a7727ae 100644 --- a/Minecraft.Client/UI/Screens/HorseInventoryScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/HorseInventoryScreen.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "HorseInventoryScreen.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Containers/HorseInventoryMenu.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../renderer/entity/EntityRenderDispatcher.h" +#include "../../Lighting.h" +#include "../../renderer/Textures.h" +#include "../../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/HorseInventoryMenu.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing InventoryScreen #ifdef ENABLE_JAVA_GUIS diff --git a/Minecraft.Client/UI/Screens/HorseInventoryScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/HorseInventoryScreen.h similarity index 85% rename from Minecraft.Client/UI/Screens/HorseInventoryScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/HorseInventoryScreen.h index 12b0e68a2..fcf508719 100644 --- a/Minecraft.Client/UI/Screens/HorseInventoryScreen.h +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/HorseInventoryScreen.h @@ -1,7 +1,7 @@ #pragma once #include #include "AbstractContainerScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" class HorseInventoryScreen : public AbstractContainerScreen { public: diff --git a/Minecraft.Client/UI/Screens/InventoryScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/InventoryScreen.cpp similarity index 87% rename from Minecraft.Client/UI/Screens/InventoryScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/InventoryScreen.cpp index f4dccf4f6..0573dbc1c 100644 --- a/Minecraft.Client/UI/Screens/InventoryScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/InventoryScreen.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "InventoryScreen.h" -#include "../../Player/MultiPlayerLocalPlayer.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" #include "../Font.h" -#include "../../Rendering/EntityRenderers/EntityRenderDispatcher.h" -#include "../../Rendering/Lighting.h" -#include "../../Textures/Textures.h" +#include "../../renderer/entity/EntityRenderDispatcher.h" +#include "../../Lighting.h" +#include "../../renderer/Textures.h" #include "../Button.h" -#include "AchievementScreen.h" -#include "StatsScreen.h" -#include "../../../Minecraft.World/Headers/net.minecraft.stats.h" +#include "../achievement/AchievementScreen.h" +#include "../achievement/StatsScreen.h" +#include "../../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" InventoryScreen::InventoryScreen(std::shared_ptr player) : AbstractContainerScreen(player->inventoryMenu) { diff --git a/Minecraft.Client/UI/Screens/InventoryScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/InventoryScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/InventoryScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/InventoryScreen.h diff --git a/Minecraft.Client/UI/Screens/TextEditScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/TextEditScreen.cpp similarity index 78% rename from Minecraft.Client/UI/Screens/TextEditScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/TextEditScreen.cpp index 3e9053710..4c0480fec 100644 --- a/Minecraft.Client/UI/Screens/TextEditScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/TextEditScreen.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TextEditScreen.h" #include "../Button.h" -#include "../../Rendering/EntityRenderers/TileEntityRenderDispatcher.h" -#include "../../Network/ClientConnection.h" -#include "../../Level/MultiPlayerLevel.h" -#include "../../../Minecraft.World/Blocks/TileEntities/SignTileEntity.h" -#include "../../../Minecraft.World/Util/SharedConstants.h" -#include "../../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../renderer/tileentity/TileEntityRenderDispatcher.h" +#include "../../multiplayer/ClientConnection.h" +#include "../../multiplayer/MultiPlayerLevel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" const std::wstring TextEditScreen::allowedChars = SharedConstants::acceptableLetters; diff --git a/Minecraft.Client/UI/Screens/TextEditScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/TextEditScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/TextEditScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/TextEditScreen.h diff --git a/Minecraft.Client/UI/Screens/TrapScreen.cpp b/Minecraft.Client/net/minecraft/client/gui/inventory/TrapScreen.cpp similarity index 57% rename from Minecraft.Client/UI/Screens/TrapScreen.cpp rename to Minecraft.Client/net/minecraft/client/gui/inventory/TrapScreen.cpp index bcad68240..ff9abe7a8 100644 --- a/Minecraft.Client/UI/Screens/TrapScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/inventory/TrapScreen.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TrapScreen.h" -#include "../../Player/LocalPlayer.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../../Minecraft.World/Blocks/TileEntities/DispenserTileEntity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../../player/LocalPlayer.h" +#include "../../renderer/Textures.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" #ifdef ENABLE_JAVA_GUIS ResourceLocation GUI_TRAP_LOCATION = ResourceLocation(TN_GUI_TRAP); diff --git a/Minecraft.Client/UI/Screens/TrapScreen.h b/Minecraft.Client/net/minecraft/client/gui/inventory/TrapScreen.h similarity index 100% rename from Minecraft.Client/UI/Screens/TrapScreen.h rename to Minecraft.Client/net/minecraft/client/gui/inventory/TrapScreen.h diff --git a/Minecraft.Client/Rendering/Particles/GuiParticle.cpp b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp similarity index 88% rename from Minecraft.Client/Rendering/Particles/GuiParticle.cpp rename to Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp index 85497e989..7fdc031d3 100644 --- a/Minecraft.Client/Rendering/Particles/GuiParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "GuiParticle.h" -#include "../../../Minecraft.World/Util/Random.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" Random* GuiParticle::random = new Random(); diff --git a/Minecraft.Client/Rendering/Particles/GuiParticle.h b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/GuiParticle.h rename to Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.h diff --git a/Minecraft.Client/Rendering/Particles/GuiParticles.cpp b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticles.cpp similarity index 85% rename from Minecraft.Client/Rendering/Particles/GuiParticles.cpp rename to Minecraft.Client/net/minecraft/client/gui/particle/GuiParticles.cpp index 5a7002682..df902f590 100644 --- a/Minecraft.Client/Rendering/Particles/GuiParticles.cpp +++ b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticles.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "GuiParticles.h" #include "GuiParticle.h" -#include "../../Textures/Textures.h" +#include "../../renderer/Textures.h" GuiParticles::GuiParticles(Minecraft* mc) { this->mc = mc; } diff --git a/Minecraft.Client/Rendering/Particles/GuiParticles.h b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticles.h similarity index 89% rename from Minecraft.Client/Rendering/Particles/GuiParticles.h rename to Minecraft.Client/net/minecraft/client/gui/particle/GuiParticles.h index 4c277f4f7..f1dd8e426 100644 --- a/Minecraft.Client/Rendering/Particles/GuiParticles.h +++ b/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticles.h @@ -1,5 +1,5 @@ #pragma once -#include "../../UI/GuiComponent.h" +#include "../GuiComponent.h" class GuiParticle; class Minecraft; diff --git a/Minecraft.Client/Level/DemoLevel.cpp b/Minecraft.Client/net/minecraft/client/level/DemoLevel.cpp similarity index 74% rename from Minecraft.Client/Level/DemoLevel.cpp rename to Minecraft.Client/net/minecraft/client/level/DemoLevel.cpp index 257e4d9c7..301abe131 100644 --- a/Minecraft.Client/Level/DemoLevel.cpp +++ b/Minecraft.Client/net/minecraft/client/level/DemoLevel.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DemoLevel.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings(DemoLevel::DEMO_LEVEL_SEED, GameType::SURVIVAL, false, false, diff --git a/Minecraft.Client/Level/DemoLevel.h b/Minecraft.Client/net/minecraft/client/level/DemoLevel.h similarity index 85% rename from Minecraft.Client/Level/DemoLevel.h rename to Minecraft.Client/net/minecraft/client/level/DemoLevel.h index 085e5a506..a60210a5d 100644 --- a/Minecraft.Client/Level/DemoLevel.h +++ b/Minecraft.Client/net/minecraft/client/level/DemoLevel.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" class DemoLevel : public Level { private: diff --git a/Minecraft.Client/Rendering/Models/BatModel.cpp b/Minecraft.Client/net/minecraft/client/model/BatModel.cpp similarity index 93% rename from Minecraft.Client/Rendering/Models/BatModel.cpp rename to Minecraft.Client/net/minecraft/client/model/BatModel.cpp index 49c8f6d36..1dafd8ca1 100644 --- a/Minecraft.Client/Rendering/Models/BatModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/BatModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.ambient.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ambient/net.minecraft.world.entity.ambient.h" #include "BatModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" BatModel::BatModel() : Model() { texWidth = 64; diff --git a/Minecraft.Client/Rendering/Models/BatModel.h b/Minecraft.Client/net/minecraft/client/model/BatModel.h similarity index 94% rename from Minecraft.Client/Rendering/Models/BatModel.h rename to Minecraft.Client/net/minecraft/client/model/BatModel.h index e4c381147..4e58fd0da 100644 --- a/Minecraft.Client/Rendering/Models/BatModel.h +++ b/Minecraft.Client/net/minecraft/client/model/BatModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class BatModel : public Model { private: diff --git a/Minecraft.Client/Rendering/Models/BlazeModel.cpp b/Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp similarity index 93% rename from Minecraft.Client/Rendering/Models/BlazeModel.cpp rename to Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp index c584ae2ba..945685268 100644 --- a/Minecraft.Client/Rendering/Models/BlazeModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "BlazeModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" BlazeModel::BlazeModel() : Model() { upperBodyParts = ModelPartArray(12); diff --git a/Minecraft.Client/Rendering/Models/BlazeModel.h b/Minecraft.Client/net/minecraft/client/model/BlazeModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/BlazeModel.h rename to Minecraft.Client/net/minecraft/client/model/BlazeModel.h index f6c689c98..f14203371 100644 --- a/Minecraft.Client/Rendering/Models/BlazeModel.h +++ b/Minecraft.Client/net/minecraft/client/model/BlazeModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class BlazeModel : public Model { private: diff --git a/Minecraft.Client/Rendering/Models/BoatModel.cpp b/Minecraft.Client/net/minecraft/client/model/BoatModel.cpp similarity index 96% rename from Minecraft.Client/Rendering/Models/BoatModel.cpp rename to Minecraft.Client/net/minecraft/client/model/BoatModel.cpp index e0b5da365..d666170f2 100644 --- a/Minecraft.Client/Rendering/Models/BoatModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/BoatModel.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "BoatModel.h" BoatModel::BoatModel() : Model() { diff --git a/Minecraft.Client/Rendering/Models/BoatModel.h b/Minecraft.Client/net/minecraft/client/model/BoatModel.h similarity index 84% rename from Minecraft.Client/Rendering/Models/BoatModel.h rename to Minecraft.Client/net/minecraft/client/model/BoatModel.h index d96fdef06..e8cc7f2d7 100644 --- a/Minecraft.Client/Rendering/Models/BoatModel.h +++ b/Minecraft.Client/net/minecraft/client/model/BoatModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" -#include "ModelPart.h" +#include "geom/Model.h" +#include "geom/ModelPart.h" class BoatModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/BookModel.cpp b/Minecraft.Client/net/minecraft/client/model/BookModel.cpp similarity index 94% rename from Minecraft.Client/Rendering/Models/BookModel.cpp rename to Minecraft.Client/net/minecraft/client/model/BookModel.cpp index 47af3bb83..255096464 100644 --- a/Minecraft.Client/Rendering/Models/BookModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/BookModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "BookModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" BookModel::BookModel() { leftLid = (new ModelPart(this))->texOffs(0, 0)->addBox(-6, -5, 0, 6, 10, 0); diff --git a/Minecraft.Client/Rendering/Models/BookModel.h b/Minecraft.Client/net/minecraft/client/model/BookModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/BookModel.h rename to Minecraft.Client/net/minecraft/client/model/BookModel.h index cef02230a..4ef9c5ff1 100644 --- a/Minecraft.Client/Rendering/Models/BookModel.h +++ b/Minecraft.Client/net/minecraft/client/model/BookModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class BookModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/ChestModel.cpp b/Minecraft.Client/net/minecraft/client/model/ChestModel.cpp similarity index 92% rename from Minecraft.Client/Rendering/Models/ChestModel.cpp rename to Minecraft.Client/net/minecraft/client/model/ChestModel.cpp index 918c44620..335b30db3 100644 --- a/Minecraft.Client/Rendering/Models/ChestModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/ChestModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ChestModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" ChestModel::ChestModel() { lid = ((new ModelPart(this, 0, 0)))->setTexSize(64, 64); diff --git a/Minecraft.Client/Rendering/Models/ChestModel.h b/Minecraft.Client/net/minecraft/client/model/ChestModel.h similarity index 90% rename from Minecraft.Client/Rendering/Models/ChestModel.h rename to Minecraft.Client/net/minecraft/client/model/ChestModel.h index 3b3cfd8b2..c26e82be9 100644 --- a/Minecraft.Client/Rendering/Models/ChestModel.h +++ b/Minecraft.Client/net/minecraft/client/model/ChestModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class Cube; diff --git a/Minecraft.Client/Rendering/Models/ChickenModel.cpp b/Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp similarity index 95% rename from Minecraft.Client/Rendering/Models/ChickenModel.cpp rename to Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp index e3c2e6ccd..148827e0a 100644 --- a/Minecraft.Client/Rendering/Models/ChickenModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "ChickenModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" ChickenModel::ChickenModel() : Model() { int yo = 16; diff --git a/Minecraft.Client/Rendering/Models/ChickenModel.h b/Minecraft.Client/net/minecraft/client/model/ChickenModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/ChickenModel.h rename to Minecraft.Client/net/minecraft/client/model/ChickenModel.h index 7180802fe..87a130607 100644 --- a/Minecraft.Client/Rendering/Models/ChickenModel.h +++ b/Minecraft.Client/net/minecraft/client/model/ChickenModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class ChickenModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/CowModel.cpp b/Minecraft.Client/net/minecraft/client/model/CowModel.cpp similarity index 90% rename from Minecraft.Client/Rendering/Models/CowModel.cpp rename to Minecraft.Client/net/minecraft/client/model/CowModel.cpp index 78efcd2a6..9b57577e2 100644 --- a/Minecraft.Client/Rendering/Models/CowModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/CowModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "CowModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" CowModel::CowModel() : QuadrupedModel(12, 0) { head = new ModelPart(this, 0, 0); diff --git a/Minecraft.Client/Rendering/Models/CowModel.h b/Minecraft.Client/net/minecraft/client/model/CowModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/CowModel.h rename to Minecraft.Client/net/minecraft/client/model/CowModel.h diff --git a/Minecraft.Client/Rendering/Models/CreeperModel.cpp b/Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp similarity index 94% rename from Minecraft.Client/Rendering/Models/CreeperModel.cpp rename to Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp index c8c970f2e..6b3f433bc 100644 --- a/Minecraft.Client/Rendering/Models/CreeperModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "CreeperModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" // 4J - added void CreeperModel::_init(float g) { diff --git a/Minecraft.Client/Rendering/Models/CreeperModel.h b/Minecraft.Client/net/minecraft/client/model/CreeperModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/CreeperModel.h rename to Minecraft.Client/net/minecraft/client/model/CreeperModel.h index 9c119e2fa..7ebe59de2 100644 --- a/Minecraft.Client/Rendering/Models/CreeperModel.h +++ b/Minecraft.Client/net/minecraft/client/model/CreeperModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class CreeperModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/EnderManModel.cpp b/Minecraft.Client/net/minecraft/client/model/EndermanModel.cpp similarity index 96% rename from Minecraft.Client/Rendering/Models/EnderManModel.cpp rename to Minecraft.Client/net/minecraft/client/model/EndermanModel.cpp index 0e0d5f25b..7fc8610f4 100644 --- a/Minecraft.Client/Rendering/Models/EnderManModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/EndermanModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "EnderManModel.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "EndermanModel.h" +#include "geom/ModelPart.h" EndermanModel::EndermanModel() : HumanoidModel(0, -14, 64, 32) { carrying = false; diff --git a/Minecraft.Client/Rendering/Models/EnderManModel.h b/Minecraft.Client/net/minecraft/client/model/EndermanModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/EnderManModel.h rename to Minecraft.Client/net/minecraft/client/model/EndermanModel.h diff --git a/Minecraft.Client/Rendering/Models/GhastModel.cpp b/Minecraft.Client/net/minecraft/client/model/GhastModel.cpp similarity index 89% rename from Minecraft.Client/Rendering/Models/GhastModel.cpp rename to Minecraft.Client/net/minecraft/client/model/GhastModel.cpp index 252f7ca3c..c2fa3a6d7 100644 --- a/Minecraft.Client/Rendering/Models/GhastModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/GhastModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "GhastModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" GhastModel::GhastModel() : Model() { int yoffs = -16; diff --git a/Minecraft.Client/Rendering/Models/GhastModel.h b/Minecraft.Client/net/minecraft/client/model/GhastModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/GhastModel.h rename to Minecraft.Client/net/minecraft/client/model/GhastModel.h index 64aca2e46..ab7c6a823 100644 --- a/Minecraft.Client/Rendering/Models/GhastModel.h +++ b/Minecraft.Client/net/minecraft/client/model/GhastModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class GhastModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/HumanoidModel.cpp b/Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp similarity index 98% rename from Minecraft.Client/Rendering/Models/HumanoidModel.cpp rename to Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp index 6734b8388..e90361d7a 100644 --- a/Minecraft.Client/Rendering/Models/HumanoidModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "HumanoidModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Entities/Entity.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "geom/ModelPart.h" // 4J added diff --git a/Minecraft.Client/Rendering/Models/HumanoidModel.h b/Minecraft.Client/net/minecraft/client/model/HumanoidModel.h similarity index 99% rename from Minecraft.Client/Rendering/Models/HumanoidModel.h rename to Minecraft.Client/net/minecraft/client/model/HumanoidModel.h index 3d5c06fb8..6f452966c 100644 --- a/Minecraft.Client/Rendering/Models/HumanoidModel.h +++ b/Minecraft.Client/net/minecraft/client/model/HumanoidModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class HumanoidModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/LargeChestModel.cpp b/Minecraft.Client/net/minecraft/client/model/LargeChestModel.cpp similarity index 89% rename from Minecraft.Client/Rendering/Models/LargeChestModel.cpp rename to Minecraft.Client/net/minecraft/client/model/LargeChestModel.cpp index f9a11082a..e859292c1 100644 --- a/Minecraft.Client/Rendering/Models/LargeChestModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/LargeChestModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LargeChestModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" LargeChestModel::LargeChestModel() { lid = ((new ModelPart(this, 0, 0)))->setTexSize(128, 64); diff --git a/Minecraft.Client/Rendering/Models/LargeChestModel.h b/Minecraft.Client/net/minecraft/client/model/LargeChestModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/LargeChestModel.h rename to Minecraft.Client/net/minecraft/client/model/LargeChestModel.h diff --git a/Minecraft.Client/Rendering/Models/LavaSlimeModel.cpp b/Minecraft.Client/net/minecraft/client/model/LavaSlimeModel.cpp similarity index 87% rename from Minecraft.Client/Rendering/Models/LavaSlimeModel.cpp rename to Minecraft.Client/net/minecraft/client/model/LavaSlimeModel.cpp index cf91175ee..d59bf1d37 100644 --- a/Minecraft.Client/Rendering/Models/LavaSlimeModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/LavaSlimeModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "LavaSlimeModel.h" -#include "ModelPart.h" -#include "../../../Minecraft.World/Entities/Mobs/LavaSlime.h" +#include "geom/ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/LavaSlime.h" LavaSlimeModel::LavaSlimeModel() { for (int i = 0; i < BODYCUBESLENGTH; i++) { diff --git a/Minecraft.Client/Rendering/Models/LavaSlimeModel.h b/Minecraft.Client/net/minecraft/client/model/LavaSlimeModel.h similarity index 95% rename from Minecraft.Client/Rendering/Models/LavaSlimeModel.h rename to Minecraft.Client/net/minecraft/client/model/LavaSlimeModel.h index ef15cc39b..ae5e4babd 100644 --- a/Minecraft.Client/Rendering/Models/LavaSlimeModel.h +++ b/Minecraft.Client/net/minecraft/client/model/LavaSlimeModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class LavaSlimeModel : public Model { static const int BODYCUBESLENGTH = 8; diff --git a/Minecraft.Client/Rendering/Models/LeashKnotModel.cpp b/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp similarity index 92% rename from Minecraft.Client/Rendering/Models/LeashKnotModel.cpp rename to Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp index 2d45af79b..6e4294428 100644 --- a/Minecraft.Client/Rendering/Models/LeashKnotModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LeashKnotModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" LeashKnotModel::LeashKnotModel() { _init(0, 0, 32, 32); } diff --git a/Minecraft.Client/Rendering/Models/LeashKnotModel.h b/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/LeashKnotModel.h rename to Minecraft.Client/net/minecraft/client/model/LeashKnotModel.h index 850ba7e1f..9eedff3b5 100644 --- a/Minecraft.Client/Rendering/Models/LeashKnotModel.h +++ b/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class LeashKnotModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/MinecartModel.cpp b/Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp similarity index 95% rename from Minecraft.Client/Rendering/Models/MinecartModel.cpp rename to Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp index 1feb9ab3b..57fe3f084 100644 --- a/Minecraft.Client/Rendering/Models/MinecartModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "MinecartModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" MinecartModel::MinecartModel() : Model() { cubes[0] = new ModelPart(this, 0, 10); diff --git a/Minecraft.Client/Rendering/Models/MinecartModel.h b/Minecraft.Client/net/minecraft/client/model/MinecartModel.h similarity index 93% rename from Minecraft.Client/Rendering/Models/MinecartModel.h rename to Minecraft.Client/net/minecraft/client/model/MinecartModel.h index 13b7cf69e..6f3d13b3a 100644 --- a/Minecraft.Client/Rendering/Models/MinecartModel.h +++ b/Minecraft.Client/net/minecraft/client/model/MinecartModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class MinecartModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/ModelHorse.cpp b/Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp similarity index 98% rename from Minecraft.Client/Rendering/Models/ModelHorse.cpp rename to Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp index f036f6082..cfc25ef07 100644 --- a/Minecraft.Client/Rendering/Models/ModelHorse.cpp +++ b/Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" #include "ModelHorse.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" ModelHorse::ModelHorse() { texWidth = 128; diff --git a/Minecraft.Client/Rendering/Models/ModelHorse.h b/Minecraft.Client/net/minecraft/client/model/ModelHorse.h similarity index 98% rename from Minecraft.Client/Rendering/Models/ModelHorse.h rename to Minecraft.Client/net/minecraft/client/model/ModelHorse.h index a200b873d..768a86e79 100644 --- a/Minecraft.Client/Rendering/Models/ModelHorse.h +++ b/Minecraft.Client/net/minecraft/client/model/ModelHorse.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class ModelHorse : public Model { private: diff --git a/Minecraft.Client/Rendering/Models/OcelotModel.cpp b/Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp similarity index 96% rename from Minecraft.Client/Rendering/Models/OcelotModel.cpp rename to Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp index afafef9a4..7c5f7a14b 100644 --- a/Minecraft.Client/Rendering/Models/OcelotModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "ModelPart.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "geom/ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "OcelotModel.h" const float OcelotModel::xo = 0; diff --git a/Minecraft.Client/Rendering/Models/OcelotModel.h b/Minecraft.Client/net/minecraft/client/model/OcelotModel.h similarity index 98% rename from Minecraft.Client/Rendering/Models/OcelotModel.h rename to Minecraft.Client/net/minecraft/client/model/OcelotModel.h index 774a34662..b5447f840 100644 --- a/Minecraft.Client/Rendering/Models/OcelotModel.h +++ b/Minecraft.Client/net/minecraft/client/model/OcelotModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class OcelotModel : public Model { private: diff --git a/Minecraft.Client/Rendering/Models/PigModel.cpp b/Minecraft.Client/net/minecraft/client/model/PigModel.cpp similarity index 80% rename from Minecraft.Client/Rendering/Models/PigModel.cpp rename to Minecraft.Client/net/minecraft/client/model/PigModel.cpp index eb5308133..3d141e11e 100644 --- a/Minecraft.Client/Rendering/Models/PigModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/PigModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "PigModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" PigModel::PigModel() : QuadrupedModel(6, 0) { head->texOffs(16, 16)->addBox(-2.0f, 0.0f, -9.0f, 4, 3, 1, 0.0f); diff --git a/Minecraft.Client/Rendering/Models/PigModel.h b/Minecraft.Client/net/minecraft/client/model/PigModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/PigModel.h rename to Minecraft.Client/net/minecraft/client/model/PigModel.h diff --git a/Minecraft.Client/Rendering/Polygon.cpp b/Minecraft.Client/net/minecraft/client/model/Polygon.cpp similarity index 98% rename from Minecraft.Client/Rendering/Polygon.cpp rename to Minecraft.Client/net/minecraft/client/model/Polygon.cpp index d0de18504..e30a668c0 100644 --- a/Minecraft.Client/Rendering/Polygon.cpp +++ b/Minecraft.Client/net/minecraft/client/model/Polygon.cpp @@ -1,4 +1,4 @@ -#include "Rendering/Vertex.h" +#include "Vertex.h" #include "Polygon.h" #include #include diff --git a/Minecraft.Client/Rendering/Polygon.h b/Minecraft.Client/net/minecraft/client/model/Polygon.h similarity index 84% rename from Minecraft.Client/Rendering/Polygon.h rename to Minecraft.Client/net/minecraft/client/model/Polygon.h index c56306533..b0747fa8a 100644 --- a/Minecraft.Client/Rendering/Polygon.h +++ b/Minecraft.Client/net/minecraft/client/model/Polygon.h @@ -3,8 +3,8 @@ #include #include #include "Vertex.h" -#include "Tesselator.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" class _Polygon { public: diff --git a/Minecraft.Client/Rendering/Models/QuadrupedModel.cpp b/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp similarity index 96% rename from Minecraft.Client/Rendering/Models/QuadrupedModel.cpp rename to Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp index b6fa90fa2..eb1eeadd3 100644 --- a/Minecraft.Client/Rendering/Models/QuadrupedModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "QuadrupedModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" QuadrupedModel::QuadrupedModel(int legSize, float g) : Model() { yHeadOffs = 8; diff --git a/Minecraft.Client/Rendering/Models/QuadrupedModel.h b/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/QuadrupedModel.h rename to Minecraft.Client/net/minecraft/client/model/QuadrupedModel.h index 7346510ee..b890269fe 100644 --- a/Minecraft.Client/Rendering/Models/QuadrupedModel.h +++ b/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class QuadrupedModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/SheepFurModel.cpp b/Minecraft.Client/net/minecraft/client/model/SheepFurModel.cpp similarity index 90% rename from Minecraft.Client/Rendering/Models/SheepFurModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SheepFurModel.cpp index add8aa551..1a54c7872 100644 --- a/Minecraft.Client/Rendering/Models/SheepFurModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SheepFurModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" #include "SheepFurModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" SheepFurModel::SheepFurModel() : QuadrupedModel(12, 0) { headXRot = 0.0f; diff --git a/Minecraft.Client/Rendering/Models/SheepFurModel.h b/Minecraft.Client/net/minecraft/client/model/SheepFurModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/SheepFurModel.h rename to Minecraft.Client/net/minecraft/client/model/SheepFurModel.h diff --git a/Minecraft.Client/Rendering/Models/SheepModel.cpp b/Minecraft.Client/net/minecraft/client/model/SheepModel.cpp similarity index 85% rename from Minecraft.Client/Rendering/Models/SheepModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SheepModel.cpp index 986bd3088..a817bbe80 100644 --- a/Minecraft.Client/Rendering/Models/SheepModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SheepModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" #include "SheepModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" SheepModel::SheepModel() : QuadrupedModel(12, 0) { headXRot = 0.0f; diff --git a/Minecraft.Client/Rendering/Models/SheepModel.h b/Minecraft.Client/net/minecraft/client/model/SheepModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/SheepModel.h rename to Minecraft.Client/net/minecraft/client/model/SheepModel.h diff --git a/Minecraft.Client/Rendering/Models/SignModel.cpp b/Minecraft.Client/net/minecraft/client/model/SignModel.cpp similarity index 84% rename from Minecraft.Client/Rendering/Models/SignModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SignModel.cpp index 4b72bbbd0..1c87b5d79 100644 --- a/Minecraft.Client/Rendering/Models/SignModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SignModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SignModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" SignModel::SignModel() { cube = new ModelPart(this, 0, 0); diff --git a/Minecraft.Client/Rendering/Models/SignModel.h b/Minecraft.Client/net/minecraft/client/model/SignModel.h similarity index 88% rename from Minecraft.Client/Rendering/Models/SignModel.h rename to Minecraft.Client/net/minecraft/client/model/SignModel.h index 3c2d26d22..f637bfa0a 100644 --- a/Minecraft.Client/Rendering/Models/SignModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SignModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class Cube; diff --git a/Minecraft.Client/Rendering/Models/SilverfishModel.cpp b/Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp similarity index 94% rename from Minecraft.Client/Rendering/Models/SilverfishModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp index 89b8c3c03..1e205e479 100644 --- a/Minecraft.Client/Rendering/Models/SilverfishModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SilverfishModel.h" -#include "../Cube.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "geom/Cube.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" const int SilverfishModel::BODY_SIZES[BODY_COUNT][3] = { {3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}, diff --git a/Minecraft.Client/Rendering/Models/SilverfishModel.h b/Minecraft.Client/net/minecraft/client/model/SilverfishModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/SilverfishModel.h rename to Minecraft.Client/net/minecraft/client/model/SilverfishModel.h index c3c74e623..5e4d1028f 100644 --- a/Minecraft.Client/Rendering/Models/SilverfishModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SilverfishModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class SilverfishModel : public Model { private: diff --git a/Minecraft.Client/Rendering/Models/SkeletonHeadModel.cpp b/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp similarity index 94% rename from Minecraft.Client/Rendering/Models/SkeletonHeadModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp index 4a251f2e1..da2c42bec 100644 --- a/Minecraft.Client/Rendering/Models/SkeletonHeadModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "geom/ModelPart.h" #include "SkeletonHeadModel.h" void SkeletonHeadModel::_init(int u, int v, int tw, int th) { diff --git a/Minecraft.Client/Rendering/Models/SkeletonHeadModel.h b/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/SkeletonHeadModel.h rename to Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.h index 32e6fa035..2edc9bb24 100644 --- a/Minecraft.Client/Rendering/Models/SkeletonHeadModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class SkeletonHeadModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/SkeletonModel.cpp b/Minecraft.Client/net/minecraft/client/model/SkeletonModel.cpp similarity index 86% rename from Minecraft.Client/Rendering/Models/SkeletonModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SkeletonModel.cpp index b90cf661c..0ef75c835 100644 --- a/Minecraft.Client/Rendering/Models/SkeletonModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SkeletonModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SkeletonModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "geom/ModelPart.h" void SkeletonModel::_init(float g) { arm0 = new ModelPart(this, 24 + 16, 16); diff --git a/Minecraft.Client/Rendering/Models/SkeletonModel.h b/Minecraft.Client/net/minecraft/client/model/SkeletonModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/SkeletonModel.h rename to Minecraft.Client/net/minecraft/client/model/SkeletonModel.h diff --git a/Minecraft.Client/Rendering/Models/SkiModel.cpp b/Minecraft.Client/net/minecraft/client/model/SkiModel.cpp similarity index 96% rename from Minecraft.Client/Rendering/Models/SkiModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SkiModel.cpp index 5fca00390..aa159ac3d 100644 --- a/Minecraft.Client/Rendering/Models/SkiModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SkiModel.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SkiModel.h" SkiModel::SkiModel() { _init(false); } diff --git a/Minecraft.Client/Rendering/Models/SkiModel.h b/Minecraft.Client/net/minecraft/client/model/SkiModel.h similarity index 91% rename from Minecraft.Client/Rendering/Models/SkiModel.h rename to Minecraft.Client/net/minecraft/client/model/SkiModel.h index 29502440f..f82119102 100644 --- a/Minecraft.Client/Rendering/Models/SkiModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SkiModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" -#include "ModelPart.h" +#include "geom/Model.h" +#include "geom/ModelPart.h" class SkiModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/SlimeModel.cpp b/Minecraft.Client/net/minecraft/client/model/SlimeModel.cpp similarity index 93% rename from Minecraft.Client/Rendering/Models/SlimeModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SlimeModel.cpp index 4c8cb0afc..391e88b46 100644 --- a/Minecraft.Client/Rendering/Models/SlimeModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SlimeModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SlimeModel.h" -#include "ModelPart.h" +#include "geom/ModelPart.h" SlimeModel::SlimeModel(int vOffs) { cube = new ModelPart(this, 0, vOffs); diff --git a/Minecraft.Client/Rendering/Models/SlimeModel.h b/Minecraft.Client/net/minecraft/client/model/SlimeModel.h similarity index 93% rename from Minecraft.Client/Rendering/Models/SlimeModel.h rename to Minecraft.Client/net/minecraft/client/model/SlimeModel.h index c9c8cadcb..8bd09ccfa 100644 --- a/Minecraft.Client/Rendering/Models/SlimeModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SlimeModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class SlimeModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/SnowManModel.cpp b/Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp similarity index 93% rename from Minecraft.Client/Rendering/Models/SnowManModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp index 039f88654..f24aa4d14 100644 --- a/Minecraft.Client/Rendering/Models/SnowManModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SnowManModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" SnowManModel::SnowManModel() : Model() { float yOffset = 4; diff --git a/Minecraft.Client/Rendering/Models/SnowManModel.h b/Minecraft.Client/net/minecraft/client/model/SnowManModel.h similarity index 95% rename from Minecraft.Client/Rendering/Models/SnowManModel.h rename to Minecraft.Client/net/minecraft/client/model/SnowManModel.h index 5279edc95..ce972545c 100644 --- a/Minecraft.Client/Rendering/Models/SnowManModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SnowManModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class SnowManModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/SpiderModel.cpp b/Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp similarity index 96% rename from Minecraft.Client/Rendering/Models/SpiderModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp index 538009d1a..ec16c2590 100644 --- a/Minecraft.Client/Rendering/Models/SpiderModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SpiderModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" SpiderModel::SpiderModel() : Model() { float g = 0; diff --git a/Minecraft.Client/Rendering/Models/SpiderModel.h b/Minecraft.Client/net/minecraft/client/model/SpiderModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/SpiderModel.h rename to Minecraft.Client/net/minecraft/client/model/SpiderModel.h index 271866e9d..b5325fbbf 100644 --- a/Minecraft.Client/Rendering/Models/SpiderModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SpiderModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class SpiderModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/SquidModel.cpp b/Minecraft.Client/net/minecraft/client/model/SquidModel.cpp similarity index 92% rename from Minecraft.Client/Rendering/Models/SquidModel.cpp rename to Minecraft.Client/net/minecraft/client/model/SquidModel.cpp index 34c942132..d7e4cd29c 100644 --- a/Minecraft.Client/Rendering/Models/SquidModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/SquidModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SquidModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" SquidModel::SquidModel() : Model() { int yoffs = -16; diff --git a/Minecraft.Client/Rendering/Models/SquidModel.h b/Minecraft.Client/net/minecraft/client/model/SquidModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/SquidModel.h rename to Minecraft.Client/net/minecraft/client/model/SquidModel.h index 80c769969..f10a0b23a 100644 --- a/Minecraft.Client/Rendering/Models/SquidModel.h +++ b/Minecraft.Client/net/minecraft/client/model/SquidModel.h @@ -1,5 +1,5 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class SquidModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Vertex.cpp b/Minecraft.Client/net/minecraft/client/model/Vertex.cpp similarity index 100% rename from Minecraft.Client/Rendering/Vertex.cpp rename to Minecraft.Client/net/minecraft/client/model/Vertex.cpp diff --git a/Minecraft.Client/Rendering/Vertex.h b/Minecraft.Client/net/minecraft/client/model/Vertex.h similarity index 84% rename from Minecraft.Client/Rendering/Vertex.h rename to Minecraft.Client/net/minecraft/client/model/Vertex.h index b0437b9ba..83988d877 100644 --- a/Minecraft.Client/Rendering/Vertex.h +++ b/Minecraft.Client/net/minecraft/client/model/Vertex.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Util/Vec3.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" class Vertex { public: diff --git a/Minecraft.Client/Rendering/Models/VillagerGolemModel.cpp b/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp similarity index 94% rename from Minecraft.Client/Rendering/Models/VillagerGolemModel.cpp rename to Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp index 07172fefb..d4bb46ce6 100644 --- a/Minecraft.Client/Rendering/Models/VillagerGolemModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "geom/ModelPart.h" #include "VillagerGolemModel.h" VillagerGolemModel::VillagerGolemModel(float g, float yOffset) { diff --git a/Minecraft.Client/Rendering/Models/VillagerGolemModel.h b/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.h similarity index 97% rename from Minecraft.Client/Rendering/Models/VillagerGolemModel.h rename to Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.h index fda66b16b..f9c487e71 100644 --- a/Minecraft.Client/Rendering/Models/VillagerGolemModel.h +++ b/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class ModelPart; diff --git a/Minecraft.Client/Rendering/Models/VillagerModel.cpp b/Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp similarity index 94% rename from Minecraft.Client/Rendering/Models/VillagerModel.cpp rename to Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp index 31b8fc383..d3e1df029 100644 --- a/Minecraft.Client/Rendering/Models/VillagerModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "VillagerModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" void VillagerModel::_init(float g, float yOffset, int xTexSize, int yTexSize) { head = (new ModelPart(this))->setTexSize(xTexSize, yTexSize); diff --git a/Minecraft.Client/Rendering/Models/VillagerModel.h b/Minecraft.Client/net/minecraft/client/model/VillagerModel.h similarity index 96% rename from Minecraft.Client/Rendering/Models/VillagerModel.h rename to Minecraft.Client/net/minecraft/client/model/VillagerModel.h index 46b104fb4..ee52cb7ae 100644 --- a/Minecraft.Client/Rendering/Models/VillagerModel.h +++ b/Minecraft.Client/net/minecraft/client/model/VillagerModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" +#include "geom/Model.h" class VillagerModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/VillagerZombieModel.cpp b/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp similarity index 92% rename from Minecraft.Client/Rendering/Models/VillagerZombieModel.cpp rename to Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp index 221daa9f4..d5705f2ef 100644 --- a/Minecraft.Client/Rendering/Models/VillagerZombieModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "geom/ModelPart.h" #include "VillagerZombieModel.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" void VillagerZombieModel::_init(float g, float yOffset, bool isArmor) { delete head; diff --git a/Minecraft.Client/Rendering/Models/VillagerZombieModel.h b/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/VillagerZombieModel.h rename to Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.h diff --git a/Minecraft.Client/Rendering/Models/WitchModel.cpp b/Minecraft.Client/net/minecraft/client/model/WitchModel.cpp similarity index 93% rename from Minecraft.Client/Rendering/Models/WitchModel.cpp rename to Minecraft.Client/net/minecraft/client/model/WitchModel.cpp index 20121428c..fdfdbb09f 100644 --- a/Minecraft.Client/Rendering/Models/WitchModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/WitchModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "geom/ModelPart.h" #include "WitchModel.h" #include "VillagerModel.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" WitchModel::WitchModel(float g) : VillagerModel(g, 0, 64, 128) { mole = (new ModelPart(this))->setTexSize(64, 128); diff --git a/Minecraft.Client/Rendering/Models/WitchModel.h b/Minecraft.Client/net/minecraft/client/model/WitchModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/WitchModel.h rename to Minecraft.Client/net/minecraft/client/model/WitchModel.h diff --git a/Minecraft.Client/Rendering/Models/WitherBossModel.cpp b/Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp similarity index 93% rename from Minecraft.Client/Rendering/Models/WitherBossModel.cpp rename to Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp index d73a06857..de56c36ec 100644 --- a/Minecraft.Client/Rendering/Models/WitherBossModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "WitherBossModel.h" -#include "../../../Minecraft.World/Entities/Mobs/WitherBoss.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.h" +#include "geom/ModelPart.h" WitherBossModel::WitherBossModel() { texWidth = 64; diff --git a/Minecraft.Client/Rendering/Models/WitherBossModel.h b/Minecraft.Client/net/minecraft/client/model/WitherBossModel.h similarity index 93% rename from Minecraft.Client/Rendering/Models/WitherBossModel.h rename to Minecraft.Client/net/minecraft/client/model/WitherBossModel.h index 426e619e2..b0f090ffb 100644 --- a/Minecraft.Client/Rendering/Models/WitherBossModel.h +++ b/Minecraft.Client/net/minecraft/client/model/WitherBossModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" -#include "ModelPart.h" +#include "geom/Model.h" +#include "geom/ModelPart.h" class WitherBossModel : public Model { private: diff --git a/Minecraft.Client/Rendering/Models/WolfModel.cpp b/Minecraft.Client/net/minecraft/client/model/WolfModel.cpp similarity index 95% rename from Minecraft.Client/Rendering/Models/WolfModel.cpp rename to Minecraft.Client/net/minecraft/client/model/WolfModel.cpp index 592781450..e586da7d0 100644 --- a/Minecraft.Client/Rendering/Models/WolfModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/WolfModel.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "WolfModel.h" -#include "../../../Minecraft.World/Entities/Mobs/Wolf.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/Wolf.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" WolfModel::WolfModel() { float g = 0; diff --git a/Minecraft.Client/Rendering/Models/WolfModel.h b/Minecraft.Client/net/minecraft/client/model/WolfModel.h similarity index 89% rename from Minecraft.Client/Rendering/Models/WolfModel.h rename to Minecraft.Client/net/minecraft/client/model/WolfModel.h index ced758eca..64c6916ce 100644 --- a/Minecraft.Client/Rendering/Models/WolfModel.h +++ b/Minecraft.Client/net/minecraft/client/model/WolfModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" -#include "../../../Minecraft.World/Entities/Mob.h" +#include "geom/Model.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/Mob.h" class WolfModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/ZombieModel.cpp b/Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp similarity index 89% rename from Minecraft.Client/Rendering/Models/ZombieModel.cpp rename to Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp index a6213c8c9..a7a38695e 100644 --- a/Minecraft.Client/Rendering/Models/ZombieModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ZombieModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "ModelPart.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "geom/ModelPart.h" ZombieModel::ZombieModel() : HumanoidModel(0, 0, 64, 32) {} diff --git a/Minecraft.Client/Rendering/Models/ZombieModel.h b/Minecraft.Client/net/minecraft/client/model/ZombieModel.h similarity index 100% rename from Minecraft.Client/Rendering/Models/ZombieModel.h rename to Minecraft.Client/net/minecraft/client/model/ZombieModel.h diff --git a/Minecraft.Client/Rendering/Models/DragonModel.cpp b/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp similarity index 97% rename from Minecraft.Client/Rendering/Models/DragonModel.cpp rename to Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp index 51eebc1b0..0fcd901cf 100644 --- a/Minecraft.Client/Rendering/Models/DragonModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "DragonModel.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Entities/Mobs/EnderDragon.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.h" DragonModel::DragonModel(float g) : Model() { // 4J-PB diff --git a/Minecraft.Client/Rendering/Models/DragonModel.h b/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.h similarity index 93% rename from Minecraft.Client/Rendering/Models/DragonModel.h rename to Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.h index 0dd52f588..670dcfa1d 100644 --- a/Minecraft.Client/Rendering/Models/DragonModel.h +++ b/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" -#include "ModelPart.h" +#include "../geom/Model.h" +#include "../geom/ModelPart.h" class DragonModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Models/EnderCrystalModel.cpp b/Minecraft.Client/net/minecraft/client/model/dragon/EnderCrystalModel.cpp similarity index 95% rename from Minecraft.Client/Rendering/Models/EnderCrystalModel.cpp rename to Minecraft.Client/net/minecraft/client/model/dragon/EnderCrystalModel.cpp index 3d6cf075b..1f644bde1 100644 --- a/Minecraft.Client/Rendering/Models/EnderCrystalModel.cpp +++ b/Minecraft.Client/net/minecraft/client/model/dragon/EnderCrystalModel.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "EnderCrystalModel.h" EnderCrystalModel::EnderCrystalModel(float g) { diff --git a/Minecraft.Client/Rendering/Models/EnderCrystalModel.h b/Minecraft.Client/net/minecraft/client/model/dragon/EnderCrystalModel.h similarity index 87% rename from Minecraft.Client/Rendering/Models/EnderCrystalModel.h rename to Minecraft.Client/net/minecraft/client/model/dragon/EnderCrystalModel.h index ead865977..68bb52d10 100644 --- a/Minecraft.Client/Rendering/Models/EnderCrystalModel.h +++ b/Minecraft.Client/net/minecraft/client/model/dragon/EnderCrystalModel.h @@ -1,6 +1,6 @@ #pragma once -#include "Model.h" -#include "ModelPart.h" +#include "../geom/Model.h" +#include "../geom/ModelPart.h" class EnderCrystalModel : public Model { public: diff --git a/Minecraft.Client/Rendering/Cube.cpp b/Minecraft.Client/net/minecraft/client/model/geom/Cube.cpp similarity index 96% rename from Minecraft.Client/Rendering/Cube.cpp rename to Minecraft.Client/net/minecraft/client/model/geom/Cube.cpp index b091fa158..faab6a9da 100644 --- a/Minecraft.Client/Rendering/Cube.cpp +++ b/Minecraft.Client/net/minecraft/client/model/geom/Cube.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "Models/Model.h" -#include "Models/ModelPart.h" -#include "Rendering/Vertex.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "Model.h" +#include "ModelPart.h" +#include "../Vertex.h" #include "Cube.h" #include diff --git a/Minecraft.Client/Rendering/Cube.h b/Minecraft.Client/net/minecraft/client/model/geom/Cube.h similarity index 81% rename from Minecraft.Client/Rendering/Cube.h rename to Minecraft.Client/net/minecraft/client/model/geom/Cube.h index 9075d0950..5a3fca7de 100644 --- a/Minecraft.Client/Rendering/Cube.h +++ b/Minecraft.Client/net/minecraft/client/model/geom/Cube.h @@ -1,9 +1,9 @@ #pragma once #include #include -#include "../../Minecraft.World/Util/ArrayWithLength.h" -#include "Vertex.h" -#include "Polygon.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +#include "../Vertex.h" +#include "../Polygon.h" class Model; diff --git a/Minecraft.Client/Rendering/Models/Model.cpp b/Minecraft.Client/net/minecraft/client/model/geom/Model.cpp similarity index 79% rename from Minecraft.Client/Rendering/Models/Model.cpp rename to Minecraft.Client/net/minecraft/client/model/geom/Model.cpp index 788738bd5..2f526e43d 100644 --- a/Minecraft.Client/Rendering/Models/Model.cpp +++ b/Minecraft.Client/net/minecraft/client/model/geom/Model.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../TexOffs.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "TexOffs.h" #include "Model.h" Model::Model() { diff --git a/Minecraft.Client/Rendering/Models/Model.h b/Minecraft.Client/net/minecraft/client/model/geom/Model.h similarity index 91% rename from Minecraft.Client/Rendering/Models/Model.h rename to Minecraft.Client/net/minecraft/client/model/geom/Model.h index 129eab6b5..73595a0f8 100644 --- a/Minecraft.Client/Rendering/Models/Model.h +++ b/Minecraft.Client/net/minecraft/client/model/geom/Model.h @@ -1,7 +1,7 @@ #pragma once -#include "../../../Minecraft.World/Util/Random.h" -#include "SkinBox.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Header Files/SkinBox.h" class Mob; class ModelPart; class TexOffs; diff --git a/Minecraft.Client/Rendering/Models/ModelPart.cpp b/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp similarity index 98% rename from Minecraft.Client/Rendering/Models/ModelPart.cpp rename to Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp index 01d4ab249..f854895fb 100644 --- a/Minecraft.Client/Rendering/Models/ModelPart.cpp +++ b/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../TexOffs.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "TexOffs.h" #include "ModelPart.h" -#include "../Cube.h" +#include "Cube.h" const float ModelPart::RAD = (180.0f / PI); diff --git a/Minecraft.Client/Rendering/Models/ModelPart.h b/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.h similarity index 94% rename from Minecraft.Client/Rendering/Models/ModelPart.h rename to Minecraft.Client/net/minecraft/client/model/geom/ModelPart.h index 778420184..c1df1e1e9 100644 --- a/Minecraft.Client/Rendering/Models/ModelPart.h +++ b/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.h @@ -1,9 +1,9 @@ #pragma once -#include "../../../Minecraft.World/Util/ArrayWithLength.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" #include "../Vertex.h" #include "../Polygon.h" #include "Model.h" -#include "./SkinBox.h" +#include "../../../../../Header Files/SkinBox.h" class Cube; diff --git a/Minecraft.Client/Rendering/TexOffs.cpp b/Minecraft.Client/net/minecraft/client/model/geom/TexOffs.cpp similarity index 50% rename from Minecraft.Client/Rendering/TexOffs.cpp rename to Minecraft.Client/net/minecraft/client/model/geom/TexOffs.cpp index 4cb40a021..01577c5b6 100644 --- a/Minecraft.Client/Rendering/TexOffs.cpp +++ b/Minecraft.Client/net/minecraft/client/model/geom/TexOffs.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TexOffs.h" TexOffs::TexOffs(int x, int y) : x(x), y(y) {} \ No newline at end of file diff --git a/Minecraft.Client/Rendering/TexOffs.h b/Minecraft.Client/net/minecraft/client/model/geom/TexOffs.h similarity index 100% rename from Minecraft.Client/Rendering/TexOffs.h rename to Minecraft.Client/net/minecraft/client/model/geom/TexOffs.h diff --git a/Minecraft.Client/Network/ClientConnection.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp similarity index 97% rename from Minecraft.Client/Network/ClientConnection.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp index bbb0adc98..5ed082ce5 100644 --- a/Minecraft.Client/Network/ClientConnection.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp @@ -1,54 +1,54 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ClientConnection.h" #include #include -#include "../Level/MultiPlayerLevel.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "../GameState/StatsCounter.h" -#include "../UI/Screens/ReceivingLevelScreen.h" -#include "../Player/RemotePlayer.h" -#include "../UI/Screens/DisconnectedScreen.h" -#include "../Rendering/Particles/TakeAnimationParticle.h" -#include "../Rendering/Particles/CritParticle.h" -#include "../Player/User.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.npc.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.global.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.saveddata.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.food.h" -#include "../../Minecraft.World/Util/SharedConstants.h" -#include "../../Minecraft.World/Util/AABB.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Network/Socket.h" +#include "MultiPlayerLevel.h" +#include "MultiPlayerLocalPlayer.h" +#include "../../stats/StatsCounter.h" +#include "ReceivingLevelScreen.h" +#include "../player/RemotePlayer.h" +#include "DisconnectedScreen.h" +#include "../particle/TakeAnimationParticle.h" +#include "../particle/CritParticle.h" +#include "../User.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Socket.h" #include "../Minecraft.h" -#include "../Rendering/EntityRenderers/ProgressRenderer.h" -#include "../Rendering/LevelRenderer.h" -#include "../GameState/Options.h" -#include "../MinecraftServer.h" +#include "../ProgressRenderer.h" +#include "../renderer/LevelRenderer.h" +#include "../Options.h" +#include "../../server/MinecraftServer.h" #include "../ClientConstants.h" -#include "../../Minecraft.World/Util/SoundTypes.h" -#include "../Textures/Packs/TexturePackRepository.h" -#include "UI/Screens/MerchantScreen.h" -#include "../Platform/Common/UI/UI.h" -#include "../Textures/Packs/DLCTexturePack.h" +#include "../../../../../Minecraft.World/Header Files/SoundTypes.h" +#include "../skins/TexturePackRepository.h" +#include "../gui/MerchantScreen.h" +#include "../../../../Common/Source Files/UI/UI.h" +#include "../skins/DLCTexturePack.h" ClientConnection::ClientConnection(Minecraft* minecraft, const std::wstring& ip, int port) { diff --git a/Minecraft.Client/Network/ClientConnection.h b/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.h similarity index 99% rename from Minecraft.Client/Network/ClientConnection.h rename to Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.h index b1deb132f..de46631d6 100644 --- a/Minecraft.Client/Network/ClientConnection.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Headers/net.minecraft.network.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" class Minecraft; class MultiPlayerLevel; class SavedDataStorage; diff --git a/Minecraft.Client/UI/Screens/ConnectScreen.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/ConnectScreen.cpp similarity index 86% rename from Minecraft.Client/UI/Screens/ConnectScreen.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/ConnectScreen.cpp index 9b861b78a..29ba0273b 100644 --- a/Minecraft.Client/UI/Screens/ConnectScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/ConnectScreen.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ConnectScreen.h" -#include "../../Network/ClientConnection.h" -#include "TitleScreen.h" -#include "../Button.h" -#include "../../Minecraft.h" -#include "../../Player/User.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "ClientConnection.h" +#include "../title/TitleScreen.h" +#include "../gui/Button.h" +#include "../Minecraft.h" +#include "../User.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" ConnectScreen::ConnectScreen(Minecraft* minecraft, const std::wstring& ip, int port) { diff --git a/Minecraft.Client/UI/Screens/ConnectScreen.h b/Minecraft.Client/net/minecraft/client/multiplayer/ConnectScreen.h similarity index 95% rename from Minecraft.Client/UI/Screens/ConnectScreen.h rename to Minecraft.Client/net/minecraft/client/multiplayer/ConnectScreen.h index f99add276..b0baab5e5 100644 --- a/Minecraft.Client/UI/Screens/ConnectScreen.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/ConnectScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "../gui/Screen.h" class ClientConnection; class Minecraft; diff --git a/Minecraft.Client/UI/Screens/DisconnectedScreen.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/DisconnectedScreen.cpp similarity index 85% rename from Minecraft.Client/UI/Screens/DisconnectedScreen.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/DisconnectedScreen.cpp index d23211a80..349154363 100644 --- a/Minecraft.Client/UI/Screens/DisconnectedScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/DisconnectedScreen.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DisconnectedScreen.h" -#include "TitleScreen.h" -#include "../Button.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "../title/TitleScreen.h" +#include "../gui/Button.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" DisconnectedScreen::DisconnectedScreen(const std::wstring& title, const std::wstring reason, diff --git a/Minecraft.Client/UI/Screens/DisconnectedScreen.h b/Minecraft.Client/net/minecraft/client/multiplayer/DisconnectedScreen.h similarity index 95% rename from Minecraft.Client/UI/Screens/DisconnectedScreen.h rename to Minecraft.Client/net/minecraft/client/multiplayer/DisconnectedScreen.h index 1dcc1151d..c3b84068d 100644 --- a/Minecraft.Client/UI/Screens/DisconnectedScreen.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/DisconnectedScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "../gui/Screen.h" class DisconnectedScreen : public Screen { private: diff --git a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp similarity index 93% rename from Minecraft.Client/Network/MultiPlayerChunkCache.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp index 960b231be..083cf2b52 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "MultiPlayerChunkCache.h" -#include "ServerChunkCache.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Util/Arrays.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../MinecraftServer.h" -#include "../Level/ServerLevel.h" -#include "../../Minecraft.World/Blocks/Tile.h" -#include "../../Minecraft.World/Level/WaterLevelChunk.h" +#include "../../server/level/ServerChunkCache.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Arrays.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../server/MinecraftServer.h" +#include "../../server/level/ServerLevel.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/Tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.h" MultiPlayerChunkCache::MultiPlayerChunkCache(Level* level) { XZSIZE = level->dimension->getXZSize(); // 4J Added diff --git a/Minecraft.Client/Network/MultiPlayerChunkCache.h b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.h similarity index 84% rename from Minecraft.Client/Network/MultiPlayerChunkCache.h rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.h index 63b114bf9..89840a4cc 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.h @@ -1,8 +1,8 @@ #pragma once #include -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Level/RandomLevelSource.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.h" class ServerChunkCache; diff --git a/Minecraft.Client/Player/MultiPlayerGameMode.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.cpp similarity index 96% rename from Minecraft.Client/Player/MultiPlayerGameMode.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.cpp index 29a804452..e4aa77e19 100644 --- a/Minecraft.Client/Player/MultiPlayerGameMode.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "MultiPlayerGameMode.h" -#include "../GameState/CreativeMode.h" +#include "../../server/level/CreativeMode.h" #include "MultiPlayerLocalPlayer.h" -#include "../Level/MultiPlayerLevel.h" +#include "MultiPlayerLevel.h" #include "../Minecraft.h" -#include "../Network/ClientConnection.h" -#include "../Rendering/LevelRenderer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.h" +#include "ClientConnection.h" +#include "../renderer/LevelRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/net.minecraft.h" MultiPlayerGameMode::MultiPlayerGameMode(Minecraft* minecraft, ClientConnection* connection) { diff --git a/Minecraft.Client/Player/MultiPlayerGameMode.h b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h similarity index 98% rename from Minecraft.Client/Player/MultiPlayerGameMode.h rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h index a43685cd9..c255c7b36 100644 --- a/Minecraft.Client/Player/MultiPlayerGameMode.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h @@ -1,5 +1,5 @@ #pragma once -#include "../GameState/GameMode.h" +#include "../../server/level/GameMode.h" class ClientConnection; class GameType; class Vec3; diff --git a/Minecraft.Client/Level/MultiPlayerLevel.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp similarity index 97% rename from Minecraft.Client/Level/MultiPlayerLevel.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp index 1bf05b98a..fdd59cf56 100644 --- a/Minecraft.Client/Level/MultiPlayerLevel.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp @@ -1,20 +1,20 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include #include "MultiPlayerLevel.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "../Network/ClientConnection.h" -#include "../Network/MultiPlayerChunkCache.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../MinecraftServer.h" -#include "ServerLevel.h" +#include "MultiPlayerLocalPlayer.h" +#include "ClientConnection.h" +#include "MultiPlayerChunkCache.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../server/MinecraftServer.h" +#include "../../server/level/ServerLevel.h" #include "../Minecraft.h" -#include "../Rendering/Particles/FireworksParticles.h" -#include "../../Minecraft.World/Entities/Mobs/PrimedTnt.h" -#include "../../Minecraft.World/Blocks/Tile.h" -#include "../../Minecraft.World/Blocks/TileEntities/TileEntity.h" -#include "../../Minecraft.World/Util/JavaMath.h" +#include "../particle/FireworksParticles.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/Tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" MultiPlayerLevel::ResetInfo::ResetInfo(int x, int y, int z, int tile, int data) { diff --git a/Minecraft.Client/Level/MultiPlayerLevel.h b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h similarity index 92% rename from Minecraft.Client/Level/MultiPlayerLevel.h rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h index aeb70e2bc..d9a035605 100644 --- a/Minecraft.Client/Level/MultiPlayerLevel.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h @@ -1,9 +1,9 @@ #pragma once -#include "../../Minecraft.World/Util/HashExtension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Util/JavaIntHash.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/HashExtension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" class ClientConnection; class MultiPlayerChunkCache; diff --git a/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp similarity index 93% rename from Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp index 4fc916c09..e8c9c2f9b 100644 --- a/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp @@ -1,19 +1,19 @@ -#include "../Platform/stdafx.h" -// #include "../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +// #include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "MultiPlayerLocalPlayer.h" -#include "../Network/ClientConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../../Minecraft.World/Util/AABB.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../Minecraft.World/Level/LevelData.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../Input/Input.h" -#include "../Rendering/LevelRenderer.h" +#include "ClientConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../player/Input.h" +#include "../renderer/LevelRenderer.h" // 4J added for testing #if defined(STRESS_TEST_MOVE) diff --git a/Minecraft.Client/Player/MultiPlayerLocalPlayer.h b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h similarity index 95% rename from Minecraft.Client/Player/MultiPlayerLocalPlayer.h rename to Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h index a68e7ee02..337bba8cc 100644 --- a/Minecraft.Client/Player/MultiPlayerLocalPlayer.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h @@ -1,7 +1,7 @@ #pragma once #include -#include "LocalPlayer.h" -#include "../../Minecraft.World/Util/SharedConstants.h" +#include "../player/LocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" class ClientConnection; class Minecraft; diff --git a/Minecraft.Client/Network/PlayerInfo.h b/Minecraft.Client/net/minecraft/client/multiplayer/PlayerInfo.h similarity index 100% rename from Minecraft.Client/Network/PlayerInfo.h rename to Minecraft.Client/net/minecraft/client/multiplayer/PlayerInfo.h diff --git a/Minecraft.Client/UI/Screens/ReceivingLevelScreen.cpp b/Minecraft.Client/net/minecraft/client/multiplayer/ReceivingLevelScreen.cpp similarity index 84% rename from Minecraft.Client/UI/Screens/ReceivingLevelScreen.cpp rename to Minecraft.Client/net/minecraft/client/multiplayer/ReceivingLevelScreen.cpp index 013d3a675..4b17a217e 100644 --- a/Minecraft.Client/UI/Screens/ReceivingLevelScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/multiplayer/ReceivingLevelScreen.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ReceivingLevelScreen.h" -#include "../../Network/ClientConnection.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "ClientConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" ReceivingLevelScreen::ReceivingLevelScreen(ClientConnection* connection) { tickCount = 0; diff --git a/Minecraft.Client/UI/Screens/ReceivingLevelScreen.h b/Minecraft.Client/net/minecraft/client/multiplayer/ReceivingLevelScreen.h similarity index 95% rename from Minecraft.Client/UI/Screens/ReceivingLevelScreen.h rename to Minecraft.Client/net/minecraft/client/multiplayer/ReceivingLevelScreen.h index fb54bec4d..c49884eda 100644 --- a/Minecraft.Client/UI/Screens/ReceivingLevelScreen.h +++ b/Minecraft.Client/net/minecraft/client/multiplayer/ReceivingLevelScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "../gui/Screen.h" class ClientConnection; class ReceivingLevelScreen : public Screen { diff --git a/Minecraft.Client/Rendering/Particles/BreakingItemParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/BreakingItemParticle.cpp similarity index 87% rename from Minecraft.Client/Rendering/Particles/BreakingItemParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/BreakingItemParticle.cpp index 9ee928679..9cd46035f 100644 --- a/Minecraft.Client/Rendering/Particles/BreakingItemParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/BreakingItemParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "BreakingItemParticle.h" -#include "../Tesselator.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" void BreakingItemParticle::_init(Item* item, Textures* textures, int data) { this->setTex(textures, item->getIcon(data)); diff --git a/Minecraft.Client/Rendering/Particles/BreakingItemParticle.h b/Minecraft.Client/net/minecraft/client/particle/BreakingItemParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/BreakingItemParticle.h rename to Minecraft.Client/net/minecraft/client/particle/BreakingItemParticle.h diff --git a/Minecraft.Client/Rendering/Particles/BubbleParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp similarity index 66% rename from Minecraft.Client/Rendering/Particles/BubbleParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp index 79008ef54..2b629bdb4 100644 --- a/Minecraft.Client/Rendering/Particles/BubbleParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "BubbleParticle.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.material.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" BubbleParticle::BubbleParticle(Level* level, double x, double y, double z, double xa, double ya, double za) diff --git a/Minecraft.Client/Rendering/Particles/BubbleParticle.h b/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/BubbleParticle.h rename to Minecraft.Client/net/minecraft/client/particle/BubbleParticle.h diff --git a/Minecraft.Client/Rendering/Particles/CritParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp similarity index 81% rename from Minecraft.Client/Rendering/Particles/CritParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp index fba87aca0..26ab31d2e 100644 --- a/Minecraft.Client/Rendering/Particles/CritParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "CritParticle.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" void CritParticle::_init(Level* level, std::shared_ptr entity, ePARTICLE_TYPE type) { diff --git a/Minecraft.Client/Rendering/Particles/CritParticle.h b/Minecraft.Client/net/minecraft/client/particle/CritParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/CritParticle.h rename to Minecraft.Client/net/minecraft/client/particle/CritParticle.h diff --git a/Minecraft.Client/Rendering/Particles/CritParticle2.cpp b/Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp similarity index 93% rename from Minecraft.Client/Rendering/Particles/CritParticle2.cpp rename to Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp index cd9f40d32..d835105f1 100644 --- a/Minecraft.Client/Rendering/Particles/CritParticle2.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "CritParticle2.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" void CritParticle2::_init(double xa, double ya, double za, float scale) { xd *= 0.1f; diff --git a/Minecraft.Client/Rendering/Particles/CritParticle2.h b/Minecraft.Client/net/minecraft/client/particle/CritParticle2.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/CritParticle2.h rename to Minecraft.Client/net/minecraft/client/particle/CritParticle2.h diff --git a/Minecraft.Client/Rendering/Particles/DragonBreathParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp similarity index 95% rename from Minecraft.Client/Rendering/Particles/DragonBreathParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp index ca58a3250..df2367cf2 100644 --- a/Minecraft.Client/Rendering/Particles/DragonBreathParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "DragonBreathParticle.h" void DragonBreathParticle::init(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/DragonBreathParticle.h b/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/DragonBreathParticle.h rename to Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.h diff --git a/Minecraft.Client/Rendering/Particles/DripParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp similarity index 88% rename from Minecraft.Client/Rendering/Particles/DripParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp index be5e8f889..2ef052a1f 100644 --- a/Minecraft.Client/Rendering/Particles/DripParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.material.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "DripParticle.h" DripParticle::DripParticle(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/DripParticle.h b/Minecraft.Client/net/minecraft/client/particle/DripParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/DripParticle.h rename to Minecraft.Client/net/minecraft/client/particle/DripParticle.h diff --git a/Minecraft.Client/Rendering/Particles/EnchantmentTableParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp similarity index 93% rename from Minecraft.Client/Rendering/Particles/EnchantmentTableParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp index ff20c175f..069e5170d 100644 --- a/Minecraft.Client/Rendering/Particles/EnchantmentTableParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "EnchantmentTableParticle.h" EchantmentTableParticle::EchantmentTableParticle(Level* level, double x, diff --git a/Minecraft.Client/Rendering/Particles/EnchantmentTableParticle.h b/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/EnchantmentTableParticle.h rename to Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.h diff --git a/Minecraft.Client/Rendering/Particles/EnderParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp similarity index 92% rename from Minecraft.Client/Rendering/Particles/EnderParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp index 5e9458e32..d7a242bbd 100644 --- a/Minecraft.Client/Rendering/Particles/EnderParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "EnderParticle.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Random.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" // 4J Stu - This class was originally "PortalParticle" but I have split the two // uses of the particle End creatures/items (e.g. EnderMan, EyeOfEnder, etc) use diff --git a/Minecraft.Client/Rendering/Particles/EnderParticle.h b/Minecraft.Client/net/minecraft/client/particle/EnderParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/EnderParticle.h rename to Minecraft.Client/net/minecraft/client/particle/EnderParticle.h diff --git a/Minecraft.Client/Rendering/Particles/ExplodeParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp similarity index 90% rename from Minecraft.Client/Rendering/Particles/ExplodeParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp index 586428892..6e7a4f783 100644 --- a/Minecraft.Client/Rendering/Particles/ExplodeParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ExplodeParticle.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Random.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" ExplodeParticle::ExplodeParticle(Level* level, double x, double y, double z, double xa, double ya, double za) diff --git a/Minecraft.Client/Rendering/Particles/ExplodeParticle.h b/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/ExplodeParticle.h rename to Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.h diff --git a/Minecraft.Client/Rendering/Particles/FireworksParticles.cpp b/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp similarity index 98% rename from Minecraft.Client/Rendering/Particles/FireworksParticles.cpp rename to Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp index 00a3c0daa..58ec0fa70 100644 --- a/Minecraft.Client/Rendering/Particles/FireworksParticles.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "FireworksParticles.h" -#include "../Tesselator.h" -#include "../../../Minecraft.World/Level/Level.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/Level.h" FireworksParticles::FireworksStarter::FireworksStarter( Level* level, double x, double y, double z, double xd, double yd, double zd, diff --git a/Minecraft.Client/Rendering/Particles/FireworksParticles.h b/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h similarity index 97% rename from Minecraft.Client/Rendering/Particles/FireworksParticles.h rename to Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h index 95bb71740..7c953456f 100644 --- a/Minecraft.Client/Rendering/Particles/FireworksParticles.h +++ b/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h @@ -1,6 +1,6 @@ #pragma once #include "Particle.h" -#include "../../../Minecraft.World/IO/NBT/CompoundTag.h" +#include "../../../../../Minecraft.World/com/mojang/nbt/CompoundTag.h" class ParticleEngine; diff --git a/Minecraft.Client/Rendering/Particles/FlameParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp similarity index 89% rename from Minecraft.Client/Rendering/Particles/FlameParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp index 89106e8e4..67ceada0a 100644 --- a/Minecraft.Client/Rendering/Particles/FlameParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Random.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" #include "FlameParticle.h" FlameParticle::FlameParticle(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/FlameParticle.h b/Minecraft.Client/net/minecraft/client/particle/FlameParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/FlameParticle.h rename to Minecraft.Client/net/minecraft/client/particle/FlameParticle.h diff --git a/Minecraft.Client/Rendering/Particles/FootstepParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/FootstepParticle.cpp similarity index 84% rename from Minecraft.Client/Rendering/Particles/FootstepParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/FootstepParticle.cpp index 9f1dc5647..35f1a75d5 100644 --- a/Minecraft.Client/Rendering/Particles/FootstepParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/FootstepParticle.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "FootstepParticle.h" -#include "../../Textures/Textures.h" -#include "../Tesselator.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Textures/ResourceLocation.h" +#include "../renderer/Textures.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../resources/ResourceLocation.h" ResourceLocation FootstepParticle::FOOTPRINT_LOCATION = ResourceLocation(TN_MISC_FOOTSTEP); diff --git a/Minecraft.Client/Rendering/Particles/FootstepParticle.h b/Minecraft.Client/net/minecraft/client/particle/FootstepParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/FootstepParticle.h rename to Minecraft.Client/net/minecraft/client/particle/FootstepParticle.h diff --git a/Minecraft.Client/Rendering/Particles/HeartParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/HeartParticle.cpp similarity index 95% rename from Minecraft.Client/Rendering/Particles/HeartParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/HeartParticle.cpp index cb77054ce..1ed8fb040 100644 --- a/Minecraft.Client/Rendering/Particles/HeartParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/HeartParticle.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "HeartParticle.h" // 4J - added diff --git a/Minecraft.Client/Rendering/Particles/HeartParticle.h b/Minecraft.Client/net/minecraft/client/particle/HeartParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/HeartParticle.h rename to Minecraft.Client/net/minecraft/client/particle/HeartParticle.h diff --git a/Minecraft.Client/Rendering/Particles/HugeExplosionParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp similarity index 91% rename from Minecraft.Client/Rendering/Particles/HugeExplosionParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp index 018204c5f..d71b90603 100644 --- a/Minecraft.Client/Rendering/Particles/HugeExplosionParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "HugeExplosionParticle.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../Textures/Textures.h" -#include "../Tesselator.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../renderer/Textures.h" +#include "../renderer/Tesselator.h" #include "../Lighting.h" -#include "../../Textures/ResourceLocation.h" +#include "../resources/ResourceLocation.h" ResourceLocation HugeExplosionParticle::EXPLOSION_LOCATION = ResourceLocation(TN_MISC_EXPLOSION); diff --git a/Minecraft.Client/Rendering/Particles/HugeExplosionParticle.h b/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/HugeExplosionParticle.h rename to Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.h diff --git a/Minecraft.Client/Rendering/Particles/HugeExplosionSeedParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp similarity index 87% rename from Minecraft.Client/Rendering/Particles/HugeExplosionSeedParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp index 0dad12558..35bb81e5c 100644 --- a/Minecraft.Client/Rendering/Particles/HugeExplosionSeedParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "HugeExplosionSeedParticle.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" HugeExplosionSeedParticle::HugeExplosionSeedParticle(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/HugeExplosionSeedParticle.h b/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/HugeExplosionSeedParticle.h rename to Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.h diff --git a/Minecraft.Client/Rendering/Particles/LavaParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp similarity index 82% rename from Minecraft.Client/Rendering/Particles/LavaParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp index b3cb03c18..b514d084f 100644 --- a/Minecraft.Client/Rendering/Particles/LavaParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LavaParticle.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" LavaParticle::LavaParticle(Level* level, double x, double y, double z) : Particle(level, x, y, z, 0, 0, 0) { diff --git a/Minecraft.Client/Rendering/Particles/LavaParticle.h b/Minecraft.Client/net/minecraft/client/particle/LavaParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/LavaParticle.h rename to Minecraft.Client/net/minecraft/client/particle/LavaParticle.h diff --git a/Minecraft.Client/Rendering/Particles/NetherPortalParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp similarity index 92% rename from Minecraft.Client/Rendering/Particles/NetherPortalParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp index 315adc071..373c33122 100644 --- a/Minecraft.Client/Rendering/Particles/NetherPortalParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "NetherPortalParticle.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../Minecraft.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../Minecraft.h" // 4J Stu - This class was originally "PortalParticle" but I have split the two // uses of the particle Only the nether portal uses this particle diff --git a/Minecraft.Client/Rendering/Particles/NetherPortalParticle.h b/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/NetherPortalParticle.h rename to Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.h diff --git a/Minecraft.Client/Rendering/Particles/NoteParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp similarity index 95% rename from Minecraft.Client/Rendering/Particles/NoteParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp index db6bb47b5..f44850d2f 100644 --- a/Minecraft.Client/Rendering/Particles/NoteParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "NoteParticle.h" void NoteParticle::init(Level* level, double x, double y, double z, double xa, diff --git a/Minecraft.Client/Rendering/Particles/NoteParticle.h b/Minecraft.Client/net/minecraft/client/particle/NoteParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/NoteParticle.h rename to Minecraft.Client/net/minecraft/client/particle/NoteParticle.h diff --git a/Minecraft.Client/Rendering/Particles/Particle.cpp b/Minecraft.Client/net/minecraft/client/particle/Particle.cpp similarity index 93% rename from Minecraft.Client/Rendering/Particles/Particle.cpp rename to Minecraft.Client/net/minecraft/client/particle/Particle.cpp index fb4b7f0c8..6ae03048f 100644 --- a/Minecraft.Client/Rendering/Particles/Particle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/Particle.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Particle.h" -#include "../Tesselator.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" /* protected int tex; diff --git a/Minecraft.Client/Rendering/Particles/Particle.h b/Minecraft.Client/net/minecraft/client/particle/Particle.h similarity index 90% rename from Minecraft.Client/Rendering/Particles/Particle.h rename to Minecraft.Client/net/minecraft/client/particle/Particle.h index f8b99761f..2d796b189 100644 --- a/Minecraft.Client/Rendering/Particles/Particle.h +++ b/Minecraft.Client/net/minecraft/client/particle/Particle.h @@ -1,7 +1,7 @@ #pragma once -#include "../../../Minecraft.World/Entities/Entity.h" -#include "../../../Minecraft.World/Util/ParticleTypes.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../../Minecraft.World/Header Files/ParticleTypes.h" #include "ParticleEngine.h" class Tesselator; class CompoundTag; diff --git a/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp b/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp similarity index 93% rename from Minecraft.Client/Rendering/Particles/ParticleEngine.cpp rename to Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp index 9ae08c5d3..ab9964953 100644 --- a/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ParticleEngine.h" #include "Particle.h" -#include "../../Textures/Textures.h" -#include "../../Textures/TextureAtlas.h" -#include "../Tesselator.h" +#include "../renderer/Textures.h" +#include "../renderer/texture/TextureAtlas.h" +#include "../renderer/Tesselator.h" #include "TerrainParticle.h" -#include "../../Textures/ResourceLocation.h" +#include "../resources/ResourceLocation.h" #include "../Camera.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" ResourceLocation ParticleEngine::PARTICLES_LOCATION = ResourceLocation(TN_PARTICLES); diff --git a/Minecraft.Client/Rendering/Particles/ParticleEngine.h b/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/ParticleEngine.h rename to Minecraft.Client/net/minecraft/client/particle/ParticleEngine.h diff --git a/Minecraft.Client/Rendering/Particles/PlayerCloudParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp similarity index 77% rename from Minecraft.Client/Rendering/Particles/PlayerCloudParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp index adcbc1989..7b920930c 100644 --- a/Minecraft.Client/Rendering/Particles/PlayerCloudParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "PlayerCloudParticle.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" PlayerCloudParticle::PlayerCloudParticle(Level* level, double x, double y, double z, double xa, double ya, diff --git a/Minecraft.Client/Rendering/Particles/PlayerCloudParticle.h b/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/PlayerCloudParticle.h rename to Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.h diff --git a/Minecraft.Client/Rendering/Particles/RedDustParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp similarity index 94% rename from Minecraft.Client/Rendering/Particles/RedDustParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp index aac218649..22d6e5f95 100644 --- a/Minecraft.Client/Rendering/Particles/RedDustParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "RedDustParticle.h" void RedDustParticle::init(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/RedDustParticle.h b/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/RedDustParticle.h rename to Minecraft.Client/net/minecraft/client/particle/RedDustParticle.h diff --git a/Minecraft.Client/Rendering/Particles/SmokeParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp similarity index 93% rename from Minecraft.Client/Rendering/Particles/SmokeParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp index 58794dbc7..a6395b66d 100644 --- a/Minecraft.Client/Rendering/Particles/SmokeParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "SmokeParticle.h" void SmokeParticle::init(Level* level, double x, double y, double z, double xa, diff --git a/Minecraft.Client/Rendering/Particles/SmokeParticle.h b/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/SmokeParticle.h rename to Minecraft.Client/net/minecraft/client/particle/SmokeParticle.h diff --git a/Minecraft.Client/Rendering/Particles/SnowShovelParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp similarity index 92% rename from Minecraft.Client/Rendering/Particles/SnowShovelParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp index 4dd53aaa3..9b99f1a24 100644 --- a/Minecraft.Client/Rendering/Particles/SnowShovelParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "SnowShovelParticle.h" void SnowShovelParticle::init(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/SnowShovelParticle.h b/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/SnowShovelParticle.h rename to Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.h diff --git a/Minecraft.Client/Rendering/Particles/SpellParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp similarity index 89% rename from Minecraft.Client/Rendering/Particles/SpellParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp index 661f24d2d..fc4ef5abf 100644 --- a/Minecraft.Client/Rendering/Particles/SpellParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" #include "SpellParticle.h" SpellParticle::SpellParticle(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/SpellParticle.h b/Minecraft.Client/net/minecraft/client/particle/SpellParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/SpellParticle.h rename to Minecraft.Client/net/minecraft/client/particle/SpellParticle.h diff --git a/Minecraft.Client/Rendering/Particles/SplashParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/SplashParticle.cpp similarity index 85% rename from Minecraft.Client/Rendering/Particles/SplashParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/SplashParticle.cpp index 5704aff6d..88ebe0e0f 100644 --- a/Minecraft.Client/Rendering/Particles/SplashParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/SplashParticle.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SplashParticle.h" SplashParticle::SplashParticle(Level* level, double x, double y, double z, diff --git a/Minecraft.Client/Rendering/Particles/SplashParticle.h b/Minecraft.Client/net/minecraft/client/particle/SplashParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/SplashParticle.h rename to Minecraft.Client/net/minecraft/client/particle/SplashParticle.h diff --git a/Minecraft.Client/Rendering/Particles/SuspendedParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp similarity index 69% rename from Minecraft.Client/Rendering/Particles/SuspendedParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp index 924611472..0271a0fe2 100644 --- a/Minecraft.Client/Rendering/Particles/SuspendedParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SuspendedParticle.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.material.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" SuspendedParticle::SuspendedParticle(Level* level, double x, double y, double z, double xa, double ya, double za) diff --git a/Minecraft.Client/Rendering/Particles/SuspendedParticle.h b/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/SuspendedParticle.h rename to Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.h diff --git a/Minecraft.Client/Rendering/Particles/SuspendedTownParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp similarity index 80% rename from Minecraft.Client/Rendering/Particles/SuspendedTownParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp index c25074575..2e877af33 100644 --- a/Minecraft.Client/Rendering/Particles/SuspendedTownParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SuspendedTownParticle.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" SuspendedTownParticle::SuspendedTownParticle(Level* level, double x, double y, double z, double xa, double ya, diff --git a/Minecraft.Client/Rendering/Particles/SuspendedTownParticle.h b/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/SuspendedTownParticle.h rename to Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.h diff --git a/Minecraft.Client/Rendering/Particles/TakeAnimationParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/TakeAnimationParticle.cpp similarity index 84% rename from Minecraft.Client/Rendering/Particles/TakeAnimationParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/TakeAnimationParticle.cpp index 0272da4b9..be1eb5523 100644 --- a/Minecraft.Client/Rendering/Particles/TakeAnimationParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/TakeAnimationParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TakeAnimationParticle.h" -#include "../EntityRenderers/EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../renderer/entity/EntityRenderDispatcher.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" TakeAnimationParticle::TakeAnimationParticle(Level* level, std::shared_ptr item, diff --git a/Minecraft.Client/Rendering/Particles/TakeAnimationParticle.h b/Minecraft.Client/net/minecraft/client/particle/TakeAnimationParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/TakeAnimationParticle.h rename to Minecraft.Client/net/minecraft/client/particle/TakeAnimationParticle.h diff --git a/Minecraft.Client/Rendering/Particles/TerrainParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/TerrainParticle.cpp similarity index 90% rename from Minecraft.Client/Rendering/Particles/TerrainParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/TerrainParticle.cpp index 5cc4f9697..345210285 100644 --- a/Minecraft.Client/Rendering/Particles/TerrainParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/TerrainParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TerrainParticle.h" -#include "../Tesselator.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../renderer/Tesselator.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" TerrainParticle::TerrainParticle(Level* level, double x, double y, double z, double xa, double ya, double za, Tile* tile, diff --git a/Minecraft.Client/Rendering/Particles/TerrainParticle.h b/Minecraft.Client/net/minecraft/client/particle/TerrainParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/TerrainParticle.h rename to Minecraft.Client/net/minecraft/client/particle/TerrainParticle.h diff --git a/Minecraft.Client/Rendering/Particles/WaterDropParticle.cpp b/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp similarity index 73% rename from Minecraft.Client/Rendering/Particles/WaterDropParticle.cpp rename to Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp index 150dca852..f3cee2e4b 100644 --- a/Minecraft.Client/Rendering/Particles/WaterDropParticle.cpp +++ b/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "WaterDropParticle.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.material.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" WaterDropParticle::WaterDropParticle(Level* level, double x, double y, double z) : Particle(level, x, y, z, 0, 0, 0) { diff --git a/Minecraft.Client/Rendering/Particles/WaterDropParticle.h b/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.h similarity index 100% rename from Minecraft.Client/Rendering/Particles/WaterDropParticle.h rename to Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.h diff --git a/Minecraft.Client/Input/Input.cpp b/Minecraft.Client/net/minecraft/client/player/Input.cpp similarity index 89% rename from Minecraft.Client/Input/Input.cpp rename to Minecraft.Client/net/minecraft/client/player/Input.cpp index 69b5e9f09..bc3fc4025 100644 --- a/Minecraft.Client/Input/Input.cpp +++ b/Minecraft.Client/net/minecraft/client/player/Input.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "../Minecraft.h" -#include "../GameState/GameMode.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" +#include "../../server/level/GameMode.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" #include "Input.h" -#include "../Player/LocalPlayer.h" -#include "../GameState/Options.h" +#include "LocalPlayer.h" +#include "../Options.h" Input::Input() { xa = 0; diff --git a/Minecraft.Client/Input/Input.h b/Minecraft.Client/net/minecraft/client/player/Input.h similarity index 100% rename from Minecraft.Client/Input/Input.h rename to Minecraft.Client/net/minecraft/client/player/Input.h diff --git a/Minecraft.Client/Player/LocalPlayer.cpp b/Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp similarity index 94% rename from Minecraft.Client/Player/LocalPlayer.cpp rename to Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp index 9c84f17c8..595ee7221 100644 --- a/Minecraft.Client/Player/LocalPlayer.cpp +++ b/Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp @@ -1,66 +1,66 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LocalPlayer.h" -#include "UI/Screens/BeaconScreen.h" -#include "UI/Screens/BrewingStandScreen.h" -#include "UI/Screens/EnchantmentScreen.h" -#include "UI/Screens/HopperScreen.h" -#include "UI/Screens/HorseInventoryScreen.h" -#include "UI/Screens/MerchantScreen.h" -#include "UI/Screens/RepairScreen.h" -#include "User.h" -#include "../Input/Input.h" -#include "../GameState/StatsCounter.h" -#include "../Rendering/Particles/ParticleEngine.h" -#include "../Rendering/Particles/TakeAnimationParticle.h" -#include "../GameState/Options.h" -#include "../UI/Screens/TextEditScreen.h" -#include "../UI/Screens/ContainerScreen.h" -#include "../UI/Screens/CraftingScreen.h" -#include "../UI/Screens/FurnaceScreen.h" -#include "../UI/Screens/TrapScreen.h" +#include "../gui/inventory/BeaconScreen.h" +#include "../gui/inventory/BrewingStandScreen.h" +#include "../gui/EnchantmentScreen.h" +#include "../gui/HopperScreen.h" +#include "../gui/inventory/HorseInventoryScreen.h" +#include "../gui/MerchantScreen.h" +#include "../gui/RepairScreen.h" +#include "../User.h" +#include "Input.h" +#include "../../stats/StatsCounter.h" +#include "../particle/ParticleEngine.h" +#include "../particle/TakeAnimationParticle.h" +#include "../Options.h" +#include "../gui/inventory/TextEditScreen.h" +#include "../gui/inventory/ContainerScreen.h" +#include "../gui/inventory/CraftingScreen.h" +#include "../gui/inventory/FurnaceScreen.h" +#include "../gui/inventory/TrapScreen.h" -#include "MultiPlayerLocalPlayer.h" -#include "../GameState/CreativeMode.h" -#include "../Rendering/GameRenderer.h" -#include "../Rendering/EntityRenderers/ItemInHandRenderer.h" -#include "../../Minecraft.World/AI/Attributes/AttributeInstance.h" -#include "../../Minecraft.World/Level/LevelData.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.damagesource.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.food.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.effect.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../Minecraft.World/Entities/ItemEntity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.World/Headers/com.mojang.nbt.h" -#include "../../Minecraft.World/Util/Random.h" -#include "../../Minecraft.World/Blocks/TileEntities/TileEntity.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../UI/Screens/AchievementPopup.h" -#include "../Rendering/Particles/CritParticle.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../server/level/CreativeMode.h" +#include "../renderer/GameRenderer.h" +#include "../renderer/ItemInHandRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeInstance.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" +#include "../../../../../Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/ItemEntity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../Minecraft.World/com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../gui/achievement/AchievementPopup.h" +#include "../particle/CritParticle.h" // 4J : WESTY : Added for new achievements. -#include "../../Minecraft.World/Items/Item.h" -#include "../../Minecraft.World/Items/MapItem.h" -#include "../../Minecraft.World/Blocks/Tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/Item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/MapItem.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/Tile.h" // 4J Stu - Added for tutorial callbacks #include "../Minecraft.h" -#include "../../Minecraft.World/Entities/Mobs/Minecart.h" -#include "../../Minecraft.World/Entities/Mobs/Boat.h" -#include "../../Minecraft.World/Entities/Mobs/Pig.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/Minecart.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/Boat.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/Pig.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "../GameState/Options.h" -#include "../../Minecraft.World/Level/Dimensions/Dimension.h" +#include "../Options.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/Dimension.h" -#include "../../Minecraft.World/Stats/CommonStats.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/CommonStats.h" LocalPlayer::LocalPlayer(Minecraft* minecraft, Level* level, User* user, int dimension) @@ -1211,7 +1211,7 @@ void LocalPlayer::setAndBroadcastCustomCape(std::uint32_t capeId) { } // 4J TODO - Remove -#include "../../Minecraft.World/Level/LevelChunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h" void LocalPlayer::mapPlayerChunk(const unsigned int flagTileType) { int cx = this->xChunk; int cz = this->zChunk; diff --git a/Minecraft.Client/Player/LocalPlayer.h b/Minecraft.Client/net/minecraft/client/player/LocalPlayer.h similarity index 96% rename from Minecraft.Client/Player/LocalPlayer.h rename to Minecraft.Client/net/minecraft/client/player/LocalPlayer.h index 5348876a2..dd353b7f5 100644 --- a/Minecraft.Client/Player/LocalPlayer.h +++ b/Minecraft.Client/net/minecraft/client/player/LocalPlayer.h @@ -1,8 +1,8 @@ #pragma once #include -#include "../../Minecraft.World/Util/SmoothFloat.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Util/Pos.h" +#include "../../../../../Minecraft.World/net/minecraft/util/SmoothFloat.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" class Level; class User; class CompoundTag; diff --git a/Minecraft.Client/Player/RemotePlayer.cpp b/Minecraft.Client/net/minecraft/client/player/RemotePlayer.cpp similarity index 94% rename from Minecraft.Client/Player/RemotePlayer.cpp rename to Minecraft.Client/net/minecraft/client/player/RemotePlayer.cpp index f437ca8b1..e52ecc995 100644 --- a/Minecraft.Client/Player/RemotePlayer.cpp +++ b/Minecraft.Client/net/minecraft/client/player/RemotePlayer.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "RemotePlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" RemotePlayer::RemotePlayer(Level* level, const std::wstring& name) : Player(level, name) { diff --git a/Minecraft.Client/Player/RemotePlayer.h b/Minecraft.Client/net/minecraft/client/player/RemotePlayer.h similarity index 86% rename from Minecraft.Client/Player/RemotePlayer.h rename to Minecraft.Client/net/minecraft/client/player/RemotePlayer.h index 938543917..343faba62 100644 --- a/Minecraft.Client/Player/RemotePlayer.h +++ b/Minecraft.Client/net/minecraft/client/player/RemotePlayer.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/Util/SmoothFloat.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/util/SmoothFloat.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" class Input; diff --git a/Minecraft.Client/UI/BossMobGuiInfo.cpp b/Minecraft.Client/net/minecraft/client/renderer/BossMobGuiInfo.cpp similarity index 78% rename from Minecraft.Client/UI/BossMobGuiInfo.cpp rename to Minecraft.Client/net/minecraft/client/renderer/BossMobGuiInfo.cpp index 0c04331ee..2b1bedaf8 100644 --- a/Minecraft.Client/UI/BossMobGuiInfo.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/BossMobGuiInfo.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "BossMobGuiInfo.h" -#include "../../Minecraft.World/Entities/Mobs/BossMob.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/boss/BossMob.h" float BossMobGuiInfo::healthProgress = 0.0f; int BossMobGuiInfo::displayTicks = 0; diff --git a/Minecraft.Client/UI/BossMobGuiInfo.h b/Minecraft.Client/net/minecraft/client/renderer/BossMobGuiInfo.h similarity index 100% rename from Minecraft.Client/UI/BossMobGuiInfo.h rename to Minecraft.Client/net/minecraft/client/renderer/BossMobGuiInfo.h diff --git a/Minecraft.Client/Rendering/Chunk.cpp b/Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp similarity index 98% rename from Minecraft.Client/Rendering/Chunk.cpp rename to Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp index 091f45ddc..dc374dc38 100644 --- a/Minecraft.Client/Rendering/Chunk.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Chunk.h" -#include "EntityRenderers/TileRenderer.h" -#include "EntityRenderers/TileEntityRenderDispatcher.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "TileRenderer.h" +#include "tileentity/TileEntityRenderDispatcher.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "LevelRenderer.h" -#include "../Utils/FrameProfiler.h" +#include "../../../../Header Files/FrameProfiler.h" #include #include diff --git a/Minecraft.Client/Rendering/Chunk.h b/Minecraft.Client/net/minecraft/client/renderer/Chunk.h similarity index 94% rename from Minecraft.Client/Rendering/Chunk.h rename to Minecraft.Client/net/minecraft/client/renderer/Chunk.h index 90c5004fb..161d3db1a 100644 --- a/Minecraft.Client/Rendering/Chunk.h +++ b/Minecraft.Client/net/minecraft/client/renderer/Chunk.h @@ -1,7 +1,7 @@ #pragma once -#include "Culling/AllowAllCuller.h" +#include "culling/AllowAllCuller.h" #include "Tesselator.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" #include "LevelRenderer.h" class Level; diff --git a/Minecraft.Client/Rendering/Culling/DirtyChunkSorter.cpp b/Minecraft.Client/net/minecraft/client/renderer/DirtyChunkSorter.cpp similarity index 78% rename from Minecraft.Client/Rendering/Culling/DirtyChunkSorter.cpp rename to Minecraft.Client/net/minecraft/client/renderer/DirtyChunkSorter.cpp index ed12da6ef..7a9a4d2f8 100644 --- a/Minecraft.Client/Rendering/Culling/DirtyChunkSorter.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/DirtyChunkSorter.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DirtyChunkSorter.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../Chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "Chunk.h" DirtyChunkSorter::DirtyChunkSorter(std::shared_ptr cameraEntity, int playerIndex) // 4J - added player index diff --git a/Minecraft.Client/Rendering/Culling/DirtyChunkSorter.h b/Minecraft.Client/net/minecraft/client/renderer/DirtyChunkSorter.h similarity index 100% rename from Minecraft.Client/Rendering/Culling/DirtyChunkSorter.h rename to Minecraft.Client/net/minecraft/client/renderer/DirtyChunkSorter.h diff --git a/Minecraft.Client/Rendering/Culling/DistanceChunkSorter.cpp b/Minecraft.Client/net/minecraft/client/renderer/DistanceChunkSorter.cpp similarity index 74% rename from Minecraft.Client/Rendering/Culling/DistanceChunkSorter.cpp rename to Minecraft.Client/net/minecraft/client/renderer/DistanceChunkSorter.cpp index 09ff30e06..9db25eb1c 100644 --- a/Minecraft.Client/Rendering/Culling/DistanceChunkSorter.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/DistanceChunkSorter.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DistanceChunkSorter.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../Chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "Chunk.h" DistanceChunkSorter::DistanceChunkSorter(std::shared_ptr player) { ix = -player->x; diff --git a/Minecraft.Client/Rendering/Culling/DistanceChunkSorter.h b/Minecraft.Client/net/minecraft/client/renderer/DistanceChunkSorter.h similarity index 100% rename from Minecraft.Client/Rendering/Culling/DistanceChunkSorter.h rename to Minecraft.Client/net/minecraft/client/renderer/DistanceChunkSorter.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityTileRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/EntityTileRenderer.cpp similarity index 75% rename from Minecraft.Client/Rendering/EntityRenderers/EntityTileRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/EntityTileRenderer.cpp index cf4a3d687..0762d9d2a 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityTileRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/EntityTileRenderer.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "EntityTileRenderer.h" -#include "TileEntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "tileentity/TileEntityRenderDispatcher.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" EntityTileRenderer* EntityTileRenderer::instance = new EntityTileRenderer; diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityTileRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/EntityTileRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/EntityTileRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/EntityTileRenderer.h diff --git a/Minecraft.Client/Rendering/GameRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp similarity index 95% rename from Minecraft.Client/Rendering/GameRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp index b3f1b9458..310ef1e77 100644 --- a/Minecraft.Client/Rendering/GameRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp @@ -1,56 +1,56 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "GameRenderer.h" -#include "EntityRenderers/ItemInHandRenderer.h" +#include "ItemInHandRenderer.h" #include "LevelRenderer.h" -#include "Frustum.h" -#include "FrustumCuller.h" -#include "../Textures/Textures.h" +#include "culling/Frustum.h" +#include "culling/FrustumCuller.h" +#include "Textures.h" #include "Tesselator.h" -#include "Particles/ParticleEngine.h" -#include "Particles/SmokeParticle.h" -#include "Particles/WaterDropParticle.h" -#include "../GameState/GameMode.h" -#include "../GameState/CreativeMode.h" -#include "Lighting.h" -#include "../GameState/Options.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "Particles/GuiParticles.h" -#include "../Level/MultiPlayerLevel.h" +#include "../particle/ParticleEngine.h" +#include "../particle/SmokeParticle.h" +#include "../particle/WaterDropParticle.h" +#include "../../server/level/GameMode.h" +#include "../../server/level/CreativeMode.h" +#include "../Lighting.h" +#include "../Options.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../gui/particle/GuiParticles.h" +#include "../multiplayer/MultiPlayerLevel.h" #include "Chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.enchantment.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.material.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.biome.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Platform/System.h" -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" -#include "../../Minecraft.World/Util/ThreadName.h" -#include "../../Minecraft.World/Level/Storage/SparseLightStorage.h" -#include "../../Minecraft.World/Level/Storage/CompressedTileStorage.h" -#include "../../Minecraft.World/Level/Storage/SparseDataStorage.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "../../Minecraft.World/Util/Facing.h" -#include "../../Minecraft.World/Entities/MobEffect.h" -#include "../../Minecraft.World/Util/SmoothFloat.h" -#include "../../Minecraft.World/Entities/MobEffectInstance.h" -#include "../../Minecraft.World/Items/Item.h" -#include "Camera.h" -#include "../../Minecraft.World/Util/SoundTypes.h" -#include "Models/HumanoidModel.h" -#include "../../Minecraft.World/Items/Item.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" -#include "../Platform/Common/ShutdownManager.h" -#include "../UI/BossMobGuiInfo.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/biome/net.minecraft.world.level.biome.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ThreadName.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/Facing.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/MobEffect.h" +#include "../../../../../Minecraft.World/net/minecraft/util/SmoothFloat.h" +#include "../../../../../Minecraft.World/net/minecraft/world/effect/MobEffectInstance.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/Item.h" +#include "../Camera.h" +#include "../../../../../Minecraft.World/Header Files/SoundTypes.h" +#include "../model/HumanoidModel.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/Item.h" +#include "../../../../../Minecraft.World/Header Files/compression.h" +#include "../../../../Common/ShutdownManager.h" +#include "BossMobGuiInfo.h" -#include "../Textures/Packs/TexturePackRepository.h" -#include "../Textures/Packs/TexturePack.h" -#include "../Textures/TextureAtlas.h" -#include "../Utils/FrameProfiler.h" +#include "../skins/TexturePackRepository.h" +#include "../skins/TexturePack.h" +#include "texture/TextureAtlas.h" +#include "../../../../Header Files/FrameProfiler.h" bool GameRenderer::anaglyph3d = false; int GameRenderer::anaglyphPass = 0; diff --git a/Minecraft.Client/Rendering/GameRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.h similarity index 96% rename from Minecraft.Client/Rendering/GameRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/GameRenderer.h index c92136b3b..722cac468 100644 --- a/Minecraft.Client/Rendering/GameRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.h @@ -10,9 +10,9 @@ class CompressedTileStorage; class SparseDataStorage; #include -#include "../../Minecraft.World/Util/SmoothFloat.h" -#include "../../Minecraft.World/Util/C4JThread.h" -#include "../Textures/ResourceLocation.h" +#include "../../../../../Minecraft.World/net/minecraft/util/SmoothFloat.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" +#include "../resources/ResourceLocation.h" class GameRenderer { private: diff --git a/Minecraft.Client/Textures/HttpTexture.cpp b/Minecraft.Client/net/minecraft/client/renderer/HttpTexture.cpp similarity index 79% rename from Minecraft.Client/Textures/HttpTexture.cpp rename to Minecraft.Client/net/minecraft/client/renderer/HttpTexture.cpp index f7a658f42..4a6aaf0e7 100644 --- a/Minecraft.Client/Textures/HttpTexture.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/HttpTexture.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "HttpTexture.h" HttpTexture::HttpTexture(const std::wstring& _url, diff --git a/Minecraft.Client/Textures/HttpTexture.h b/Minecraft.Client/net/minecraft/client/renderer/HttpTexture.h similarity index 100% rename from Minecraft.Client/Textures/HttpTexture.h rename to Minecraft.Client/net/minecraft/client/renderer/HttpTexture.h diff --git a/Minecraft.Client/Textures/HttpTextureProcessor.h b/Minecraft.Client/net/minecraft/client/renderer/HttpTextureProcessor.h similarity index 100% rename from Minecraft.Client/Textures/HttpTextureProcessor.h rename to Minecraft.Client/net/minecraft/client/renderer/HttpTextureProcessor.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemInHandRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp similarity index 97% rename from Minecraft.Client/Rendering/EntityRenderers/ItemInHandRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp index e814afb66..79f800419 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemInHandRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp @@ -1,22 +1,22 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ItemInHandRenderer.h" #include "TileRenderer.h" -#include "../Tesselator.h" -#include "../../Textures/Textures.h" -#include "../../Textures/TextureAtlas.h" -#include "EntityRenderer.h" -#include "PlayerRenderer.h" -#include "EntityRenderDispatcher.h" +#include "Tesselator.h" +#include "Textures.h" +#include "texture/TextureAtlas.h" +#include "entity/EntityRenderer.h" +#include "entity/PlayerRenderer.h" +#include "entity/EntityRenderDispatcher.h" #include "../Lighting.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../Minimap.h" -#include "../../Level/MultiPlayerLevel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../gui/Minimap.h" +#include "../multiplayer/MultiPlayerLevel.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" ResourceLocation ItemInHandRenderer::ENCHANT_GLINT_LOCATION = ResourceLocation(TN__BLUR__MISC_GLINT); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemInHandRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ItemInHandRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.h diff --git a/Minecraft.Client/Rendering/LevelRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp similarity index 98% rename from Minecraft.Client/Rendering/LevelRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp index 57ac3f6f6..548c62bae 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp @@ -3,69 +3,69 @@ #include #include -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "LevelRenderer.h" #include -#include "../Textures/Textures.h" -#include "../Textures/TextureAtlas.h" +#include "Textures.h" +#include "texture/TextureAtlas.h" #include "Tesselator.h" #include "Chunk.h" -#include "EntityRenderers/EntityRenderDispatcher.h" -#include "EntityRenderers/TileEntityRenderDispatcher.h" -#include "Culling/DistanceChunkSorter.h" -#include "Culling/DirtyChunkSorter.h" -#include "../Textures/MobSkinTextureProcessor.h" -#include "../Textures/MobSkinMemTextureProcessor.h" +#include "entity/EntityRenderDispatcher.h" +#include "tileentity/TileEntityRenderDispatcher.h" +#include "DistanceChunkSorter.h" +#include "DirtyChunkSorter.h" +#include "MobSkinTextureProcessor.h" +#include "../../../../Header Files/MobSkinMemTextureProcessor.h" #include "GameRenderer.h" -#include "Particles/BubbleParticle.h" -#include "Particles/SmokeParticle.h" -#include "Particles/NoteParticle.h" -#include "Particles/NetherPortalParticle.h" -#include "Particles/EnderParticle.h" -#include "Particles/ExplodeParticle.h" -#include "Particles/FlameParticle.h" -#include "Particles/LavaParticle.h" -#include "Particles/FootstepParticle.h" -#include "Particles/SplashParticle.h" -#include "Particles/SmokeParticle.h" -#include "Particles/RedDustParticle.h" -#include "Particles/BreakingItemParticle.h" -#include "Particles/SnowShovelParticle.h" -#include "Particles/BreakingItemParticle.h" -#include "Particles/HeartParticle.h" -#include "Particles/HugeExplosionParticle.h" -#include "Particles/HugeExplosionSeedParticle.h" -#include "Particles/SuspendedParticle.h" -#include "Particles/SuspendedTownParticle.h" -#include "Particles/CritParticle2.h" -#include "Particles/TerrainParticle.h" -#include "Particles/SpellParticle.h" -#include "Particles/DripParticle.h" -#include "Particles/EnchantmentTableParticle.h" -#include "Particles/DragonBreathParticle.h" -#include "Particles/FireworksParticles.h" -#include "Lighting.h" -#include "../GameState/Options.h" -#include "../Network/MultiPlayerChunkCache.h" -#include "../../Minecraft.World/Util/ParticleTypes.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Platform/System.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "../Level/MultiPlayerLevel.h" -#include "../../Minecraft.World/Util/SoundTypes.h" -#include "FrustumCuller.h" -#include "../Utils/FrameProfiler.h" +#include "../particle/BubbleParticle.h" +#include "../particle/SmokeParticle.h" +#include "../particle/NoteParticle.h" +#include "../particle/NetherPortalParticle.h" +#include "../particle/EnderParticle.h" +#include "../particle/ExplodeParticle.h" +#include "../particle/FlameParticle.h" +#include "../particle/LavaParticle.h" +#include "../particle/FootstepParticle.h" +#include "../particle/SplashParticle.h" +#include "../particle/SmokeParticle.h" +#include "../particle/RedDustParticle.h" +#include "../particle/BreakingItemParticle.h" +#include "../particle/SnowShovelParticle.h" +#include "../particle/BreakingItemParticle.h" +#include "../particle/HeartParticle.h" +#include "../particle/HugeExplosionParticle.h" +#include "../particle/HugeExplosionSeedParticle.h" +#include "../particle/SuspendedParticle.h" +#include "../particle/SuspendedTownParticle.h" +#include "../particle/CritParticle2.h" +#include "../particle/TerrainParticle.h" +#include "../particle/SpellParticle.h" +#include "../particle/DripParticle.h" +#include "../particle/EnchantmentTableParticle.h" +#include "../particle/DragonBreathParticle.h" +#include "../particle/FireworksParticles.h" +#include "../Lighting.h" +#include "../Options.h" +#include "../multiplayer/MultiPlayerChunkCache.h" +#include "../../../../../Minecraft.World/Header Files/ParticleTypes.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../multiplayer/MultiPlayerLocalPlayer.h" +#include "../multiplayer/MultiPlayerLevel.h" +#include "../../../../../Minecraft.World/Header Files/SoundTypes.h" +#include "culling/FrustumCuller.h" +#include "../../../../Header Files/FrameProfiler.h" // #define DISABLE_SPU_CODE diff --git a/Minecraft.Client/Rendering/LevelRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h similarity index 97% rename from Minecraft.Client/Rendering/LevelRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h index f237ebe5c..44cb826ea 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h @@ -1,9 +1,9 @@ #pragma once -#include "../../Minecraft.World/Level/Events/LevelListener.h" -#include "../../Minecraft.World/Util/Definitions.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/LevelListener.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/Definitions.h" #include "OffsettedRenderList.h" -#include "../../Minecraft.World/Util/JavaIntHash.h" -#include "../../Minecraft.World/Level/Level.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/Level.h" #if !defined(__linux__) #include #endif diff --git a/Minecraft.Client/Textures/MemTexture.cpp b/Minecraft.Client/net/minecraft/client/renderer/MemTexture.cpp similarity index 86% rename from Minecraft.Client/Textures/MemTexture.cpp rename to Minecraft.Client/net/minecraft/client/renderer/MemTexture.cpp index 3beec4a65..bcf84aa53 100644 --- a/Minecraft.Client/Textures/MemTexture.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/MemTexture.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "MemTexture.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Header Files/MemTexture.h" MemTexture::MemTexture(const std::wstring& _url, std::uint8_t* pbData, std::uint32_t dataBytes, diff --git a/Minecraft.Client/Textures/MobSkinMemTextureProcessor.cpp b/Minecraft.Client/net/minecraft/client/renderer/MobSkinMemTextureProcessor.cpp similarity index 93% rename from Minecraft.Client/Textures/MobSkinMemTextureProcessor.cpp rename to Minecraft.Client/net/minecraft/client/renderer/MobSkinMemTextureProcessor.cpp index c82be9800..9e569cd0b 100644 --- a/Minecraft.Client/Textures/MobSkinMemTextureProcessor.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/MobSkinMemTextureProcessor.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "MobSkinMemTextureProcessor.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Header Files/MobSkinMemTextureProcessor.h" BufferedImage* MobSkinMemTextureProcessor::process(BufferedImage* in) { if (in == nullptr) return nullptr; diff --git a/Minecraft.Client/Textures/MobSkinTextureProcessor.cpp b/Minecraft.Client/net/minecraft/client/renderer/MobSkinTextureProcessor.cpp similarity index 96% rename from Minecraft.Client/Textures/MobSkinTextureProcessor.cpp rename to Minecraft.Client/net/minecraft/client/renderer/MobSkinTextureProcessor.cpp index ff52d1594..2a3947b69 100644 --- a/Minecraft.Client/Textures/MobSkinTextureProcessor.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/MobSkinTextureProcessor.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "MobSkinTextureProcessor.h" BufferedImage* MobSkinTextureProcessor::process(BufferedImage* in) { diff --git a/Minecraft.Client/Textures/MobSkinTextureProcessor.h b/Minecraft.Client/net/minecraft/client/renderer/MobSkinTextureProcessor.h similarity index 100% rename from Minecraft.Client/Textures/MobSkinTextureProcessor.h rename to Minecraft.Client/net/minecraft/client/renderer/MobSkinTextureProcessor.h diff --git a/Minecraft.Client/Rendering/OffsettedRenderList.cpp b/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp similarity index 91% rename from Minecraft.Client/Rendering/OffsettedRenderList.cpp rename to Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp index 685da0524..423717610 100644 --- a/Minecraft.Client/Rendering/OffsettedRenderList.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" #include "OffsettedRenderList.h" // 4J added diff --git a/Minecraft.Client/Rendering/OffsettedRenderList.h b/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.h similarity index 100% rename from Minecraft.Client/Rendering/OffsettedRenderList.h rename to Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.h diff --git a/Minecraft.Client/UI/Rect2i.cpp b/Minecraft.Client/net/minecraft/client/renderer/Rect2i.cpp similarity index 94% rename from Minecraft.Client/UI/Rect2i.cpp rename to Minecraft.Client/net/minecraft/client/renderer/Rect2i.cpp index e7d8e0f52..1c7c2b935 100644 --- a/Minecraft.Client/UI/Rect2i.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/Rect2i.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Rect2i.h" Rect2i::Rect2i(int x, int y, int width, int height) { diff --git a/Minecraft.Client/UI/Rect2i.h b/Minecraft.Client/net/minecraft/client/renderer/Rect2i.h similarity index 100% rename from Minecraft.Client/UI/Rect2i.h rename to Minecraft.Client/net/minecraft/client/renderer/Rect2i.h diff --git a/Minecraft.Client/Rendering/Tesselator.cpp b/Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp similarity index 98% rename from Minecraft.Client/Rendering/Tesselator.cpp rename to Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp index 6bc17df8d..1211a60dd 100644 --- a/Minecraft.Client/Rendering/Tesselator.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Tesselator.h" -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/IO/Streams/ByteBuffer.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" bool Tesselator::TRIANGLE_MODE = false; bool Tesselator::USE_VBO = false; diff --git a/Minecraft.Client/Rendering/Tesselator.h b/Minecraft.Client/net/minecraft/client/renderer/Tesselator.h similarity index 100% rename from Minecraft.Client/Rendering/Tesselator.h rename to Minecraft.Client/net/minecraft/client/renderer/Tesselator.h diff --git a/Minecraft.Client/Textures/Textures.cpp b/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp similarity index 97% rename from Minecraft.Client/Textures/Textures.cpp rename to Minecraft.Client/net/minecraft/client/renderer/Textures.cpp index 481a7bb70..06281359b 100644 --- a/Minecraft.Client/Textures/Textures.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp @@ -1,24 +1,24 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "Textures.h" -#include "Packs/TexturePackRepository.h" +#include "../skins/TexturePackRepository.h" #include "HttpTexture.h" -#include "MemTexture.h" -#include "../../Minecraft.World/IO/Streams/InputStream.h" -#include "../../Minecraft.World/IO/Streams/IntBuffer.h" -#include "../../Minecraft.World/IO/Streams/ByteBuffer.h" -#include "Packs/TexturePack.h" -#include "../GameState/Options.h" -#include "../../Minecraft.Client/Textures/MemTextureProcessor.h" -#include "MobSkinMemTextureProcessor.h" -#include "Stitching/PreStitchedTextureMap.h" -#include "Stitching/StitchedTexture.h" -#include "Texture.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Util/StringHelpers.h" -#include "ResourceLocation.h" -#include "../../Minecraft.World/Entities/ItemEntity.h" -#include "TextureAtlas.h" +#include "../../../../Header Files/MemTexture.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "../skins/TexturePack.h" +#include "../Options.h" +#include "../../../../Header Files/MemTextureProcessor.h" +#include "../../../../Header Files/MobSkinMemTextureProcessor.h" +#include "texture/PreStitchedTextureMap.h" +#include "texture/StitchedTexture.h" +#include "texture/Texture.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../resources/ResourceLocation.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/ItemEntity.h" +#include "texture/TextureAtlas.h" // Linux/PC port: disable mipmapping globally so textures are always sampled // from the full-resolution level 0 with GL_NEAREST, giving pixel-crisp diff --git a/Minecraft.Client/Textures/Textures.h b/Minecraft.Client/net/minecraft/client/renderer/Textures.h similarity index 99% rename from Minecraft.Client/Textures/Textures.h rename to Minecraft.Client/net/minecraft/client/renderer/Textures.h index fd59fc66b..4ab6eda8f 100644 --- a/Minecraft.Client/Textures/Textures.h +++ b/Minecraft.Client/net/minecraft/client/renderer/Textures.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Util/ArrayWithLength.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" class DynamicTexture; class BufferedImage; diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp similarity index 99% rename from Minecraft.Client/Rendering/EntityRenderers/TileRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp index a43146943..42dc3d52f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp @@ -1,19 +1,19 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TileRenderer.h" #include -#include "../GameRenderer.h" -#include "../../Minecraft.h" -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.material.h" -#include "../../../Minecraft.World/Headers/net.minecraft.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../Tesselator.h" -#include "../../Utils/FrameProfiler.h" +#include "GameRenderer.h" +#include "../Minecraft.h" +#include "Textures.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" +#include "../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "Tesselator.h" +#include "../../../../Header Files/FrameProfiler.h" #include "EntityTileRenderer.h" -#include "../../GameState/Options.h" +#include "../Options.h" bool TileRenderer::fancy = true; diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/TileRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/TileRenderer.h diff --git a/Minecraft.Client/Rendering/Culling/AllowAllCuller.cpp b/Minecraft.Client/net/minecraft/client/renderer/culling/AllowAllCuller.cpp similarity index 87% rename from Minecraft.Client/Rendering/Culling/AllowAllCuller.cpp rename to Minecraft.Client/net/minecraft/client/renderer/culling/AllowAllCuller.cpp index 87ef63f07..f182ff754 100644 --- a/Minecraft.Client/Rendering/Culling/AllowAllCuller.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/AllowAllCuller.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "AllowAllCuller.h" bool AllowAllCuller::isVisible(AABB* bb) { return true; } diff --git a/Minecraft.Client/Rendering/Culling/AllowAllCuller.h b/Minecraft.Client/net/minecraft/client/renderer/culling/AllowAllCuller.h similarity index 100% rename from Minecraft.Client/Rendering/Culling/AllowAllCuller.h rename to Minecraft.Client/net/minecraft/client/renderer/culling/AllowAllCuller.h diff --git a/Minecraft.Client/Rendering/Culling/Culler.h b/Minecraft.Client/net/minecraft/client/renderer/culling/Culler.h similarity index 84% rename from Minecraft.Client/Rendering/Culling/Culler.h rename to Minecraft.Client/net/minecraft/client/renderer/culling/Culler.h index a84da40c9..0009b4614 100644 --- a/Minecraft.Client/Rendering/Culling/Culler.h +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/Culler.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../Minecraft.World/Util/AABB.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" class Culler { public: diff --git a/Minecraft.Client/Rendering/Frustum.cpp b/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp similarity index 96% rename from Minecraft.Client/Rendering/Frustum.cpp rename to Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp index 3d2e562ea..c1c43c156 100644 --- a/Minecraft.Client/Rendering/Frustum.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.World/IO/Streams/FloatBuffer.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" #include "Frustum.h" -#include "Camera.h" +#include "../../Camera.h" Frustum* Frustum::frustum = new Frustum(); diff --git a/Minecraft.Client/Rendering/Frustum.h b/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.h similarity index 100% rename from Minecraft.Client/Rendering/Frustum.h rename to Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.h diff --git a/Minecraft.Client/Rendering/FrustumCuller.cpp b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumCuller.cpp similarity index 93% rename from Minecraft.Client/Rendering/FrustumCuller.cpp rename to Minecraft.Client/net/minecraft/client/renderer/culling/FrustumCuller.cpp index e2ab78c7f..bf7ad9485 100644 --- a/Minecraft.Client/Rendering/FrustumCuller.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumCuller.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "FrustumCuller.h" FrustumCuller::FrustumCuller() { frustum = Frustum::getFrustum(); } diff --git a/Minecraft.Client/Rendering/FrustumCuller.h b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumCuller.h similarity index 86% rename from Minecraft.Client/Rendering/FrustumCuller.h rename to Minecraft.Client/net/minecraft/client/renderer/culling/FrustumCuller.h index a14814c1d..d0ee56a88 100644 --- a/Minecraft.Client/Rendering/FrustumCuller.h +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumCuller.h @@ -1,6 +1,6 @@ #pragma once -#include "../Platform/stdafx.h" -#include "Culling/Culler.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "Culler.h" #include "Frustum.h" class FrustumCuller : public Culler { diff --git a/Minecraft.Client/Rendering/FrustumData.cpp b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumData.cpp similarity index 98% rename from Minecraft.Client/Rendering/FrustumData.cpp rename to Minecraft.Client/net/minecraft/client/renderer/culling/FrustumData.cpp index 140fa4772..4184f0cb8 100644 --- a/Minecraft.Client/Rendering/FrustumData.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumData.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "FrustumData.h" // float** m_Frustum; diff --git a/Minecraft.Client/Rendering/FrustumData.h b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumData.h similarity index 94% rename from Minecraft.Client/Rendering/FrustumData.h rename to Minecraft.Client/net/minecraft/client/renderer/culling/FrustumData.h index 1a61d4ae3..223f2d7f7 100644 --- a/Minecraft.Client/Rendering/FrustumData.h +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/FrustumData.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Util/AABB.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" class FrustumData { public: diff --git a/Minecraft.Client/Rendering/Culling/ViewportCuller.cpp b/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp similarity index 97% rename from Minecraft.Client/Rendering/Culling/ViewportCuller.cpp rename to Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp index addd4b097..6821b7c97 100644 --- a/Minecraft.Client/Rendering/Culling/ViewportCuller.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ViewportCuller.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" ViewportCuller::Face::Face(double x, double y, double z, float yRot, float xRot) { diff --git a/Minecraft.Client/Rendering/Culling/ViewportCuller.h b/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.h similarity index 94% rename from Minecraft.Client/Rendering/Culling/ViewportCuller.h rename to Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.h index 72373dd49..8f2e52c32 100644 --- a/Minecraft.Client/Rendering/Culling/ViewportCuller.h +++ b/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.h @@ -1,6 +1,6 @@ #pragma once #include "Culler.h" -#include "../../../Minecraft.World/Entities/Mob.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/Mob.h" class Mob; class ViewportCuller : public Culler { diff --git a/Minecraft.Client/Rendering/EntityRenderers/ArrowRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ArrowRenderer.cpp similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/ArrowRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ArrowRenderer.cpp index 1c619b2f3..c96611a48 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ArrowRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ArrowRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ArrowRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" ResourceLocation ArrowRenderer::ARROW_LOCATION = ResourceLocation(TN_ITEM_ARROWS); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ArrowRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ArrowRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ArrowRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ArrowRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/BatRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/BatRenderer.cpp similarity index 86% rename from Minecraft.Client/Rendering/EntityRenderers/BatRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/BatRenderer.cpp index ce3e7859d..7d38817e2 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/BatRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/BatRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.ambient.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/ambient/net.minecraft.world.entity.ambient.h" #include "BatRenderer.h" -#include "../Models/BatModel.h" +#include "../../model/BatModel.h" ResourceLocation BatRenderer::BAT_LOCATION = ResourceLocation(TN_MOB_BAT); diff --git a/Minecraft.Client/Rendering/EntityRenderers/BatRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/BatRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/BatRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/BatRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/BlazeRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/BlazeRenderer.cpp similarity index 81% rename from Minecraft.Client/Rendering/EntityRenderers/BlazeRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/BlazeRenderer.cpp index 30242923f..618caf63c 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/BlazeRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/BlazeRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../Models/BlazeModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/BlazeModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" #include "BlazeRenderer.h" ResourceLocation BlazeRenderer::BLAZE_LOCATION = ResourceLocation(TN_MOB_BLAZE); diff --git a/Minecraft.Client/Rendering/EntityRenderers/BlazeRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/BlazeRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/BlazeRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/BlazeRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/BoatRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/BoatRenderer.cpp similarity index 81% rename from Minecraft.Client/Rendering/EntityRenderers/BoatRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/BoatRenderer.cpp index a6ef9dd0a..9be52bc5b 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/BoatRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/BoatRenderer.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "BoatRenderer.h" -#include "../Models/BoatModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../model/BoatModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" ResourceLocation BoatRenderer::BOAT_LOCATION = ResourceLocation(TN_ITEM_BOAT); diff --git a/Minecraft.Client/Rendering/EntityRenderers/BoatRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/BoatRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/BoatRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/BoatRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/CaveSpiderRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/CaveSpiderRenderer.cpp similarity index 88% rename from Minecraft.Client/Rendering/EntityRenderers/CaveSpiderRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/CaveSpiderRenderer.cpp index 9a5445672..b68df4c79 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/CaveSpiderRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/CaveSpiderRenderer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "CaveSpiderRenderer.h" ResourceLocation CaveSpiderRenderer::CAVE_SPIDER_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/CaveSpiderRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/CaveSpiderRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/CaveSpiderRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/CaveSpiderRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ChickenRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ChickenRenderer.cpp similarity index 79% rename from Minecraft.Client/Rendering/EntityRenderers/ChickenRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ChickenRenderer.cpp index 096ffd459..193d20d4a 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ChickenRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ChickenRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "ChickenRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation ChickenRenderer::CHICKEN_LOCATION = ResourceLocation(TN_MOB_CHICKEN); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ChickenRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ChickenRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ChickenRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ChickenRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/CowRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/CowRenderer.cpp similarity index 87% rename from Minecraft.Client/Rendering/EntityRenderers/CowRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/CowRenderer.cpp index 7daee01cc..f23015267 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/CowRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/CowRenderer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "CowRenderer.h" ResourceLocation CowRenderer::COW_LOCATION = ResourceLocation(TN_MOB_COW); diff --git a/Minecraft.Client/Rendering/EntityRenderers/CowRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/CowRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/CowRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/CowRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/CreeperRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/CreeperRenderer.cpp similarity index 90% rename from Minecraft.Client/Rendering/EntityRenderers/CreeperRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/CreeperRenderer.cpp index 062344713..9d17e4b02 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/CreeperRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/CreeperRenderer.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "CreeperRenderer.h" -#include "../Models/CreeperModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../model/CreeperModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" ResourceLocation CreeperRenderer::POWER_LOCATION = ResourceLocation(TN_POWERED_CREEPER); diff --git a/Minecraft.Client/Rendering/EntityRenderers/CreeperRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/CreeperRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/CreeperRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/CreeperRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/DefaultRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/DefaultRenderer.cpp similarity index 69% rename from Minecraft.Client/Rendering/EntityRenderers/DefaultRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/DefaultRenderer.cpp index ad631c6df..bd0ff7ba1 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/DefaultRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/DefaultRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "DefaultRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" void DefaultRenderer::render(std::shared_ptr entity, double x, double y, double z, float rot, float a) { diff --git a/Minecraft.Client/Rendering/EntityRenderers/DefaultRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/DefaultRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/DefaultRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/DefaultRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderCrystalRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/EnderCrystalRenderer.cpp similarity index 83% rename from Minecraft.Client/Rendering/EntityRenderers/EnderCrystalRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/EnderCrystalRenderer.cpp index bdb9b17f0..531c188da 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EnderCrystalRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EnderCrystalRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../Models/EnderCrystalModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/dragon/EnderCrystalModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" #include "EnderCrystalRenderer.h" ResourceLocation EnderCrystalRenderer::ENDER_CRYSTAL_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderCrystalRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/EnderCrystalRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/EnderCrystalRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/EnderCrystalRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp similarity index 97% rename from Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp index f71c07234..ee91e3664 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../Models/DragonModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/dragon/DragonModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" #include "../Tesselator.h" -#include "../Lighting.h" +#include "../../Lighting.h" #include "EnderDragonRenderer.h" -#include "../../UI/BossMobGuiInfo.h" +#include "../BossMobGuiInfo.h" ResourceLocation EnderDragonRenderer::DRAGON_EXPLODING_LOCATION = ResourceLocation(TN_MOB_ENDERDRAGON_SHUFFLE); diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/EnderDragonRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderManRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/EndermanRenderer.cpp similarity index 90% rename from Minecraft.Client/Rendering/EntityRenderers/EnderManRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/EndermanRenderer.cpp index 4798c2754..c202ca72c 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EnderManRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EndermanRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "EnderManRenderer.h" -#include "../Models/EnderManModel.h" -#include "../../Textures/TextureAtlas.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "EndermanRenderer.h" +#include "../../model/EndermanModel.h" +#include "../texture/TextureAtlas.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" ResourceLocation EndermanRenderer::ENDERMAN_EYES_LOCATION = ResourceLocation(TN_MOB_ENDERMAN_EYES); diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderManRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/EndermanRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/EnderManRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/EndermanRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp similarity index 84% rename from Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp index ab7fff785..1f861d99d 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.global.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.npc.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.alchemy.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" #include "SpiderRenderer.h" #include "PigRenderer.h" #include "SheepRenderer.h" @@ -40,7 +40,7 @@ #include "LightningBoltRenderer.h" #include "HumanoidMobRenderer.h" #include "DefaultRenderer.h" -#include "EnderManRenderer.h" +#include "EndermanRenderer.h" #include "ExperienceOrbRenderer.h" #include "SilverfishRenderer.h" #include "MushroomCowRenderer.h" @@ -58,27 +58,27 @@ #include "TntMinecartRenderer.h" #include "MinecartSpawnerRenderer.h" #include "HorseRenderer.h" -#include "../Models/SpiderModel.h" -#include "../Models/PigModel.h" -#include "../Models/SheepModel.h" -#include "../Models/CowModel.h" -#include "../Models/WolfModel.h" -#include "../Models/ChickenModel.h" -#include "../Models/CreeperModel.h" -#include "../Models/SlimeModel.h" -#include "../Models/GhastModel.h" -#include "../Models/SquidModel.h" -#include "../Models/MinecartModel.h" -#include "../Models/BoatModel.h" -#include "../Models/HumanoidModel.h" -#include "../Models/SheepFurModel.h" -#include "../Models/SkeletonModel.h" -#include "../Models/ModelHorse.h" -#include "../../GameState/Options.h" +#include "../../model/SpiderModel.h" +#include "../../model/PigModel.h" +#include "../../model/SheepModel.h" +#include "../../model/CowModel.h" +#include "../../model/WolfModel.h" +#include "../../model/ChickenModel.h" +#include "../../model/CreeperModel.h" +#include "../../model/SlimeModel.h" +#include "../../model/GhastModel.h" +#include "../../model/SquidModel.h" +#include "../../model/MinecartModel.h" +#include "../../model/BoatModel.h" +#include "../../model/HumanoidModel.h" +#include "../../model/SheepFurModel.h" +#include "../../model/SkeletonModel.h" +#include "../../model/ModelHorse.h" +#include "../../Options.h" #include "ItemFrameRenderer.h" #include "OcelotRenderer.h" #include "VillagerGolemRenderer.h" -#include "../Models/OcelotModel.h" +#include "../../model/OcelotModel.h" #include "ZombieRenderer.h" #include "BatRenderer.h" #include "CaveSpiderRenderer.h" diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h similarity index 92% rename from Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h index 11d8a1709..141e44250 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.h +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h @@ -1,7 +1,7 @@ #pragma once #include "EntityRenderer.h" -#include "../../../Minecraft.World/Entities/Entity.h" -#include "../../../Minecraft.World/Util/JavaIntHash.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" class font; class EntityRenderDispatcher { diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp similarity index 94% rename from Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp index f98c8881c..ae915ba4b 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "EntityRenderer.h" #include "EntityRenderDispatcher.h" -#include "../Models/HumanoidModel.h" -#include "../../Player/LocalPlayer.h" -#include "../../GameState/Options.h" -#include "../../Textures/TextureAtlas.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Level/Level.h" -#include "../../../Minecraft.World/Util/AABB.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../model/HumanoidModel.h" +#include "../../player/LocalPlayer.h" +#include "../../Options.h" +#include "../texture/TextureAtlas.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/Level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation EntityRenderer::SHADOW_LOCATION = ResourceLocation(TN__CLAMP__MISC_SHADOW); diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.h similarity index 94% rename from Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.h index f25cdd880..f84682d89 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.h @@ -1,10 +1,10 @@ #pragma once -#include "../Models/Model.h" -#include "TileRenderer.h" +#include "../../model/geom/Model.h" +#include "../TileRenderer.h" #include "../Tesselator.h" -#include "../../Textures/Textures.h" -#include "ItemInHandRenderer.h" -#include "../../Textures/ResourceLocation.h" +#include "../Textures.h" +#include "../ItemInHandRenderer.h" +#include "../../resources/ResourceLocation.h" class Tile; class Entity; diff --git a/Minecraft.Client/Rendering/EntityRenderers/ExperienceOrbRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp similarity index 84% rename from Minecraft.Client/Rendering/EntityRenderers/ExperienceOrbRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp index b7f40a6e6..309904c9a 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ExperienceOrbRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ExperienceOrbRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "../Tesselator.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" ResourceLocation ExperienceOrbRenderer::XP_ORB_LOCATION = ResourceLocation(TN_ITEM_EXPERIENCE_ORB); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ExperienceOrbRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ExperienceOrbRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/FallingTileRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/FallingTileRenderer.cpp similarity index 86% rename from Minecraft.Client/Rendering/EntityRenderers/FallingTileRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/FallingTileRenderer.cpp index a89a08cd7..164689d20 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/FallingTileRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/FallingTileRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "FallingTileRenderer.h" -#include "../../Textures/TextureAtlas.h" -#include "TileRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../texture/TextureAtlas.h" +#include "../TileRenderer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "EntityRenderDispatcher.h" FallingTileRenderer::FallingTileRenderer() : EntityRenderer() { diff --git a/Minecraft.Client/Rendering/EntityRenderers/FallingTileRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/FallingTileRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/FallingTileRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/FallingTileRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/FireballRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp similarity index 85% rename from Minecraft.Client/Rendering/EntityRenderers/FireballRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp index fd1dce90c..1185ce270 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/FireballRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "FireballRenderer.h" #include "EntityRenderDispatcher.h" -#include "../../Textures/TextureAtlas.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../texture/TextureAtlas.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" FireballRenderer::FireballRenderer(float scale) { this->scale = scale; } diff --git a/Minecraft.Client/Rendering/EntityRenderers/FireballRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/FireballRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/FishingHookRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp similarity index 89% rename from Minecraft.Client/Rendering/EntityRenderers/FishingHookRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp index b07539ca4..f04124131 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/FishingHookRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "FishingHookRenderer.h" #include "EntityRenderDispatcher.h" -#include "../../GameState/Options.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Util/Vec3.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../Player/MultiPlayerLocalPlayer.h" +#include "../../Options.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" ResourceLocation FishingHookRenderer::PARTICLE_LOCATION = ResourceLocation(TN_PARTICLES); diff --git a/Minecraft.Client/Rendering/EntityRenderers/FishingHookRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/FishingHookRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/GhastRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/GhastRenderer.cpp similarity index 81% rename from Minecraft.Client/Rendering/EntityRenderers/GhastRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/GhastRenderer.cpp index 0eb074802..4b6feca89 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/GhastRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/GhastRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "GhastRenderer.h" -#include "../Models/GhastModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" +#include "../../model/GhastModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" ResourceLocation GhastRenderer::GHAST_LOCATION = ResourceLocation(TN_MOB_GHAST); ResourceLocation GhastRenderer::GHAST_SHOOTING_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/GhastRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/GhastRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/GhastRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/GhastRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/GiantMobRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/GiantMobRenderer.cpp similarity index 88% rename from Minecraft.Client/Rendering/EntityRenderers/GiantMobRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/GiantMobRenderer.cpp index 8206f8635..ff0b98371 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/GiantMobRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/GiantMobRenderer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "GiantMobRenderer.h" ResourceLocation GiantMobRenderer::ZOMBIE_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/GiantMobRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/GiantMobRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/GiantMobRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/GiantMobRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/HorseRenderer.cpp similarity index 95% rename from Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/HorseRenderer.cpp index 1fa12dcaf..2a6f5eb2b 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/HorseRenderer.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "HorseRenderer.h" #include "MobRenderer.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation HorseRenderer::HORSE_LOCATION = ResourceLocation(TN_MOB_HORSE_WHITE); diff --git a/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/HorseRenderer.h similarity index 96% rename from Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/HorseRenderer.h index 31f7c281c..2858652ea 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/HorseRenderer.h @@ -1,6 +1,6 @@ #pragma once #include "MobRenderer.h" -#include "../../Textures/ResourceLocation.h" +#include "../../resources/ResourceLocation.h" class EntityHorse; class PathfinderMob; diff --git a/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/HumanoidMobRenderer.cpp similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/HumanoidMobRenderer.cpp index b1f94d370..b48dca781 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/HumanoidMobRenderer.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "HumanoidMobRenderer.h" -#include "SkullTileRenderer.h" -#include "../Models/HumanoidModel.h" -#include "../Models/ModelPart.h" +#include "../tileentity/SkullTileRenderer.h" +#include "../../model/HumanoidModel.h" +#include "../../model/geom/ModelPart.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../../Minecraft.World/Headers/net.minecraft.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/net/minecraft/net.minecraft.h" const std::wstring HumanoidMobRenderer::MATERIAL_NAMES[5] = { L"cloth", L"chain", L"iron", L"diamond", L"gold"}; diff --git a/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/HumanoidMobRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/HumanoidMobRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemFrameRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp similarity index 86% rename from Minecraft.Client/Rendering/EntityRenderers/ItemFrameRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp index 9d46d6e63..56488ddc9 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemFrameRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp @@ -1,23 +1,23 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ItemRenderer.h" -#include "TileRenderer.h" +#include "../TileRenderer.h" #include "EntityRenderDispatcher.h" // #include "ItemFrame" #include "ItemFrameRenderer.h" -#include "../../Textures/TextureAtlas.h" +#include "../texture/TextureAtlas.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.alchemy.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "../../Minecraft.h" -#include "../../../Minecraft.World/Items/Item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../../Minecraft.World/Headers/net.minecraft.h" -#include "../../Textures/CompassTexture.h" -#include "../Minimap.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/Item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../texture/custom/CompassTexture.h" +#include "../../gui/Minimap.h" ResourceLocation ItemFrameRenderer::MAP_BACKGROUND_LOCATION = ResourceLocation(TN_MISC_MAPBG); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemFrameRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ItemFrameRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp similarity index 97% rename from Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp index b8641c198..bd5f17f1e 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ItemRenderer.h" -#include "TileRenderer.h" +#include "../TileRenderer.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Util/JavaMath.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.alchemy.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../GameState/Options.h" -#include "../../Textures/TextureAtlas.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../Options.h" +#include "../texture/TextureAtlas.h" ItemRenderer::ItemRenderer() : EntityRenderer() { random = new Random(); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemSpriteRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemSpriteRenderer.cpp similarity index 83% rename from Minecraft.Client/Rendering/EntityRenderers/ItemSpriteRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ItemSpriteRenderer.cpp index e530b1b2f..0dc1d3344 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemSpriteRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemSpriteRenderer.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ItemSpriteRenderer.h" #include "EntityRenderDispatcher.h" -#include "../../Textures/TextureAtlas.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.alchemy.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" +#include "../texture/TextureAtlas.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" ItemSpriteRenderer::ItemSpriteRenderer(Item* sourceItem, int sourceItemAuxValue /*= 0*/) diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemSpriteRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ItemSpriteRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ItemSpriteRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ItemSpriteRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/LavaSlimeRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/LavaSlimeRenderer.cpp similarity index 81% rename from Minecraft.Client/Rendering/EntityRenderers/LavaSlimeRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/LavaSlimeRenderer.cpp index 932449062..2a8310075 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/LavaSlimeRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/LavaSlimeRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../Models/LavaSlimeModel.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../model/LavaSlimeModel.h" #include "LavaSlimeRenderer.h" ResourceLocation LavaSlimeRenderer::MAGMACUBE_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/LavaSlimeRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/LavaSlimeRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/LavaSlimeRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/LavaSlimeRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/LeashKnotRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/LeashKnotRenderer.cpp similarity index 89% rename from Minecraft.Client/Rendering/EntityRenderers/LeashKnotRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/LeashKnotRenderer.cpp index 3988e9af4..d8f4db396 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/LeashKnotRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/LeashKnotRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "LeashKnotRenderer.h" -#include "../Models/LeashKnotModel.h" +#include "../../model/LeashKnotModel.h" ResourceLocation LeashKnotRenderer::KNOT_LOCATION = ResourceLocation(TN_ITEM_LEASHKNOT); diff --git a/Minecraft.Client/Rendering/EntityRenderers/LeashKnotRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/LeashKnotRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/LeashKnotRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/LeashKnotRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/LightningBoltRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/LightningBoltRenderer.cpp similarity index 94% rename from Minecraft.Client/Rendering/EntityRenderers/LightningBoltRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/LightningBoltRenderer.cpp index fe4321e12..8eb91e1ea 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/LightningBoltRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/LightningBoltRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "LightningBoltRenderer.h" #include "../Tesselator.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.global.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h" void LightningBoltRenderer::render(std::shared_ptr _bolt, double x, double y, double z, float rot, float a) { diff --git a/Minecraft.Client/Rendering/EntityRenderers/LightningBoltRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/LightningBoltRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/LightningBoltRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/LightningBoltRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/LivingEntityRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp similarity index 97% rename from Minecraft.Client/Rendering/EntityRenderers/LivingEntityRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp index ed2fe1e08..458f218c7 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/LivingEntityRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "LivingEntityRenderer.h" -#include "../Lighting.h" -#include "../Cube.h" -#include "../Models/ModelPart.h" +#include "../../Lighting.h" +#include "../../model/geom/Cube.h" +#include "../../model/geom/ModelPart.h" #include "EntityRenderDispatcher.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Entities/Mobs/Arrow.h" -#include "../../../Minecraft.World/Util/Mth.h" -#include "../../../Minecraft.World/Player/Player.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/Arrow.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/Player.h" ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION = ResourceLocation(TN__BLUR__MISC_GLINT); diff --git a/Minecraft.Client/Rendering/EntityRenderers/LivingEntityRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.h similarity index 95% rename from Minecraft.Client/Rendering/EntityRenderers/LivingEntityRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.h index b6d73b003..14e69e456 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/LivingEntityRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Textures/ResourceLocation.h" +#include "../../resources/ResourceLocation.h" #include "EntityRenderer.h" -#include "../../../Minecraft.World/Entities/LivingEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/LivingEntity.h" class LivingEntity; diff --git a/Minecraft.Client/Rendering/EntityRenderers/MinecartRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp similarity index 92% rename from Minecraft.Client/Rendering/EntityRenderers/MinecartRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp index 82f808e09..4c9e35475 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MinecartRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "MinecartRenderer.h" #include -#include "../Models/MinecartModel.h" -#include "../../Textures/TextureAtlas.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../model/MinecartModel.h" +#include "../texture/TextureAtlas.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" ResourceLocation MinecartRenderer::MINECART_LOCATION(TN_ITEM_CART); diff --git a/Minecraft.Client/Rendering/EntityRenderers/MinecartRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/MinecartRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/MinecartSpawnerRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartSpawnerRenderer.cpp similarity index 57% rename from Minecraft.Client/Rendering/EntityRenderers/MinecartSpawnerRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/MinecartSpawnerRenderer.cpp index 90f2da54a..ea0ecfe9c 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MinecartSpawnerRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartSpawnerRenderer.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "MinecartSpawnerRenderer.h" -#include "../../../Minecraft.World/Blocks/Tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "MobSpawnerRenderer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/Tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../tileentity/MobSpawnerRenderer.h" void MinecartSpawnerRenderer::renderMinecartContents( std::shared_ptr cart, float a, Tile* tile, int tileData) { diff --git a/Minecraft.Client/Rendering/EntityRenderers/MinecartSpawnerRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartSpawnerRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/MinecartSpawnerRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/MinecartSpawnerRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp similarity index 90% rename from Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp index 838892f99..e7d79caba 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "MobRenderer.h" #include "LivingEntityRenderer.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "EntityRenderDispatcher.h" MobRenderer::MobRenderer(Model* model, float shadow) diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/MobRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/MushroomCowRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/MushroomCowRenderer.cpp similarity index 83% rename from Minecraft.Client/Rendering/EntityRenderers/MushroomCowRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/MushroomCowRenderer.cpp index a45b8b20f..4592fe549 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MushroomCowRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/MushroomCowRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../Models/ModelPart.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/geom/ModelPart.h" #include "MushroomCowRenderer.h" -#include "../../Textures/TextureAtlas.h" -#include "../Models/QuadrupedModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../texture/TextureAtlas.h" +#include "../../model/QuadrupedModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" ResourceLocation MushroomCowRenderer::MOOSHROOM_LOCATION = ResourceLocation(TN_MOB_RED_COW); diff --git a/Minecraft.Client/Rendering/EntityRenderers/MushroomCowRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/MushroomCowRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/MushroomCowRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/MushroomCowRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/OcelotRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/OcelotRenderer.cpp similarity index 90% rename from Minecraft.Client/Rendering/EntityRenderers/OcelotRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/OcelotRenderer.cpp index 134c6db22..17bab5898 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/OcelotRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/OcelotRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "OcelotRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation OcelotRenderer::CAT_BLACK_LOCATION = ResourceLocation(TN_MOB_CAT_BLACK); diff --git a/Minecraft.Client/Rendering/EntityRenderers/OcelotRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/OcelotRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/OcelotRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/OcelotRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/PaintingRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp similarity index 92% rename from Minecraft.Client/Rendering/EntityRenderers/PaintingRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp index 91449b4b6..4c0cdfd4f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PaintingRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "PaintingRenderer.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" ResourceLocation PaintingRenderer::PAINTING_LOCATION(TN_ART_KZ); diff --git a/Minecraft.Client/Rendering/EntityRenderers/PaintingRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/PaintingRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/PigRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp similarity index 85% rename from Minecraft.Client/Rendering/EntityRenderers/PigRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp index c1281fc66..c16e66dcf 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PigRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "PigRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation PigRenderer::PIG_LOCATION = ResourceLocation(TN_MOB_PIG); ResourceLocation PigRenderer::SADDLE_LOCATION = ResourceLocation(TN_MOB_SADDLE); diff --git a/Minecraft.Client/Rendering/EntityRenderers/PigRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/PigRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp similarity index 95% rename from Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp index d032450e3..2e20d6dd1 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "PlayerRenderer.h" -#include "SkullTileRenderer.h" +#include "../tileentity/SkullTileRenderer.h" #include "HumanoidMobRenderer.h" -#include "../Models/HumanoidModel.h" -#include "../Models/ModelPart.h" -#include "../../Player/LocalPlayer.h" -#include "../../Player/MultiPlayerLocalPlayer.h" +#include "../../model/HumanoidModel.h" +#include "../../model/geom/ModelPart.h" +#include "../../player/LocalPlayer.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" #include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] = { diff --git a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.h similarity index 95% rename from Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.h index e754b9a3c..629eba1da 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.h @@ -1,6 +1,6 @@ #pragma once #include "MobRenderer.h" -#include "../../../Minecraft.World/Player/Player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/Player.h" class HumanoidModel; diff --git a/Minecraft.Client/Rendering/EntityRenderers/SheepRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp similarity index 91% rename from Minecraft.Client/Rendering/EntityRenderers/SheepRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp index a95f9f971..617908932 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SheepRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SheepRenderer.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation SheepRenderer::SHEEP_LOCATION = ResourceLocation(TN_MOB_SHEEP); ResourceLocation SheepRenderer::SHEEP_FUR_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/SheepRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SheepRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SilverfishRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SilverfishRenderer.cpp similarity index 77% rename from Minecraft.Client/Rendering/EntityRenderers/SilverfishRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SilverfishRenderer.cpp index ad88672d0..9e4f41d05 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SilverfishRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SilverfishRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SilverfishRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../Models/SilverfishModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../model/SilverfishModel.h" ResourceLocation SilverfishRenderer::SILVERFISH_LOCATION(TN_MOB_SILVERFISH); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SilverfishRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SilverfishRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SilverfishRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SilverfishRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SkeletonRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SkeletonRenderer.cpp similarity index 83% rename from Minecraft.Client/Rendering/EntityRenderers/SkeletonRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SkeletonRenderer.cpp index 7538ff352..14f8e54a4 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SkeletonRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SkeletonRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SkeletonRenderer.h" -#include "../Models/SkeletonModel.h" -#include "../../../Minecraft.World/Entities/Mobs/Skeleton.h" +#include "../../model/SkeletonModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/Skeleton.h" ResourceLocation SkeletonRenderer::SKELETON_LOCATION = ResourceLocation(TN_MOB_SKELETON); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SkeletonRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SkeletonRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SkeletonRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SkeletonRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SlimeRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SlimeRenderer.cpp similarity index 89% rename from Minecraft.Client/Rendering/EntityRenderers/SlimeRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SlimeRenderer.cpp index 21def8ae8..009b187ac 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SlimeRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SlimeRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SlimeRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" ResourceLocation SlimeRenderer::SLIME_LOCATION = ResourceLocation(TN_MOB_SLIME); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SlimeRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SlimeRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SlimeRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SlimeRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SnowManRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SnowManRenderer.cpp similarity index 77% rename from Minecraft.Client/Rendering/EntityRenderers/SnowManRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SnowManRenderer.cpp index 3394d7d10..c88ba639c 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SnowManRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SnowManRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../Models/SnowManModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../Models/ModelPart.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/SnowManModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../model/geom/ModelPart.h" #include "EntityRenderDispatcher.h" #include "SnowManRenderer.h" diff --git a/Minecraft.Client/Rendering/EntityRenderers/SnowManRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SnowManRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SnowManRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SnowManRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SpiderRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp similarity index 91% rename from Minecraft.Client/Rendering/EntityRenderers/SpiderRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp index bc03ecb3b..108464643 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SpiderRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SpiderRenderer.h" -#include "../Models/SpiderModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" +#include "../../model/SpiderModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" ResourceLocation SpiderRenderer::SPIDER_LOCATION = ResourceLocation(TN_MOB_SPIDER); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SpiderRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SpiderRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SquidRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/SquidRenderer.cpp similarity index 89% rename from Minecraft.Client/Rendering/EntityRenderers/SquidRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/SquidRenderer.cpp index 411be9141..471715e75 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SquidRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/SquidRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SquidRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation SquidRenderer::SQUID_LOCATION = ResourceLocation(TN_MOB_SQUID); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SquidRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/SquidRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SquidRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/SquidRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/TntMinecartRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/TntMinecartRenderer.cpp similarity index 79% rename from Minecraft.Client/Rendering/EntityRenderers/TntMinecartRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/TntMinecartRenderer.cpp index ef7900b58..93b9e26ab 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TntMinecartRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/TntMinecartRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TntMinecartRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" void TntMinecartRenderer::renderMinecartContents( std::shared_ptr _cart, float a, Tile* tile, int tileData) { diff --git a/Minecraft.Client/Rendering/EntityRenderers/TntMinecartRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/TntMinecartRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/TntMinecartRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/TntMinecartRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/TntRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/TntRenderer.cpp similarity index 83% rename from Minecraft.Client/Rendering/EntityRenderers/TntRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/TntRenderer.cpp index 86754c5aa..722f9ff4f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TntRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/TntRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TntRenderer.h" -#include "../../Textures/TextureAtlas.h" -#include "TileRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../texture/TextureAtlas.h" +#include "../TileRenderer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" TntRenderer::TntRenderer() { renderer = new TileRenderer(); diff --git a/Minecraft.Client/Rendering/EntityRenderers/TntRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/TntRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/TntRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/TntRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/VillagerGolemRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp similarity index 86% rename from Minecraft.Client/Rendering/EntityRenderers/VillagerGolemRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp index 8d1650c98..b4c1de269 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/VillagerGolemRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../Models/VillagerGolemModel.h" -#include "../Models/ModelPart.h" -#include "../../Textures/TextureAtlas.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../model/VillagerGolemModel.h" +#include "../../model/geom/ModelPart.h" +#include "../texture/TextureAtlas.h" #include "VillagerGolemRenderer.h" ResourceLocation VillagerGolemRenderer::GOLEM_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/VillagerGolemRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/VillagerGolemRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/VillagerRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerRenderer.cpp similarity index 92% rename from Minecraft.Client/Rendering/EntityRenderers/VillagerRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/VillagerRenderer.cpp index e91151b5f..1714a328f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/VillagerRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.npc.h" -#include "../Models/VillagerModel.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h" +#include "../../model/VillagerModel.h" #include "VillagerRenderer.h" ResourceLocation VillagerRenderer::VILLAGER_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/VillagerRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/VillagerRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/VillagerRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/WitchRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/WitchRenderer.cpp similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/WitchRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/WitchRenderer.cpp index 2c25af985..5491ffe3f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/WitchRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/WitchRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "EntityRenderDispatcher.h" #include "WitchRenderer.h" -#include "../Models/WitchModel.h" -#include "../Models/ModelPart.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../model/WitchModel.h" +#include "../../model/geom/ModelPart.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" ResourceLocation WitchRenderer::WITCH_LOCATION = ResourceLocation(TN_MOB_WITCH); diff --git a/Minecraft.Client/Rendering/EntityRenderers/WitchRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/WitchRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/WitchRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/WitchRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/WitherBossRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/WitherBossRenderer.cpp similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/WitherBossRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/WitherBossRenderer.cpp index c0d38e65e..cf6f0aa57 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/WitherBossRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/WitherBossRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "WitherBossRenderer.h" -#include "../Models/WitherBossModel.h" +#include "../../model/WitherBossModel.h" #include "MobRenderer.h" -#include "../../../Minecraft.World/Entities/Mobs/WitherBoss.h" -#include "../../UI/BossMobGuiInfo.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.h" +#include "../BossMobGuiInfo.h" ResourceLocation WitherBossRenderer::WITHER_ARMOR_LOCATION = ResourceLocation(TN_MOB_WITHER_ARMOR); diff --git a/Minecraft.Client/Rendering/EntityRenderers/WitherBossRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/WitherBossRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/WitherBossRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/WitherBossRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/WitherSkullRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/WitherSkullRenderer.cpp similarity index 86% rename from Minecraft.Client/Rendering/EntityRenderers/WitherSkullRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/WitherSkullRenderer.cpp index dc2794f09..f05a42132 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/WitherSkullRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/WitherSkullRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "WitherSkullRenderer.h" -#include "../Models/SkeletonHeadModel.h" -#include "../../../Minecraft.World/Entities/WitherSkull.h" +#include "../../model/SkeletonHeadModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.h" ResourceLocation WitherSkullRenderer::WITHER_ARMOR_LOCATION( TN_MOB_WITHER_INVULNERABLE); diff --git a/Minecraft.Client/Rendering/EntityRenderers/WitherSkullRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/WitherSkullRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/WitherSkullRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/WitherSkullRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/WolfRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/WolfRenderer.cpp similarity index 90% rename from Minecraft.Client/Rendering/EntityRenderers/WolfRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/WolfRenderer.cpp index ddeb8acf3..4b53ddd4d 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/WolfRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/WolfRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "WolfRenderer.h" -#include "../../Player/MultiPlayerLocalPlayer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" +#include "../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" ResourceLocation* WolfRenderer::WOLF_LOCATION = new ResourceLocation(TN_MOB_WOLF); diff --git a/Minecraft.Client/Rendering/EntityRenderers/WolfRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/WolfRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/WolfRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/WolfRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ZombieRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp similarity index 92% rename from Minecraft.Client/Rendering/EntityRenderers/ZombieRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp index 46c79e157..784e21dd0 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ZombieRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../Models/ZombieModel.h" -#include "../Models/VillagerZombieModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/ZombieModel.h" +#include "../../model/VillagerZombieModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" #include "ZombieRenderer.h" ResourceLocation ZombieRenderer::ZOMBIE_PIGMAN_LOCATION(TN_MOB_PIGZOMBIE); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ZombieRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ZombieRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.h diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp similarity index 97% rename from Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp index 553f63221..9f42dd6fb 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp @@ -1,23 +1,23 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.World/IO/Streams/ByteBuffer.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" #include "../../Minecraft.h" -#include "../../Rendering/LevelRenderer.h" -#include "../../Rendering/EntityRenderers/EntityRenderDispatcher.h" +#include "../LevelRenderer.h" +#include "../entity/EntityRenderDispatcher.h" #include "Stitcher.h" #include "StitchSlot.h" #include "StitchedTexture.h" -#include "../Texture.h" -#include "../TextureHolder.h" -#include "../TextureManager.h" -#include "../Packs/TexturePack.h" -#include "../Packs/TexturePackRepository.h" +#include "Texture.h" +#include "TextureHolder.h" +#include "TextureManager.h" +#include "../../skins/TexturePack.h" +#include "../../skins/TexturePackRepository.h" #include "PreStitchedTextureMap.h" -#include "../../UI/SimpleIcon.h" -#include "../CompassTexture.h" -#include "../ClockTexture.h" +#include "SimpleIcon.h" +#include "custom/CompassTexture.h" +#include "custom/ClockTexture.h" const std::wstring PreStitchedTextureMap::NAME_MISSING_TEXTURE = L"missingno"; diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h b/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.h similarity index 95% rename from Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.h index 2d735f9a9..2fec945d6 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../Minecraft.World/Util/IconRegister.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/IconRegister.h" class Icon; class StitchedTexture; diff --git a/Minecraft.Client/UI/SimpleIcon.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/SimpleIcon.cpp similarity index 79% rename from Minecraft.Client/UI/SimpleIcon.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/SimpleIcon.cpp index 33d5b5057..395235582 100644 --- a/Minecraft.Client/UI/SimpleIcon.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/SimpleIcon.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SimpleIcon.h" SimpleIcon::SimpleIcon(const std::wstring& name, const std::wstring& filename, diff --git a/Minecraft.Client/UI/SimpleIcon.h b/Minecraft.Client/net/minecraft/client/renderer/texture/SimpleIcon.h similarity index 75% rename from Minecraft.Client/UI/SimpleIcon.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/SimpleIcon.h index a01014cb7..e0114bf50 100644 --- a/Minecraft.Client/UI/SimpleIcon.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/SimpleIcon.h @@ -1,6 +1,6 @@ #pragma once -#include "../Platform/stdafx.h" -#include "../Textures/Stitching/StitchedTexture.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "StitchedTexture.h" // 4J Added this class to store the uv data that we have pre-calculated and // loaded from a file diff --git a/Minecraft.Client/Textures/Stitching/StitchSlot.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchSlot.cpp similarity index 96% rename from Minecraft.Client/Textures/Stitching/StitchSlot.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/StitchSlot.cpp index 2a98bd466..44c868afa 100644 --- a/Minecraft.Client/Textures/Stitching/StitchSlot.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchSlot.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../TextureHolder.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "TextureHolder.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "StitchSlot.h" StitchSlot::StitchSlot(int originX, int originY, int width, int height) diff --git a/Minecraft.Client/Textures/Stitching/StitchSlot.h b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchSlot.h similarity index 100% rename from Minecraft.Client/Textures/Stitching/StitchSlot.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/StitchSlot.h diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchedTexture.cpp similarity index 97% rename from Minecraft.Client/Textures/Stitching/StitchedTexture.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/StitchedTexture.cpp index a91cc8c71..d834a34b7 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchedTexture.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../Texture.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../ClockTexture.h" -#include "../CompassTexture.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "Texture.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "custom/ClockTexture.h" +#include "custom/CompassTexture.h" #include "StitchedTexture.h" -#include "../TextureManager.h" +#include "TextureManager.h" StitchedTexture* StitchedTexture::create(const std::wstring& name) { // TODO: Generalize? diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.h b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchedTexture.h similarity index 96% rename from Minecraft.Client/Textures/Stitching/StitchedTexture.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/StitchedTexture.h index 1f90e43ff..eb02fe8a0 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/StitchedTexture.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../Minecraft.World/Util/Icon.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/Icon.h" class Texture; class StitchedTexture : public Icon { diff --git a/Minecraft.Client/Textures/Stitching/Stitcher.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/Stitcher.cpp similarity index 98% rename from Minecraft.Client/Textures/Stitching/Stitcher.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/Stitcher.cpp index 611cd37dd..3e20d5e6e 100644 --- a/Minecraft.Client/Textures/Stitching/Stitcher.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/Stitcher.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "StitchSlot.h" -#include "../Texture.h" -#include "../TextureHolder.h" -#include "../TextureManager.h" +#include "Texture.h" +#include "TextureHolder.h" +#include "TextureManager.h" #include "StitchedTexture.h" #include "Stitcher.h" diff --git a/Minecraft.Client/Textures/Stitching/Stitcher.h b/Minecraft.Client/net/minecraft/client/renderer/texture/Stitcher.h similarity index 98% rename from Minecraft.Client/Textures/Stitching/Stitcher.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/Stitcher.h index ca5c7846a..bb7aebb14 100644 --- a/Minecraft.Client/Textures/Stitching/Stitcher.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/Stitcher.h @@ -2,7 +2,7 @@ class StitchSlot; class Texture; -#include "../TextureHolder.h" +#include "TextureHolder.h" class Stitcher { public: diff --git a/Minecraft.Client/Textures/Texture.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp similarity index 99% rename from Minecraft.Client/Textures/Texture.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp index 2ec68febc..d83dd2667 100644 --- a/Minecraft.Client/Textures/Texture.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.World/IO/Streams/ByteBuffer.h" -#include "../UI/Rect2i.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "../Rect2i.h" #include "TextureManager.h" #include "Texture.h" diff --git a/Minecraft.Client/Textures/Texture.h b/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.h similarity index 100% rename from Minecraft.Client/Textures/Texture.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/Texture.h diff --git a/Minecraft.Client/Textures/TextureAtlas.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureAtlas.cpp similarity index 62% rename from Minecraft.Client/Textures/TextureAtlas.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureAtlas.cpp index cfdc7b9bb..09ef5c6ae 100644 --- a/Minecraft.Client/Textures/TextureAtlas.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureAtlas.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TextureAtlas.h" -#include "ResourceLocation.h" +#include "../../resources/ResourceLocation.h" ResourceLocation TextureAtlas::LOCATION_BLOCKS = ResourceLocation(TN_TERRAIN); ResourceLocation TextureAtlas::LOCATION_ITEMS = ResourceLocation(TN_GUI_ITEMS); \ No newline at end of file diff --git a/Minecraft.Client/Textures/TextureAtlas.h b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureAtlas.h similarity index 100% rename from Minecraft.Client/Textures/TextureAtlas.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureAtlas.h diff --git a/Minecraft.Client/Textures/TextureHolder.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureHolder.cpp similarity index 92% rename from Minecraft.Client/Textures/TextureHolder.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureHolder.cpp index 3c29330c6..5dfc3c081 100644 --- a/Minecraft.Client/Textures/TextureHolder.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureHolder.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "Stitching/Stitcher.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "Stitcher.h" #include "Texture.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "TextureHolder.h" TextureHolder::TextureHolder(Texture* texture) { diff --git a/Minecraft.Client/Textures/TextureHolder.h b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureHolder.h similarity index 100% rename from Minecraft.Client/Textures/TextureHolder.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureHolder.h diff --git a/Minecraft.Client/Textures/TextureManager.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp similarity index 96% rename from Minecraft.Client/Textures/TextureManager.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp index ac92dc81c..f84a95e40 100644 --- a/Minecraft.Client/Textures/TextureManager.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "Stitching/Stitcher.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "Stitcher.h" #include "Texture.h" -#include "Packs/TexturePack.h" -#include "Packs/TexturePackRepository.h" -#include "../Minecraft.h" +#include "../../skins/TexturePack.h" +#include "../../skins/TexturePackRepository.h" +#include "../../Minecraft.h" #include "TextureManager.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" TextureManager* TextureManager::instance = nullptr; diff --git a/Minecraft.Client/Textures/TextureManager.h b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.h similarity index 100% rename from Minecraft.Client/Textures/TextureManager.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.h diff --git a/Minecraft.Client/Textures/Stitching/TextureMap.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureMap.cpp similarity index 93% rename from Minecraft.Client/Textures/Stitching/TextureMap.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureMap.cpp index 20a636913..dd4908d1d 100644 --- a/Minecraft.Client/Textures/Stitching/TextureMap.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureMap.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "../../Minecraft.h" -#include "../../Rendering/LevelRenderer.h" -#include "../../Rendering/EntityRenderers/EntityRenderDispatcher.h" +#include "../LevelRenderer.h" +#include "../entity/EntityRenderDispatcher.h" #include "Stitcher.h" #include "StitchSlot.h" #include "StitchedTexture.h" -#include "../Texture.h" -#include "../TextureHolder.h" -#include "../TextureManager.h" -#include "../Packs/TexturePack.h" -#include "../Packs/TexturePackRepository.h" +#include "Texture.h" +#include "TextureHolder.h" +#include "TextureManager.h" +#include "../../skins/TexturePack.h" +#include "../../skins/TexturePackRepository.h" #include "TextureMap.h" const std::wstring TextureMap::NAME_MISSING_TEXTURE = L"missingno"; diff --git a/Minecraft.Client/Textures/Stitching/TextureMap.h b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureMap.h similarity index 94% rename from Minecraft.Client/Textures/Stitching/TextureMap.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/TextureMap.h index d139b1e4e..da2a66b3c 100644 --- a/Minecraft.Client/Textures/Stitching/TextureMap.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/TextureMap.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../Minecraft.World/Util/IconRegister.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/IconRegister.h" class StitchedTexture; class Texture; diff --git a/Minecraft.Client/Textures/ClockTexture.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp similarity index 84% rename from Minecraft.Client/Textures/ClockTexture.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp index adecbd545..5a9560e0b 100644 --- a/Minecraft.Client/Textures/ClockTexture.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Minecraft.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "Texture.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../Minecraft.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../Texture.h" #include "ClockTexture.h" ClockTexture::ClockTexture() : StitchedTexture(L"clock", L"clock") { diff --git a/Minecraft.Client/Textures/ClockTexture.h b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.h similarity index 92% rename from Minecraft.Client/Textures/ClockTexture.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.h index fc745bed7..9ec172d93 100644 --- a/Minecraft.Client/Textures/ClockTexture.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.h @@ -1,5 +1,5 @@ #pragma once -#include "Stitching/StitchedTexture.h" +#include "../StitchedTexture.h" class ClockTexture : public StitchedTexture { private: diff --git a/Minecraft.Client/Textures/CompassTexture.cpp b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp similarity index 87% rename from Minecraft.Client/Textures/CompassTexture.cpp rename to Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp index 857ceeeb5..23c952ae2 100644 --- a/Minecraft.Client/Textures/CompassTexture.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Minecraft.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../Player/MultiPlayerLocalPlayer.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "Texture.h" +#include "../../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../Minecraft.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../Texture.h" #include "CompassTexture.h" CompassTexture* CompassTexture::instance = nullptr; diff --git a/Minecraft.Client/Textures/CompassTexture.h b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.h similarity index 94% rename from Minecraft.Client/Textures/CompassTexture.h rename to Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.h index 50121d7db..cdad3280f 100644 --- a/Minecraft.Client/Textures/CompassTexture.h +++ b/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.h @@ -1,5 +1,5 @@ #pragma once -#include "Stitching/StitchedTexture.h" +#include "../StitchedTexture.h" class CompassTexture : public StitchedTexture { private: diff --git a/Minecraft.Client/Rendering/EntityRenderers/BeaconRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp similarity index 94% rename from Minecraft.Client/Rendering/EntityRenderers/BeaconRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp index 017dee765..8bc2ca8df 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/BeaconRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "BeaconRenderer.h" #include "../Tesselator.h" diff --git a/Minecraft.Client/Rendering/EntityRenderers/BeaconRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/BeaconRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/ChestRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp similarity index 88% rename from Minecraft.Client/Rendering/EntityRenderers/ChestRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp index 8d33aa0a2..5fd0e3f08 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ChestRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "ChestRenderer.h" -#include "../Models/ChestModel.h" -#include "../Models/LargeChestModel.h" -#include "../Models/ModelPart.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Level/Calendar.h" +#include "../../model/ChestModel.h" +#include "../../model/LargeChestModel.h" +#include "../../model/geom/ModelPart.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/Calendar.h" ResourceLocation ChestRenderer::CHEST_LARGE_TRAP_LOCATION = ResourceLocation(TN_TILE_LARGE_TRAP_CHEST); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ChestRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/ChestRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnchantTableRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp similarity index 85% rename from Minecraft.Client/Rendering/EntityRenderers/EnchantTableRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp index f215d186d..60c107a4a 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EnchantTableRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../Models/BookModel.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../Minecraft.World/Util/Mth.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../model/BookModel.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/util/Mth.h" #include "EnchantTableRenderer.h" ResourceLocation EnchantTableRenderer::BOOK_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnchantTableRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/EnchantTableRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderChestRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp similarity index 86% rename from Minecraft.Client/Rendering/EntityRenderers/EnderChestRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp index d27799560..4462bf493 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EnderChestRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../Models/ModelPart.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../model/geom/ModelPart.h" #include "EnderChestRenderer.h" ResourceLocation EnderChestRenderer::ENDER_CHEST_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/EnderChestRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.h similarity index 91% rename from Minecraft.Client/Rendering/EntityRenderers/EnderChestRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.h index afa310b3a..46ee5aa62 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EnderChestRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.h @@ -1,6 +1,6 @@ #pragma once #include "TileEntityRenderer.h" -#include "../Models/ChestModel.h" +#include "../../model/ChestModel.h" class EnderChestRenderer : public TileEntityRenderer { private: diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/MobSpawnerRenderer.cpp similarity index 79% rename from Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/MobSpawnerRenderer.cpp index 6207ee94b..e98d1f49a 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/MobSpawnerRenderer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "MobSpawnerRenderer.h" #include "TileEntityRenderDispatcher.h" -#include "EntityRenderDispatcher.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.h" +#include "../entity/EntityRenderDispatcher.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" void MobSpawnerRenderer::render(std::shared_ptr _spawner, double x, double y, double z, float a, bool setColor, diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/MobSpawnerRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/MobSpawnerRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/PistonPieceRenderer.cpp similarity index 87% rename from Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/PistonPieceRenderer.cpp index 903091602..23e79a88c 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/PistonPieceRenderer.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "PistonPieceRenderer.h" -#include "../Lighting.h" +#include "../../Lighting.h" #include "../Tesselator.h" -#include "../../Textures/TextureAtlas.h" -#include "TileRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../texture/TextureAtlas.h" +#include "../TileRenderer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" ResourceLocation PistonPieceRenderer::SIGN_LOCATION = ResourceLocation(TN_ITEM_SIGN); diff --git a/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/PistonPieceRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/PistonPieceRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/SignRenderer.cpp similarity index 87% rename from Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/SignRenderer.cpp index b368f0760..7775e1979 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/SignRenderer.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SignRenderer.h" -#include "../Models/SignModel.h" -#include "../Models/ModelPart.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.World/Entities/Entity.h" -#include "../../../Minecraft.World/Level/Level.h" +#include "../../model/SignModel.h" +#include "../../model/geom/ModelPart.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/Entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/Level.h" ResourceLocation SignRenderer::SIGN_LOCATION = ResourceLocation(TN_ITEM_SIGN); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/SignRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SignRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/SignRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/SkullTileRenderer.cpp similarity index 89% rename from Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/SkullTileRenderer.cpp index 22fc1763b..c28c6f890 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/SkullTileRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "SkullTileRenderer.h" -#include "../Models/SkeletonHeadModel.h" -#include "PlayerRenderer.h" -#include "../../../Minecraft.World/Blocks/TileEntities/SkullTileEntity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../model/SkeletonHeadModel.h" +#include "../entity/PlayerRenderer.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" SkullTileRenderer* SkullTileRenderer::instance = nullptr; diff --git a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/SkullTileRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/SkullTileRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/TheEndPortalRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp similarity index 92% rename from Minecraft.Client/Rendering/EntityRenderers/TheEndPortalRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp index 2a780c229..c867709f8 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TheEndPortalRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.World/Util/Random.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "../Tesselator.h" #include "TileEntityRenderDispatcher.h" -#include "../Camera.h" -#include "../../../Minecraft.World/IO/Streams/FloatBuffer.h" +#include "../../Camera.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" #include "TheEndPortalRenderer.h" ResourceLocation TheEndPortalRenderer::END_SKY_LOCATION = diff --git a/Minecraft.Client/Rendering/EntityRenderers/TheEndPortalRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.h similarity index 100% rename from Minecraft.Client/Rendering/EntityRenderers/TheEndPortalRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.h diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.cpp similarity index 91% rename from Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.cpp index f3cec5af6..7ef77d731 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TileEntityRenderDispatcher.h" #include "TileEntityRenderer.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.h" #include "SignRenderer.h" #include "MobSpawnerRenderer.h" #include "PistonPieceRenderer.h" diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h index b748eb846..6ca5ad0f1 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.h +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Textures/Textures.h" -#include "../../../Minecraft.World/Util/JavaIntHash.h" +#include "../Textures.h" +#include "../../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" class Mob; class Level; class TileEntityRenderer; diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderer.cpp similarity index 93% rename from Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderer.cpp index 97d660a73..60e2357cd 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Minecraft.World/Header Files/stdafx.h" #include "TileEntityRenderer.h" #include "TileEntityRenderDispatcher.h" diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderer.h similarity index 91% rename from Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h rename to Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderer.h index a3656ebbf..d5436e945 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h +++ b/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderer.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Textures/Textures.h" -#include "../../Textures/ResourceLocation.h" +#include "../Textures.h" +#include "../../resources/ResourceLocation.h" class TileEntityRenderDispatcher; class TileEntity; diff --git a/Minecraft.Client/Textures/ResourceLocation.h b/Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h similarity index 97% rename from Minecraft.Client/Textures/ResourceLocation.h rename to Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h index 9cf96e6de..975a7368d 100644 --- a/Minecraft.Client/Textures/ResourceLocation.h +++ b/Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h @@ -1,5 +1,5 @@ #pragma once -#include "Textures.h" +#include "../renderer/Textures.h" typedef arrayWithLength<_TEXTURE_NAME> textureNameArray; class ResourceLocation { diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp b/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp similarity index 96% rename from Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp rename to Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp index 8d4051fdd..c408c85f0 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../Textures.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../renderer/Textures.h" #include "AbstractTexturePack.h" -#include "../../../Minecraft.World/IO/Streams/InputOutputStream.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #include diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h b/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.h similarity index 100% rename from Minecraft.Client/Textures/Packs/AbstractTexturePack.h rename to Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.h diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp b/Minecraft.Client/net/minecraft/client/skins/DLCTexturePack.cpp similarity index 94% rename from Minecraft.Client/Textures/Packs/DLCTexturePack.cpp rename to Minecraft.Client/net/minecraft/client/skins/DLCTexturePack.cpp index 0feb4ec7d..a2112f2b5 100644 --- a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/DLCTexturePack.cpp @@ -1,23 +1,23 @@ -#include "../../Platform/stdafx.h" -#include "../../Platform/Common/DLC/DLCGameRulesFile.h" -#include "../../Platform/Common/DLC/DLCGameRulesHeader.h" -#include "../../Platform/Common/DLC/DLCGameRules.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../../../Common/Source Files/DLC/DLCGameRulesFile.h" +#include "../../../../Common/Source Files/DLC/DLCGameRulesHeader.h" +#include "../../../../Common/Source Files/DLC/DLCGameRules.h" #include "DLCTexturePack.h" -#include "../../Platform/Common/DLC/DLCColourTableFile.h" -#include "../../Platform/Common/DLC/DLCUIDataFile.h" -#include "../../Platform/Common/DLC/DLCTextureFile.h" -#include "../../Platform/Common/DLC/DLCLocalisationFile.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/Util/PortableFileIO.h" -#include "../../Utils/StringTable.h" -#include "../../Platform/Common/DLC/DLCAudioFile.h" +#include "../../../../Common/Source Files/DLC/DLCColourTableFile.h" +#include "../../../../Common/Source Files/DLC/DLCUIDataFile.h" +#include "../../../../Common/Source Files/DLC/DLCTextureFile.h" +#include "../../../../Common/Source Files/DLC/DLCLocalisationFile.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/Header Files/PortableFileIO.h" +#include "../../../../Common/Source Files/Localisation/StringTable.h" +#include "../../../../Common/Source Files/DLC/DLCAudioFile.h" #include #include #if defined(_WINDOWS64) -#include "../../Platform/Common/XML/ATGXmlParser.h" -#include "../../Platform/Common/XML/xmlFilesCallback.h" +#include "../../../../Windows64/XML/ATGXmlParser.h" +#include "../../../../Windows64/XML/xmlFilesCallback.h" #endif namespace { diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.h b/Minecraft.Client/net/minecraft/client/skins/DLCTexturePack.h similarity index 100% rename from Minecraft.Client/Textures/Packs/DLCTexturePack.h rename to Minecraft.Client/net/minecraft/client/skins/DLCTexturePack.h diff --git a/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp b/Minecraft.Client/net/minecraft/client/skins/DefaultTexturePack.cpp similarity index 91% rename from Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp rename to Minecraft.Client/net/minecraft/client/skins/DefaultTexturePack.cpp index 2774d398a..d460fcd42 100644 --- a/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/DefaultTexturePack.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DefaultTexturePack.h" -#include "../Textures.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" +#include "../renderer/Textures.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" DefaultTexturePack::DefaultTexturePack() : AbstractTexturePack(0, nullptr, L"Minecraft", nullptr) { diff --git a/Minecraft.Client/Textures/Packs/DefaultTexturePack.h b/Minecraft.Client/net/minecraft/client/skins/DefaultTexturePack.h similarity index 100% rename from Minecraft.Client/Textures/Packs/DefaultTexturePack.h rename to Minecraft.Client/net/minecraft/client/skins/DefaultTexturePack.h diff --git a/Minecraft.Client/Textures/Packs/FileTexturePack.cpp b/Minecraft.Client/net/minecraft/client/skins/FileTexturePack.cpp similarity index 92% rename from Minecraft.Client/Textures/Packs/FileTexturePack.cpp rename to Minecraft.Client/net/minecraft/client/skins/FileTexturePack.cpp index a7a48daa3..472ea641f 100644 --- a/Minecraft.Client/Textures/Packs/FileTexturePack.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/FileTexturePack.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "FileTexturePack.h" FileTexturePack::FileTexturePack(std::uint32_t id, File* file, diff --git a/Minecraft.Client/Textures/Packs/FileTexturePack.h b/Minecraft.Client/net/minecraft/client/skins/FileTexturePack.h similarity index 100% rename from Minecraft.Client/Textures/Packs/FileTexturePack.h rename to Minecraft.Client/net/minecraft/client/skins/FileTexturePack.h diff --git a/Minecraft.Client/Textures/Packs/FolderTexturePack.cpp b/Minecraft.Client/net/minecraft/client/skins/FolderTexturePack.cpp similarity index 96% rename from Minecraft.Client/Textures/Packs/FolderTexturePack.cpp rename to Minecraft.Client/net/minecraft/client/skins/FolderTexturePack.cpp index f2b466b34..2c6235c35 100644 --- a/Minecraft.Client/Textures/Packs/FolderTexturePack.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/FolderTexturePack.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "FolderTexturePack.h" FolderTexturePack::FolderTexturePack(std::uint32_t id, const std::wstring& name, diff --git a/Minecraft.Client/Textures/Packs/FolderTexturePack.h b/Minecraft.Client/net/minecraft/client/skins/FolderTexturePack.h similarity index 100% rename from Minecraft.Client/Textures/Packs/FolderTexturePack.h rename to Minecraft.Client/net/minecraft/client/skins/FolderTexturePack.h diff --git a/Minecraft.Client/Textures/Packs/TexturePack.cpp b/Minecraft.Client/net/minecraft/client/skins/TexturePack.cpp similarity index 86% rename from Minecraft.Client/Textures/Packs/TexturePack.cpp rename to Minecraft.Client/net/minecraft/client/skins/TexturePack.cpp index 1cbe8e450..f4bc55688 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/TexturePack.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TexturePack.h" std::wstring TexturePack::getPath( diff --git a/Minecraft.Client/Textures/Packs/TexturePack.h b/Minecraft.Client/net/minecraft/client/skins/TexturePack.h similarity index 98% rename from Minecraft.Client/Textures/Packs/TexturePack.h rename to Minecraft.Client/net/minecraft/client/skins/TexturePack.h index 4c2de6925..052b7edff 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.h +++ b/Minecraft.Client/net/minecraft/client/skins/TexturePack.h @@ -2,7 +2,7 @@ #include -#include "../../Platform/Common/App_enums.h" +#include "../../../../Common/App_enums.h" class InputStream; class Minecraft; diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp b/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp similarity index 97% rename from Minecraft.Client/Textures/Packs/TexturePackRepository.cpp rename to Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp index 697eb5356..130d4402c 100644 --- a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp +++ b/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TexturePackRepository.h" #include "DefaultTexturePack.h" #include "FileTexturePack.h" #include "FolderTexturePack.h" #include "DLCTexturePack.h" -#include "../../GameState/Options.h" -#include "../../../Minecraft.World/IO/Files/File.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../Rendering/Minimap.h" +#include "../Options.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../gui/Minimap.h" TexturePack* TexturePackRepository::DEFAULT_TEXTURE_PACK = nullptr; diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.h b/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.h similarity index 100% rename from Minecraft.Client/Textures/Packs/TexturePackRepository.h rename to Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.h diff --git a/Minecraft.Client/UI/Screens/TitleScreen.cpp b/Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp similarity index 95% rename from Minecraft.Client/UI/Screens/TitleScreen.cpp rename to Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp index 5df54e275..29e8855a0 100644 --- a/Minecraft.Client/UI/Screens/TitleScreen.cpp +++ b/Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" -#include "../Button.h" -#include "OptionsScreen.h" -#include "SelectWorldScreen.h" -#include "JoinMultiplayerScreen.h" -#include "../../Rendering/Tesselator.h" -#include "../../Textures/Textures.h" -#include "../../GameState/Options.h" -#include "../../../Minecraft.World/Util/StringHelpers.h" -#include "../../../Minecraft.World/IO/Streams/InputOutputStream.h" -#include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -#include "../../../Minecraft.World/Platform/System.h" -#include "../../../Minecraft.World/Util/Random.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../gui/Button.h" +#include "../gui/OptionsScreen.h" +#include "../gui/SelectWorldScreen.h" +#include "../gui/JoinMultiplayerScreen.h" +#include "../renderer/Tesselator.h" +#include "../renderer/Textures.h" +#include "../Options.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" #include #include "TitleScreen.h" diff --git a/Minecraft.Client/UI/Screens/TitleScreen.h b/Minecraft.Client/net/minecraft/client/title/TitleScreen.h similarity index 97% rename from Minecraft.Client/UI/Screens/TitleScreen.h rename to Minecraft.Client/net/minecraft/client/title/TitleScreen.h index 5df5d4984..14b643c3f 100644 --- a/Minecraft.Client/UI/Screens/TitleScreen.h +++ b/Minecraft.Client/net/minecraft/client/title/TitleScreen.h @@ -1,5 +1,5 @@ #pragma once -#include "../Screen.h" +#include "../gui/Screen.h" class Random; class Button; diff --git a/Minecraft.Client/Input/ConsoleInput.cpp b/Minecraft.Client/net/minecraft/server/ConsoleInput.cpp similarity index 75% rename from Minecraft.Client/Input/ConsoleInput.cpp rename to Minecraft.Client/net/minecraft/server/ConsoleInput.cpp index 66aebd432..78de39d6e 100644 --- a/Minecraft.Client/Input/ConsoleInput.cpp +++ b/Minecraft.Client/net/minecraft/server/ConsoleInput.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "ConsoleInput.h" ConsoleInput::ConsoleInput(const std::wstring& msg, diff --git a/Minecraft.Client/Input/ConsoleInput.h b/Minecraft.Client/net/minecraft/server/ConsoleInput.h similarity index 100% rename from Minecraft.Client/Input/ConsoleInput.h rename to Minecraft.Client/net/minecraft/server/ConsoleInput.h diff --git a/Minecraft.Client/Input/ConsoleInputSource.h b/Minecraft.Client/net/minecraft/server/ConsoleInputSource.h similarity index 100% rename from Minecraft.Client/Input/ConsoleInputSource.h rename to Minecraft.Client/net/minecraft/server/ConsoleInputSource.h diff --git a/Minecraft.Client/net/minecraft/server/DispenserBootstrap.cpp b/Minecraft.Client/net/minecraft/server/DispenserBootstrap.cpp new file mode 100644 index 000000000..c933f4cb5 --- /dev/null +++ b/Minecraft.Client/net/minecraft/server/DispenserBootstrap.cpp @@ -0,0 +1 @@ +#include "../../../../Minecraft.World/Header Files/stdafx.h" \ No newline at end of file diff --git a/Minecraft.Client/GameState/DispenserBootstrap.h b/Minecraft.Client/net/minecraft/server/DispenserBootstrap.h similarity index 83% rename from Minecraft.Client/GameState/DispenserBootstrap.h rename to Minecraft.Client/net/minecraft/server/DispenserBootstrap.h index da22d8244..212d95ab7 100644 --- a/Minecraft.Client/GameState/DispenserBootstrap.h +++ b/Minecraft.Client/net/minecraft/server/DispenserBootstrap.h @@ -1,8 +1,8 @@ #pragma once -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Blocks/DispenserTile.h" -#include "../../Minecraft.World/Headers/net.minecraft.core.h" -#include "../../Minecraft.World/Level/Events/LevelEvent.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/DispenserTile.h" +#include "../../../../Minecraft.World/net/minecraft/core/net.minecraft.core.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/LevelEvent.h" class DispenserBootstrap { public: diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/net/minecraft/server/MinecraftServer.cpp similarity index 96% rename from Minecraft.Client/MinecraftServer.cpp rename to Minecraft.Client/net/minecraft/server/MinecraftServer.cpp index de1e9fda2..520455c59 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/net/minecraft/server/MinecraftServer.cpp @@ -1,54 +1,54 @@ -#include "Platform/stdafx.h" -// #include "Minecraft.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" +// #include "../client/Minecraft.h" #include #include #include -#include "Input/ConsoleInput.h" -#include "Level/DerivedServerLevel.h" -#include "GameState/DispenserBootstrap.h" -#include "Player/EntityTracker.h" +#include "ConsoleInput.h" +#include "level/DerivedServerLevel.h" +#include "DispenserBootstrap.h" +#include "level/EntityTracker.h" #include "MinecraftServer.h" -#include "GameState/Options.h" -#include "Network/PlayerList.h" -#include "Network/ServerChunkCache.h" -#include "Network/ServerConnection.h" -#include "Level/ServerLevel.h" -#include "Level/ServerLevelListener.h" -#include "GameState/Settings.h" -#include "../Minecraft.World/Commands/Command.h" -#include "../Minecraft.World/Util/AABB.h" -#include "../Minecraft.World/Util/Vec3.h" -#include "../Minecraft.World/Headers/net.minecraft.network.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../Minecraft.World/Headers/net.minecraft.world.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../Minecraft.World/Util/Pos.h" -#include "../Minecraft.World/Platform/System.h" -#include "../Minecraft.World/Util/StringHelpers.h" +#include "../client/Options.h" +#include "PlayerList.h" +#include "level/ServerChunkCache.h" +#include "network/ServerConnection.h" +#include "level/ServerLevel.h" +#include "level/ServerLevelListener.h" +#include "Settings.h" +#include "../../../../Minecraft.World/net/minecraft/commands/Command.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/Vec3.h" +#include "../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" #if defined(SPLIT_SAVES) -#include "../Minecraft.World/IO/Files/ConsoleSaveFileSplit.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.h" #endif -#include "../Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h" -#include "../Minecraft.World/Network/Socket.h" -#include "../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "Rendering/EntityRenderers/ProgressRenderer.h" -#include "Player/ServerPlayer.h" -#include "Rendering/GameRenderer.h" -#include "../Minecraft.World/Util/ThreadName.h" -#include "../Minecraft.World/Level/Storage/CompressedTileStorage.h" -#include "../Minecraft.World/Level/Storage/SparseLightStorage.h" -#include "../Minecraft.World/Level/Storage/SparseDataStorage.h" -#include "../Minecraft.World/IO/Streams/Compression.h" -#include "Platform/Common/ShutdownManager.h" -#include "Platform/Common/UI/UIStructs.h" -#include "Network/ServerCommandDispatcher.h" -#include "../Minecraft.World/WorldGen/Biomes/BiomeSource.h" -#include "Network/PlayerChunkMap.h" -#include "Platform/Common/Telemetry/TelemetryManager.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../client/ProgressRenderer.h" +#include "level/ServerPlayer.h" +#include "../client/renderer/GameRenderer.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ThreadName.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h" +#include "../../../../Minecraft.World/Header Files/compression.h" +#include "../../../Common/ShutdownManager.h" +#include "../../../Common/Source Files/UI/All Platforms/UIStructs.h" +#include "commands/ServerCommandDispatcher.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h" +#include "level/PlayerChunkMap.h" +#include "../../../Common/Source Files/Telemetry/TelemetryManager.h" #define DEBUG_SERVER_DONT_SPAWN_MOBS 0 diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/net/minecraft/server/MinecraftServer.h similarity index 97% rename from Minecraft.Client/MinecraftServer.h rename to Minecraft.Client/net/minecraft/server/MinecraftServer.h index 606efd0c3..64ba8d978 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/net/minecraft/server/MinecraftServer.h @@ -2,10 +2,10 @@ #include #include -#include "Input/ConsoleInputSource.h" -#include "../Minecraft.World/Util/ArrayWithLength.h" -#include "../Minecraft.World/Util/SharedConstants.h" -#include "../Minecraft.World/Util/C4JThread.h" +#include "ConsoleInputSource.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +#include "../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" class ServerConnection; class Settings; diff --git a/Minecraft.Client/Network/PlayerList.cpp b/Minecraft.Client/net/minecraft/server/PlayerList.cpp similarity index 97% rename from Minecraft.Client/Network/PlayerList.cpp rename to Minecraft.Client/net/minecraft/server/PlayerList.cpp index 6ad051886..84600cc25 100644 --- a/Minecraft.Client/Network/PlayerList.cpp +++ b/Minecraft.Client/net/minecraft/server/PlayerList.cpp @@ -1,31 +1,31 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include #include "PlayerList.h" -#include "PlayerChunkMap.h" -#include "../MinecraftServer.h" -#include "../GameState/Settings.h" -#include "../Level/ServerLevel.h" -#include "ServerChunkCache.h" -#include "../Player/ServerPlayer.h" -#include "../Player/ServerPlayerGameMode.h" -#include "ServerConnection.h" -#include "PendingConnection.h" -#include "PlayerConnection.h" -#include "../Player/EntityTracker.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Util/ProgressListener.h" -#include "../../Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.phys.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.saveddata.h" -#include "../../Minecraft.World/Util/JavaMath.h" -#include "../../Minecraft.World/Level/Storage/EntityIO.h" +#include "level/PlayerChunkMap.h" +#include "MinecraftServer.h" +#include "Settings.h" +#include "level/ServerLevel.h" +#include "level/ServerChunkCache.h" +#include "level/ServerPlayer.h" +#include "level/ServerPlayerGameMode.h" +#include "network/ServerConnection.h" +#include "network/PendingConnection.h" +#include "network/PlayerConnection.h" +#include "level/EntityTracker.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +#include "../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../Minecraft.World/net/minecraft/util/ProgressListener.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h" +#include "../../../../Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "../../../../Minecraft.World/net/minecraft/world/entity/EntityIO.h" // 4J - this class is fairly substantially altered as there didn't seem any // point in porting code for banning, whitelisting, ops etc. diff --git a/Minecraft.Client/Network/PlayerList.h b/Minecraft.Client/net/minecraft/server/PlayerList.h similarity index 98% rename from Minecraft.Client/Network/PlayerList.h rename to Minecraft.Client/net/minecraft/server/PlayerList.h index 77371f3cb..12bdfaf93 100644 --- a/Minecraft.Client/Network/PlayerList.h +++ b/Minecraft.Client/net/minecraft/server/PlayerList.h @@ -2,7 +2,7 @@ #include #include #include -#include "../../Minecraft.World/Util/ArrayWithLength.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" class ServerPlayer; class PlayerChunkMap; diff --git a/Minecraft.Client/Network/ServerInterface.h b/Minecraft.Client/net/minecraft/server/ServerInterface.h similarity index 100% rename from Minecraft.Client/Network/ServerInterface.h rename to Minecraft.Client/net/minecraft/server/ServerInterface.h diff --git a/Minecraft.Client/Network/ServerScoreboard.cpp b/Minecraft.Client/net/minecraft/server/ServerScoreboard.cpp similarity index 99% rename from Minecraft.Client/Network/ServerScoreboard.cpp rename to Minecraft.Client/net/minecraft/server/ServerScoreboard.cpp index 5f93e8ae7..4ef07076c 100644 --- a/Minecraft.Client/Network/ServerScoreboard.cpp +++ b/Minecraft.Client/net/minecraft/server/ServerScoreboard.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "ServerScoreboard.h" diff --git a/Minecraft.Client/Network/ServerScoreboard.h b/Minecraft.Client/net/minecraft/server/ServerScoreboard.h similarity index 94% rename from Minecraft.Client/Network/ServerScoreboard.h rename to Minecraft.Client/net/minecraft/server/ServerScoreboard.h index e06bd569b..36f4f34f3 100644 --- a/Minecraft.Client/Network/ServerScoreboard.h +++ b/Minecraft.Client/net/minecraft/server/ServerScoreboard.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/Scores/Scoreboard.h" +#include "../../../../Minecraft.World/net/minecraft/world/scores/Scoreboard.h" class MinecraftServer; class ScoreboardSaveData; diff --git a/Minecraft.Client/GameState/Settings.cpp b/Minecraft.Client/net/minecraft/server/Settings.cpp similarity index 90% rename from Minecraft.Client/GameState/Settings.cpp rename to Minecraft.Client/net/minecraft/server/Settings.cpp index 658cebd32..ea138826f 100644 --- a/Minecraft.Client/GameState/Settings.cpp +++ b/Minecraft.Client/net/minecraft/server/Settings.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "Settings.h" -#include "../../Minecraft.World/Util/StringHelpers.h" +#include "../../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" // 4J - TODO - serialise/deserialise from file Settings::Settings(File* file) {} diff --git a/Minecraft.Client/GameState/Settings.h b/Minecraft.Client/net/minecraft/server/Settings.h similarity index 100% rename from Minecraft.Client/GameState/Settings.h rename to Minecraft.Client/net/minecraft/server/Settings.h diff --git a/Minecraft.Client/Network/ServerCommandDispatcher.cpp b/Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.cpp similarity index 89% rename from Minecraft.Client/Network/ServerCommandDispatcher.cpp rename to Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.cpp index e427d3222..3cd16f582 100644 --- a/Minecraft.Client/Network/ServerCommandDispatcher.cpp +++ b/Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "../MinecraftServer.h" -#include "PlayerList.h" -#include "../Player/ServerPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.commands.h" -#include "../../Minecraft.World/Headers/net.minecraft.commands.common.h" -#include "../Commands/TeleportCommand.h" +#include "../PlayerList.h" +#include "../level/ServerPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/net.minecraft.commands.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/common/net.minecraft.commands.common.h" +#include "TeleportCommand.h" #include "ServerCommandDispatcher.h" ServerCommandDispatcher::ServerCommandDispatcher() { diff --git a/Minecraft.Client/Network/ServerCommandDispatcher.h b/Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.h similarity index 73% rename from Minecraft.Client/Network/ServerCommandDispatcher.h rename to Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.h index bd3906018..1a137593a 100644 --- a/Minecraft.Client/Network/ServerCommandDispatcher.h +++ b/Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Minecraft.World/Commands/CommandDispatcher.h" -#include "../../Minecraft.World/Commands/AdminLogCommand.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/CommandDispatcher.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/AdminLogCommand.h" class ServerCommandDispatcher : public CommandDispatcher, public AdminLogCommand { diff --git a/Minecraft.Client/Commands/TeleportCommand.cpp b/Minecraft.Client/net/minecraft/server/commands/TeleportCommand.cpp similarity index 86% rename from Minecraft.Client/Commands/TeleportCommand.cpp rename to Minecraft.Client/net/minecraft/server/commands/TeleportCommand.cpp index 4c6a39236..7493d2098 100644 --- a/Minecraft.Client/Commands/TeleportCommand.cpp +++ b/Minecraft.Client/net/minecraft/server/commands/TeleportCommand.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "../MinecraftServer.h" -#include "../Network/PlayerList.h" -#include "../Player/ServerPlayer.h" -#include "../Network/PlayerConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.commands.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" +#include "../PlayerList.h" +#include "../level/ServerPlayer.h" +#include "../network/PlayerConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/net.minecraft.commands.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" #include "TeleportCommand.h" EGameCommand TeleportCommand::getId() { return eGameCommand_Teleport; } diff --git a/Minecraft.Client/Commands/TeleportCommand.h b/Minecraft.Client/net/minecraft/server/commands/TeleportCommand.h similarity index 81% rename from Minecraft.Client/Commands/TeleportCommand.h rename to Minecraft.Client/net/minecraft/server/commands/TeleportCommand.h index f42016ab1..3c7cf1ad4 100644 --- a/Minecraft.Client/Commands/TeleportCommand.h +++ b/Minecraft.Client/net/minecraft/server/commands/TeleportCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/Commands/Command.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/Command.h" class TeleportCommand : public Command { public: diff --git a/Minecraft.Client/GameState/CreativeMode.cpp b/Minecraft.Client/net/minecraft/server/level/CreativeMode.cpp similarity index 81% rename from Minecraft.Client/GameState/CreativeMode.cpp rename to Minecraft.Client/net/minecraft/server/level/CreativeMode.cpp index d36b340f9..7576eaab6 100644 --- a/Minecraft.Client/GameState/CreativeMode.cpp +++ b/Minecraft.Client/net/minecraft/server/level/CreativeMode.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "CreativeMode.h" -#include "../Player/User.h" -#include "../Player/LocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" +#include "../../client/User.h" +#include "../../client/player/LocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" CreativeMode::CreativeMode(Minecraft* minecraft) : GameMode(minecraft) { destroyDelay = 0; diff --git a/Minecraft.Client/GameState/CreativeMode.h b/Minecraft.Client/net/minecraft/server/level/CreativeMode.h similarity index 100% rename from Minecraft.Client/GameState/CreativeMode.h rename to Minecraft.Client/net/minecraft/server/level/CreativeMode.h diff --git a/Minecraft.Client/GameState/DemoMode.cpp b/Minecraft.Client/net/minecraft/server/level/DemoMode.cpp similarity index 95% rename from Minecraft.Client/GameState/DemoMode.cpp rename to Minecraft.Client/net/minecraft/server/level/DemoMode.cpp index 8794ea9fc..144c5268b 100644 --- a/Minecraft.Client/GameState/DemoMode.cpp +++ b/Minecraft.Client/net/minecraft/server/level/DemoMode.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DemoMode.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" DemoMode::DemoMode(Minecraft* minecraft) : SurvivalMode(minecraft) { demoHasEnded = false; diff --git a/Minecraft.Client/GameState/DemoMode.h b/Minecraft.Client/net/minecraft/server/level/DemoMode.h similarity index 100% rename from Minecraft.Client/GameState/DemoMode.h rename to Minecraft.Client/net/minecraft/server/level/DemoMode.h diff --git a/Minecraft.Client/Level/DerivedServerLevel.cpp b/Minecraft.Client/net/minecraft/server/level/DerivedServerLevel.cpp similarity index 78% rename from Minecraft.Client/Level/DerivedServerLevel.cpp rename to Minecraft.Client/net/minecraft/server/level/DerivedServerLevel.cpp index 7aa81864f..7d6a0c10f 100644 --- a/Minecraft.Client/Level/DerivedServerLevel.cpp +++ b/Minecraft.Client/net/minecraft/server/level/DerivedServerLevel.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "DerivedServerLevel.h" -#include "../../Minecraft.World/Level/Storage/SavedDataStorage.h" -#include "../../Minecraft.World/Level/DerivedLevelData.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/DerivedLevelData.h" DerivedServerLevel::DerivedServerLevel( MinecraftServer* server, std::shared_ptr levelStorage, diff --git a/Minecraft.Client/Level/DerivedServerLevel.h b/Minecraft.Client/net/minecraft/server/level/DerivedServerLevel.h similarity index 100% rename from Minecraft.Client/Level/DerivedServerLevel.h rename to Minecraft.Client/net/minecraft/server/level/DerivedServerLevel.h diff --git a/Minecraft.Client/Player/EntityTracker.cpp b/Minecraft.Client/net/minecraft/server/level/EntityTracker.cpp similarity index 85% rename from Minecraft.Client/Player/EntityTracker.cpp rename to Minecraft.Client/net/minecraft/server/level/EntityTracker.cpp index c64cb685a..a4d5630da 100644 --- a/Minecraft.Client/Player/EntityTracker.cpp +++ b/Minecraft.Client/net/minecraft/server/level/EntityTracker.cpp @@ -1,24 +1,24 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "EntityTracker.h" #include "../MinecraftServer.h" -#include "../Network/PlayerList.h" +#include "../PlayerList.h" #include "TrackedEntity.h" #include "ServerPlayer.h" -#include "../Level/ServerLevel.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.global.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../Network/PlayerConnection.h" +#include "ServerLevel.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../network/PlayerConnection.h" EntityTracker::EntityTracker(ServerLevel* level) { this->level = level; diff --git a/Minecraft.Client/Player/EntityTracker.h b/Minecraft.Client/net/minecraft/server/level/EntityTracker.h similarity index 90% rename from Minecraft.Client/Player/EntityTracker.h rename to Minecraft.Client/net/minecraft/server/level/EntityTracker.h index 55c657f12..3f2b96388 100644 --- a/Minecraft.Client/Player/EntityTracker.h +++ b/Minecraft.Client/net/minecraft/server/level/EntityTracker.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/Util/HashExtension.h" -#include "../../Minecraft.World/Util/JavaIntHash.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/HashExtension.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" class Entity; class ServerPlayer; class TrackedEntity; diff --git a/Minecraft.Client/GameState/GameMode.cpp b/Minecraft.Client/net/minecraft/server/level/GameMode.cpp similarity index 83% rename from Minecraft.Client/GameState/GameMode.cpp rename to Minecraft.Client/net/minecraft/server/level/GameMode.cpp index 432687223..4f519ed8d 100644 --- a/Minecraft.Client/GameState/GameMode.cpp +++ b/Minecraft.Client/net/minecraft/server/level/GameMode.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "GameMode.h" -#include "../Player/LocalPlayer.h" -#include "../Rendering/LevelRenderer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" +#include "../../client/player/LocalPlayer.h" +#include "../../client/renderer/LevelRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" GameMode::GameMode(Minecraft* minecraft) { instaBuild = false; // 4J - added diff --git a/Minecraft.Client/GameState/GameMode.h b/Minecraft.Client/net/minecraft/server/level/GameMode.h similarity index 100% rename from Minecraft.Client/GameState/GameMode.h rename to Minecraft.Client/net/minecraft/server/level/GameMode.h diff --git a/Minecraft.Client/Network/PlayerChunkMap.cpp b/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp similarity index 97% rename from Minecraft.Client/Network/PlayerChunkMap.cpp rename to Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp index ddcbdd577..b6d485131 100644 --- a/Minecraft.Client/Network/PlayerChunkMap.cpp +++ b/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "PlayerChunkMap.h" -#include "PlayerConnection.h" -#include "../Level/ServerLevel.h" +#include "../network/PlayerConnection.h" +#include "ServerLevel.h" #include "ServerChunkCache.h" -#include "../Player/ServerPlayer.h" +#include "ServerPlayer.h" #include "../MinecraftServer.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Util/ArrayWithLength.h" -#include "../../Minecraft.World/Platform/System.h" -#include "PlayerList.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/System.h" +#include "../PlayerList.h" PlayerChunkMap::PlayerChunk::PlayerChunk(int x, int z, PlayerChunkMap* pcm) : pos(x, z) { diff --git a/Minecraft.Client/Network/PlayerChunkMap.h b/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h similarity index 96% rename from Minecraft.Client/Network/PlayerChunkMap.h rename to Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h index a0315897a..b75dd4c1e 100644 --- a/Minecraft.Client/Network/PlayerChunkMap.h +++ b/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Minecraft.World/Util/JavaIntHash.h" -#include "../../Minecraft.World/Level/ChunkPos.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/ChunkPos.h" class ServerPlayer; class ServerLevel; class MinecraftServer; diff --git a/Minecraft.Client/Network/ServerChunkCache.cpp b/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.cpp similarity index 97% rename from Minecraft.Client/Network/ServerChunkCache.cpp rename to Minecraft.Client/net/minecraft/server/level/ServerChunkCache.cpp index 79e5775af..cc37424eb 100644 --- a/Minecraft.Client/Network/ServerChunkCache.cpp +++ b/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.cpp @@ -1,20 +1,20 @@ #include #include -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ServerChunkCache.h" -#include "../Level/ServerLevel.h" +#include "ServerLevel.h" #include "../MinecraftServer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Util/ProgressListener.h" -#include "../../Minecraft.World/Util/ThreadName.h" -#include "../../Minecraft.World/IO/Streams/Compression.h" -#include "../../Minecraft.World/Level/Storage/OldChunkStorage.h" -#include "../../Minecraft.World/Blocks/Tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../Minecraft.World/net/minecraft/util/ProgressListener.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/ThreadName.h" +#include "../../../../../Minecraft.World/Header Files/compression.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/Tile.h" ServerChunkCache::ServerChunkCache(ServerLevel* level, ChunkStorage* storage, ChunkSource* source) { diff --git a/Minecraft.Client/Network/ServerChunkCache.h b/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h similarity index 87% rename from Minecraft.Client/Network/ServerChunkCache.h rename to Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h index ee9d30caa..b6650bc4d 100644 --- a/Minecraft.Client/Network/ServerChunkCache.h +++ b/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h @@ -1,11 +1,11 @@ #pragma once #include -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/IO/Files/File.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Util/JavaIntHash.h" -#include "../../Minecraft.World/Level/RandomLevelSource.h" -#include "../../Minecraft.World/Util/C4JThread.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/File.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.h" +#include "../../../../../Minecraft.World/ConsoleHelpers/C4JThread.h" class ServerLevel; diff --git a/Minecraft.Client/Level/ServerLevel.cpp b/Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp similarity index 95% rename from Minecraft.Client/Level/ServerLevel.cpp rename to Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp index 2822c8350..62c1c7307 100644 --- a/Minecraft.Client/Level/ServerLevel.cpp +++ b/Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp @@ -2,45 +2,45 @@ #include #include -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ServerLevel.h" #include "../MinecraftServer.h" -#include "../Network/ServerChunkCache.h" -#include "../Network/PlayerList.h" -#include "../Player/ServerPlayer.h" -#include "../Network/PlayerConnection.h" -#include "../Player/EntityTracker.h" -#include "../Network/ServerScoreboard.h" -#include "../../Minecraft.World/Scores/ScoreboardSaveData.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.global.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.npc.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.biome.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.scores.h" -#include "../../Minecraft.World/Entities/ItemEntity.h" -#include "../../Minecraft.World/Entities/Mobs/Arrow.h" -#include "../../Minecraft.World/Entities/Mobs/PrimedTnt.h" -#include "../../Minecraft.World/Blocks/FallingTile.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../../Minecraft.World/WorldGen/Structures/StructurePiece.h" -#include "./ServerLevelListener.h" -#include "../../Minecraft.World/Util/WeighedTreasure.h" -#include "../Textures/Packs/TexturePackRepository.h" -#include "../Textures/Packs/DLCTexturePack.h" -#include "../../Minecraft.World/Util/ProgressListener.h" -#include "../Platform/Common/ShutdownManager.h" -#include "../Network/PlayerChunkMap.h" +#include "ServerChunkCache.h" +#include "../PlayerList.h" +#include "ServerPlayer.h" +#include "../network/PlayerConnection.h" +#include "EntityTracker.h" +#include "../ServerScoreboard.h" +#include "../../../../../Minecraft.World/net/minecraft/world/scores/ScoreboardSaveData.h" +#include "../../../../../Minecraft.World/net/minecraft/world/net.minecraft.world.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ai/village/net.minecraft.world.entity.ai.village.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/biome/net.minecraft.world.level.biome.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/scores/net.minecraft.world.scores.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/ItemEntity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/projectile/Arrow.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/FallingTile.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h" +#include "ServerLevelListener.h" +#include "../../../../../Minecraft.World/net/minecraft/util/WeighedTreasure.h" +#include "../../client/skins/TexturePackRepository.h" +#include "../../client/skins/DLCTexturePack.h" +#include "../../../../../Minecraft.World/net/minecraft/util/ProgressListener.h" +#include "../../../../Common/ShutdownManager.h" +#include "PlayerChunkMap.h" WeighedTreasureArray ServerLevel::RANDOM_BONUS_ITEMS; diff --git a/Minecraft.Client/Level/ServerLevel.h b/Minecraft.Client/net/minecraft/server/level/ServerLevel.h similarity index 97% rename from Minecraft.Client/Level/ServerLevel.h rename to Minecraft.Client/net/minecraft/server/level/ServerLevel.h index 852b391a3..1e01023c0 100644 --- a/Minecraft.Client/Level/ServerLevel.h +++ b/Minecraft.Client/net/minecraft/server/level/ServerLevel.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Util/JavaIntHash.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" class ServerChunkCache; class MinecraftServer; class Node; diff --git a/Minecraft.Client/Level/ServerLevelListener.cpp b/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp similarity index 90% rename from Minecraft.Client/Level/ServerLevelListener.cpp rename to Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp index 1f19a12ae..e9d7b2233 100644 --- a/Minecraft.Client/Level/ServerLevelListener.cpp +++ b/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ServerLevelListener.h" -#include "../Player/EntityTracker.h" +#include "EntityTracker.h" #include "../MinecraftServer.h" #include "ServerLevel.h" -#include "../Player/ServerPlayer.h" -#include "../Network/PlayerList.h" -#include "../Network/PlayerChunkMap.h" -#include "../Network/PlayerConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Level/LevelData.h" +#include "ServerPlayer.h" +#include "../PlayerList.h" +#include "PlayerChunkMap.h" +#include "../network/PlayerConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/LevelData.h" ServerLevelListener::ServerLevelListener(MinecraftServer* server, ServerLevel* level) { diff --git a/Minecraft.Client/Level/ServerLevelListener.h b/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.h similarity index 96% rename from Minecraft.Client/Level/ServerLevelListener.h rename to Minecraft.Client/net/minecraft/server/level/ServerLevelListener.h index dc313d558..26c31658d 100644 --- a/Minecraft.Client/Level/ServerLevelListener.h +++ b/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Level/Events/LevelListener.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/LevelListener.h" class Player; class TileEntity; class Entity; diff --git a/Minecraft.Client/Player/ServerPlayer.cpp b/Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp similarity index 96% rename from Minecraft.Client/Player/ServerPlayer.cpp rename to Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp index 419dd4384..15df8779d 100644 --- a/Minecraft.Client/Player/ServerPlayer.cpp +++ b/Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp @@ -1,37 +1,37 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ServerPlayer.h" #include "ServerPlayerGameMode.h" -#include "../Level/ServerLevel.h" +#include "ServerLevel.h" #include "../MinecraftServer.h" #include "EntityTracker.h" -#include "../Network/PlayerConnection.h" -#include "../GameState/Settings.h" -#include "../Network/PlayerList.h" -#include "../Level/MultiPlayerLevel.h" +#include "../network/PlayerConnection.h" +#include "../Settings.h" +#include "../PlayerList.h" +#include "../../client/multiplayer/MultiPlayerLevel.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.damagesource.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.scores.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.scores.criteria.h" -#include "../../Minecraft.World/Headers/net.minecraft.stats.h" -#include "../../Minecraft.World/Headers/net.minecraft.locale.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/scores/net.minecraft.world.scores.h" +#include "../../../../../Minecraft.World/net/minecraft/world/scores/criteria/net.minecraft.world.scores.criteria.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" +#include "../../../../../Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Util/Random.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Random.h" -#include "../../Minecraft.World/Level/LevelChunk.h" -#include "../Rendering/LevelRenderer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h" +#include "../../client/renderer/LevelRenderer.h" ServerPlayer::ServerPlayer(MinecraftServer* server, Level* level, const std::wstring& name, diff --git a/Minecraft.Client/Player/ServerPlayer.h b/Minecraft.Client/net/minecraft/server/level/ServerPlayer.h similarity index 95% rename from Minecraft.Client/Player/ServerPlayer.h rename to Minecraft.Client/net/minecraft/server/level/ServerPlayer.h index 30160d730..266a16f0f 100644 --- a/Minecraft.Client/Player/ServerPlayer.h +++ b/Minecraft.Client/net/minecraft/server/level/ServerPlayer.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.ContainerListener.h" -#include "../../Minecraft.World/Level/ChunkPos.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.ContainerListener.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/ChunkPos.h" class PlayerConnection; class MinecraftServer; class ServerPlayerGameMode; diff --git a/Minecraft.Client/Player/ServerPlayerGameMode.cpp b/Minecraft.Client/net/minecraft/server/level/ServerPlayerGameMode.cpp similarity index 93% rename from Minecraft.Client/Player/ServerPlayerGameMode.cpp rename to Minecraft.Client/net/minecraft/server/level/ServerPlayerGameMode.cpp index fce273b72..22532f0db 100644 --- a/Minecraft.Client/Player/ServerPlayerGameMode.cpp +++ b/Minecraft.Client/net/minecraft/server/level/ServerPlayerGameMode.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "ServerPlayerGameMode.h" -#include "../Level/ServerLevel.h" +#include "ServerLevel.h" #include "ServerPlayer.h" -#include "../Network/PlayerConnection.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.chunk.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../Level/MultiPlayerLevel.h" -#include "../Rendering/LevelRenderer.h" +#include "../network/PlayerConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../client/multiplayer/MultiPlayerLevel.h" +#include "../../client/renderer/LevelRenderer.h" ServerPlayerGameMode::ServerPlayerGameMode(Level* level) { // 4J - added initialisers diff --git a/Minecraft.Client/Player/ServerPlayerGameMode.h b/Minecraft.Client/net/minecraft/server/level/ServerPlayerGameMode.h similarity index 100% rename from Minecraft.Client/Player/ServerPlayerGameMode.h rename to Minecraft.Client/net/minecraft/server/level/ServerPlayerGameMode.h diff --git a/Minecraft.Client/GameState/SurvivalMode.cpp b/Minecraft.Client/net/minecraft/server/level/SurvivalMode.cpp similarity index 90% rename from Minecraft.Client/GameState/SurvivalMode.cpp rename to Minecraft.Client/net/minecraft/server/level/SurvivalMode.cpp index 69aa0b251..9018d6d4a 100644 --- a/Minecraft.Client/GameState/SurvivalMode.cpp +++ b/Minecraft.Client/net/minecraft/server/level/SurvivalMode.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "SurvivalMode.h" #include "DemoMode.h" -#include "../Rendering/LevelRenderer.h" -#include "../Player/LocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../ClientConstants.h" +#include "../../client/renderer/LevelRenderer.h" +#include "../../client/player/LocalPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../client/ClientConstants.h" SurvivalMode::SurvivalMode(Minecraft* minecraft) : GameMode(minecraft) { // 4J - added initialisers diff --git a/Minecraft.Client/GameState/SurvivalMode.h b/Minecraft.Client/net/minecraft/server/level/SurvivalMode.h similarity index 100% rename from Minecraft.Client/GameState/SurvivalMode.h rename to Minecraft.Client/net/minecraft/server/level/SurvivalMode.h diff --git a/Minecraft.Client/Player/TrackedEntity.cpp b/Minecraft.Client/net/minecraft/server/level/TrackedEntity.cpp similarity index 96% rename from Minecraft.Client/Player/TrackedEntity.cpp rename to Minecraft.Client/net/minecraft/server/level/TrackedEntity.cpp index 8e60db877..6dbcc2512 100644 --- a/Minecraft.Client/Player/TrackedEntity.cpp +++ b/Minecraft.Client/net/minecraft/server/level/TrackedEntity.cpp @@ -1,24 +1,24 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "TrackedEntity.h" #include "ServerPlayer.h" -#include "../Network/PlayerConnection.h" -#include "../../Minecraft.World/Util/Mth.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.monster.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.player.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.global.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.projectile.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.saveddata.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.ai.attributes.h" +#include "../network/PlayerConnection.h" +#include "../../../../../Minecraft.World/net/minecraft/util/Mth.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" #include "../MinecraftServer.h" -#include "../Level/ServerLevel.h" -#include "../Network/PlayerList.h" +#include "ServerLevel.h" +#include "../PlayerList.h" #include "EntityTracker.h" -#include "../Network/PlayerChunkMap.h" +#include "PlayerChunkMap.h" #ifndef __linux__ #include #endif // __linux__ diff --git a/Minecraft.Client/Player/TrackedEntity.h b/Minecraft.Client/net/minecraft/server/level/TrackedEntity.h similarity index 100% rename from Minecraft.Client/Player/TrackedEntity.h rename to Minecraft.Client/net/minecraft/server/level/TrackedEntity.h diff --git a/Minecraft.Client/Network/PendingConnection.cpp b/Minecraft.Client/net/minecraft/server/network/PendingConnection.cpp similarity index 91% rename from Minecraft.Client/Network/PendingConnection.cpp rename to Minecraft.Client/net/minecraft/server/network/PendingConnection.cpp index c58099822..7d5aae5e4 100644 --- a/Minecraft.Client/Network/PendingConnection.cpp +++ b/Minecraft.Client/net/minecraft/server/network/PendingConnection.cpp @@ -1,20 +1,20 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include #include "PendingConnection.h" #include "PlayerConnection.h" #include "ServerConnection.h" -#include "../Player/ServerPlayer.h" -#include "../Player/ServerPlayerGameMode.h" -#include "../Level/ServerLevel.h" -#include "PlayerList.h" +#include "../level/ServerPlayer.h" +#include "../level/ServerPlayerGameMode.h" +#include "../level/ServerLevel.h" +#include "../PlayerList.h" #include "../MinecraftServer.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Util/SharedConstants.h" -#include "../GameState/Settings.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../Settings.h" // #if 0 // #include "PS3/Network/NetworkPlayerSony.h" // #endif diff --git a/Minecraft.Client/Network/PendingConnection.h b/Minecraft.Client/net/minecraft/server/network/PendingConnection.h similarity index 94% rename from Minecraft.Client/Network/PendingConnection.h rename to Minecraft.Client/net/minecraft/server/network/PendingConnection.h index aab9e0ed3..cb0bbfa0d 100644 --- a/Minecraft.Client/Network/PendingConnection.h +++ b/Minecraft.Client/net/minecraft/server/network/PendingConnection.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Minecraft.World/Network/Packets/PacketListener.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/PacketListener.h" class MinecraftServer; class Socket; class LoginPacket; diff --git a/Minecraft.Client/Network/PlayerConnection.cpp b/Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp similarity index 97% rename from Minecraft.Client/Network/PlayerConnection.cpp rename to Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp index eabe55c1f..80344c69b 100644 --- a/Minecraft.Client/Network/PlayerConnection.cpp +++ b/Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp @@ -1,37 +1,37 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" #include "PlayerConnection.h" -#include "../Player/ServerPlayer.h" -#include "../Level/ServerLevel.h" -#include "../Player/ServerPlayerGameMode.h" -#include "PlayerList.h" +#include "../level/ServerPlayer.h" +#include "../level/ServerLevel.h" +#include "../level/ServerPlayerGameMode.h" +#include "../PlayerList.h" #include "../MinecraftServer.h" -#include "../../Minecraft.World/Headers/net.minecraft.commands.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.dimension.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.trading.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.inventory.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.saveddata.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.entity.animal.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.food.h" -#include "../../Minecraft.World/Util/AABB.h" -#include "../../Minecraft.World/Util/Pos.h" -#include "../../Minecraft.World/Util/SharedConstants.h" -#include "../../Minecraft.World/Network/Socket.h" -#include "../../Minecraft.World/Stats/Achievements.h" -#include "../../Minecraft.World/Headers/net.minecraft.h" -#include "../Player/EntityTracker.h" +#include "../../../../../Minecraft.World/net/minecraft/commands/net.minecraft.commands.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" +#include "../../../../../Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../../../../../Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h" +#include "../../../../../Minecraft.World/net/minecraft/world/phys/AABB.h" +#include "../../../../../Minecraft.World/net/minecraft/Pos.h" +#include "../../../../../Minecraft.World/net/minecraft/SharedConstants.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/Achievements.h" +#include "../../../../../Minecraft.World/net/minecraft/net.minecraft.h" +#include "../level/EntityTracker.h" #include "ServerConnection.h" -#include "../../Minecraft.World/Stats/GenericStats.h" -#include "../../Minecraft.World/Util/JavaMath.h" +#include "../../../../../Minecraft.World/net/minecraft/stats/GenericStats.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaMath.h" // 4J Added -#include "../../Minecraft.World/Headers/net.minecraft.world.item.crafting.h" -#include "../GameState/Options.h" +#include "../../../../../Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h" +#include "../../client/Options.h" Random PlayerConnection::random; diff --git a/Minecraft.Client/Network/PlayerConnection.h b/Minecraft.Client/net/minecraft/server/network/PlayerConnection.h similarity index 96% rename from Minecraft.Client/Network/PlayerConnection.h rename to Minecraft.Client/net/minecraft/server/network/PlayerConnection.h index b3956acba..d1c40da42 100644 --- a/Minecraft.Client/Network/PlayerConnection.h +++ b/Minecraft.Client/net/minecraft/server/network/PlayerConnection.h @@ -1,8 +1,8 @@ #pragma once #include -#include "../Input/ConsoleInputSource.h" -#include "../../Minecraft.World/Network/Packets/PacketListener.h" -#include "../../Minecraft.World/Util/JavaIntHash.h" +#include "../ConsoleInputSource.h" +#include "../../../../../Minecraft.World/net/minecraft/network/packet/PacketListener.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" class MinecraftServer; class Connection; diff --git a/Minecraft.Client/Network/ServerConnection.cpp b/Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp similarity index 93% rename from Minecraft.Client/Network/ServerConnection.cpp rename to Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp index 13aab0dd6..455c014b8 100644 --- a/Minecraft.Client/Network/ServerConnection.cpp +++ b/Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../GameState/Options.h" +#include "../../../../../Minecraft.World/Header Files/stdafx.h" +#include "../../client/Options.h" #include "ServerConnection.h" #include "PendingConnection.h" #include "PlayerConnection.h" -#include "../Player/ServerPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.network.h" -#include "../../Minecraft.World/Network/Socket.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../Level/MultiPlayerLevel.h" +#include "../level/ServerPlayer.h" +#include "../../../../../Minecraft.World/net/minecraft/network/net.minecraft.network.h" +#include "../../../../../Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "../../../../../Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../client/multiplayer/MultiPlayerLevel.h" ServerConnection::ServerConnection(MinecraftServer* server) { // 4J - added initialiser diff --git a/Minecraft.Client/Network/ServerConnection.h b/Minecraft.Client/net/minecraft/server/network/ServerConnection.h similarity index 100% rename from Minecraft.Client/Network/ServerConnection.h rename to Minecraft.Client/net/minecraft/server/network/ServerConnection.h diff --git a/Minecraft.Client/GameState/StatsCounter.cpp b/Minecraft.Client/net/minecraft/stats/StatsCounter.cpp similarity index 95% rename from Minecraft.Client/GameState/StatsCounter.cpp rename to Minecraft.Client/net/minecraft/stats/StatsCounter.cpp index a64af092b..2cab4a5d8 100644 --- a/Minecraft.Client/GameState/StatsCounter.cpp +++ b/Minecraft.Client/net/minecraft/stats/StatsCounter.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" +#include "../../../../Minecraft.World/Header Files/stdafx.h" #include "StatsCounter.h" -#include "../../Minecraft.World/Stats/Stat.h" -#include "../../Minecraft.World/Stats/Stats.h" -#include "../../Minecraft.World/Stats/Achievement.h" -#include "../../Minecraft.World/Stats/Achievements.h" -#include "../Player/LocalPlayer.h" +#include "../../../../Minecraft.World/net/minecraft/stats/Stat.h" +#include "../../../../Minecraft.World/net/minecraft/stats/Stats.h" +#include "../../../../Minecraft.World/net/minecraft/stats/Achievement.h" +#include "../../../../Minecraft.World/net/minecraft/stats/Achievements.h" +#include "../client/player/LocalPlayer.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -#include "../../Minecraft.World/Headers/net.minecraft.world.item.h" +#include "../../../../Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../../../../Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" -#include "../Platform/Common/Leaderboards/LeaderboardManager.h" +#include "../../../Common/Source Files/Leaderboards/LeaderboardManager.h" #include Stat** StatsCounter::LARGE_STATS[] = {&Stats::walkOneM, &Stats::swimOneM, diff --git a/Minecraft.Client/GameState/StatsCounter.h b/Minecraft.Client/net/minecraft/stats/StatsCounter.h similarity index 100% rename from Minecraft.Client/GameState/StatsCounter.h rename to Minecraft.Client/net/minecraft/stats/StatsCounter.h diff --git a/Minecraft.Client/net/minecraft/stats/StatsSyncer.cpp b/Minecraft.Client/net/minecraft/stats/StatsSyncer.cpp new file mode 100644 index 000000000..dd7a6ada7 --- /dev/null +++ b/Minecraft.Client/net/minecraft/stats/StatsSyncer.cpp @@ -0,0 +1,4 @@ +#include "../../../../Minecraft.World/Header Files/stdafx.h" +#include "StatsSyncer.h" + +// 4J - TODO \ No newline at end of file diff --git a/Minecraft.Client/GameState/StatsSyncer.h b/Minecraft.Client/net/minecraft/stats/StatsSyncer.h similarity index 100% rename from Minecraft.Client/GameState/StatsSyncer.h rename to Minecraft.Client/net/minecraft/stats/StatsSyncer.h diff --git a/Minecraft.World/Util/ArrayWithLength.h b/Minecraft.World/ConsoleHelpers/ArrayWithLength.h similarity index 98% rename from Minecraft.World/Util/ArrayWithLength.h rename to Minecraft.World/ConsoleHelpers/ArrayWithLength.h index d46f390f6..50eccb4f2 100644 --- a/Minecraft.World/Util/ArrayWithLength.h +++ b/Minecraft.World/ConsoleHelpers/ArrayWithLength.h @@ -126,5 +126,5 @@ typedef arrayWithLength ModelPartArray; typedef arrayWithLength EnchantmentArray; typedef arrayWithLength ClipChunkArray; -#include "../Items/ItemInstance.h" +#include "../net/minecraft/world/item/ItemInstance.h" typedef arrayWithLength > ItemInstanceArray; diff --git a/Minecraft.World/Util/C4JThread.cpp b/Minecraft.World/ConsoleHelpers/C4JThread.cpp similarity index 99% rename from Minecraft.World/Util/C4JThread.cpp rename to Minecraft.World/ConsoleHelpers/C4JThread.cpp index 56b620e6d..12234be29 100644 --- a/Minecraft.World/Util/C4JThread.cpp +++ b/Minecraft.World/ConsoleHelpers/C4JThread.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "C4JThread.h" @@ -26,7 +26,7 @@ #include #endif -#include "../../Minecraft.Client/Platform/Common/ShutdownManager.h" +#include "../../Minecraft.Client/Common/ShutdownManager.h" thread_local C4JThread* C4JThread::ms_currentThread = nullptr; diff --git a/Minecraft.World/Util/C4JThread.h b/Minecraft.World/ConsoleHelpers/C4JThread.h similarity index 100% rename from Minecraft.World/Util/C4JThread.h rename to Minecraft.World/ConsoleHelpers/C4JThread.h diff --git a/Minecraft.World/IO/Files/ConsoleSaveFile.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h similarity index 100% rename from Minecraft.World/IO/Files/ConsoleSaveFile.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.cpp similarity index 97% rename from Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.cpp index 5df018def..9c277509b 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "../../Header Files/stdafx.h" +#include "../../net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../../net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" #include "ConsoleSaveFileIO.h" #include "ConsoleSaveFileConverter.h" -#include "../../Util/ProgressListener.h" +#include "../../net/minecraft/util/ProgressListener.h" void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile* sourceSave, FileEntry* sourceFileEntry, diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h similarity index 95% rename from Minecraft.World/IO/Files/ConsoleSaveFileConverter.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h index e6005dde5..5e8ea06d0 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.h +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h @@ -1,5 +1,5 @@ #pragma once -#include "File.h" +#include "../../ConsoleJavaLibs/File.h" class FileEntry; class ConsoleSaveFile; class ProgressRenderer; diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileIO.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h similarity index 100% rename from Minecraft.World/IO/Files/ConsoleSaveFileIO.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp similarity index 98% rename from Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp index 1a612dc05..1b7f0c1d5 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" -#include "File.h" +#include "../../ConsoleJavaLibs/File.h" #include "ConsoleSaveFile.h" #include "ConsoleSaveFileInputStream.h" diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h similarity index 91% rename from Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h index 3203644fd..ad6cf5d09 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.h +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h @@ -2,7 +2,7 @@ // 4J Stu - Implements the Java InputStream but rather than writing directly to // disc it writes through the save file -#include "../Streams/InputStream.h" +#include "../../ConsoleJavaLibs/InputOutputStream/InputStream.h" #include "ConsoleSavePath.h" diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp similarity index 97% rename from Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp index 38d550b8e..dd2685999 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp @@ -1,22 +1,22 @@ #include #include -#include "../../Platform/stdafx.h" -#include "../../Util/StringHelpers.h" -#include "../../Util/PortableFileIO.h" +#include "../../Header Files/stdafx.h" +#include "../StringHelpers.h" +#include "../../Header Files/PortableFileIO.h" #include "ConsoleSaveFileOriginal.h" -#include "File.h" +#include "../../ConsoleJavaLibs/File.h" #include #include #include -#include "../Streams/Compression.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/MinecraftServer.h" -#include "../../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Level/LevelData.h" -#include "../../../Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" +#include "../../Header Files/compression.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../net/minecraft/world/level/storage/LevelData.h" +#include "../../../Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.h" +#include "../../net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h" #define RESERVE_ALLOCATION MEM_RESERVE #define COMMIT_ALLOCATION MEM_COMMIT diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h similarity index 100% rename from Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp similarity index 98% rename from Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp index 951ecde10..5a3dd08a2 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "File.h" +#include "../../Header Files/stdafx.h" +#include "../../ConsoleJavaLibs/File.h" #include "ConsoleSaveFileOutputStream.h" #include "ConsoleSaveFile.h" diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h similarity index 91% rename from Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h index 4559cbd12..790a3f88d 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.h +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h @@ -2,7 +2,7 @@ // 4J Stu - Implements the Java InputStream but rather than writing directly to // disc it writes through the save file -#include "../Streams/OutputStream.h" +#include "../../ConsoleJavaLibs/InputOutputStream/OutputStream.h" #include "ConsoleSavePath.h" diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp similarity index 98% rename from Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp index 28c00eacd..de28bf1f7 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp @@ -1,21 +1,21 @@ #include #include -#include "../../Platform/stdafx.h" -#include "../../Util/StringHelpers.h" -#include "../../Util/PortableFileIO.h" +#include "../../Header Files/stdafx.h" +#include "../StringHelpers.h" +#include "../../Header Files/PortableFileIO.h" #include "ConsoleSaveFileSplit.h" #include "ConsoleSaveFileConverter.h" -#include "File.h" +#include "../../ConsoleJavaLibs/File.h" #include -#include "../Streams/Compression.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/MinecraftServer.h" -#include "../../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Level/LevelData.h" -#include "../../../Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" +#include "../../Header Files/compression.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../net/minecraft/world/level/net.minecraft.world.level.h" +#include "../../net/minecraft/world/level/storage/LevelData.h" +#include "../../../Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/LevelGenerationOptions.h" +#include "../../net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h" #define RESERVE_ALLOCATION MEM_RESERVE #define COMMIT_ALLOCATION MEM_COMMIT diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.h similarity index 100% rename from Minecraft.World/IO/Files/ConsoleSaveFileSplit.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.h diff --git a/Minecraft.World/IO/Files/ConsoleSavePath.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSavePath.h similarity index 100% rename from Minecraft.World/IO/Files/ConsoleSavePath.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSavePath.h diff --git a/Minecraft.World/IO/Files/FileHeader.cpp b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.cpp similarity index 99% rename from Minecraft.World/IO/Files/FileHeader.cpp rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.cpp index 2e69e4d27..e5124ba60 100644 --- a/Minecraft.World/IO/Files/FileHeader.cpp +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "FileHeader.h" // #define _DEBUG_FILE_HEADER diff --git a/Minecraft.World/IO/Files/FileHeader.h b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h similarity index 99% rename from Minecraft.World/IO/Files/FileHeader.h rename to Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h index 256f6c6c2..981b063bf 100644 --- a/Minecraft.World/IO/Files/FileHeader.h +++ b/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Platform/System.h" +#include "../../ConsoleJavaLibs/System.h" // The first 4 bytes is the location of the header (the header itself is at the // end of the file) Then 4 bytes for the size of the header Then 2 bytes for the diff --git a/Minecraft.World/Util/Definitions.h b/Minecraft.World/ConsoleHelpers/Definitions.h similarity index 100% rename from Minecraft.World/Util/Definitions.h rename to Minecraft.World/ConsoleHelpers/Definitions.h diff --git a/Minecraft.World/Util/HashExtension.h b/Minecraft.World/ConsoleHelpers/HashExtension.h similarity index 100% rename from Minecraft.World/Util/HashExtension.h rename to Minecraft.World/ConsoleHelpers/HashExtension.h diff --git a/Minecraft.World/Util/PerformanceTimer.cpp b/Minecraft.World/ConsoleHelpers/PerformanceTimer.cpp similarity index 92% rename from Minecraft.World/Util/PerformanceTimer.cpp rename to Minecraft.World/ConsoleHelpers/PerformanceTimer.cpp index 4b6c02c95..02aed2672 100644 --- a/Minecraft.World/Util/PerformanceTimer.cpp +++ b/Minecraft.World/ConsoleHelpers/PerformanceTimer.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "PerformanceTimer.h" PerformanceTimer::PerformanceTimer() { Reset(); } diff --git a/Minecraft.World/Util/PerformanceTimer.h b/Minecraft.World/ConsoleHelpers/PerformanceTimer.h similarity index 100% rename from Minecraft.World/Util/PerformanceTimer.h rename to Minecraft.World/ConsoleHelpers/PerformanceTimer.h diff --git a/Minecraft.World/Util/StringHelpers.cpp b/Minecraft.World/ConsoleHelpers/StringHelpers.cpp similarity index 99% rename from Minecraft.World/Util/StringHelpers.cpp rename to Minecraft.World/ConsoleHelpers/StringHelpers.cpp index 445ac21be..2486f4de1 100644 --- a/Minecraft.World/Util/StringHelpers.cpp +++ b/Minecraft.World/ConsoleHelpers/StringHelpers.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "simdutf.h" std::wstring toLower(const std::wstring& a) { diff --git a/Minecraft.World/Util/StringHelpers.h b/Minecraft.World/ConsoleHelpers/StringHelpers.h similarity index 100% rename from Minecraft.World/Util/StringHelpers.h rename to Minecraft.World/ConsoleHelpers/StringHelpers.h diff --git a/Minecraft.World/Util/ThreadName.cpp b/Minecraft.World/ConsoleHelpers/ThreadName.cpp similarity index 96% rename from Minecraft.World/Util/ThreadName.cpp rename to Minecraft.World/ConsoleHelpers/ThreadName.cpp index a65c7fb2e..32848d3d8 100644 --- a/Minecraft.World/Util/ThreadName.cpp +++ b/Minecraft.World/ConsoleHelpers/ThreadName.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include // From Xbox documentation diff --git a/Minecraft.World/Util/ThreadName.h b/Minecraft.World/ConsoleHelpers/ThreadName.h similarity index 100% rename from Minecraft.World/Util/ThreadName.h rename to Minecraft.World/ConsoleHelpers/ThreadName.h diff --git a/Minecraft.World/Util/Arrays.h b/Minecraft.World/ConsoleJavaLibs/Arrays.h similarity index 96% rename from Minecraft.World/Util/Arrays.h rename to Minecraft.World/ConsoleJavaLibs/Arrays.h index 89e3fcfd5..b55f11f4b 100644 --- a/Minecraft.World/Util/Arrays.h +++ b/Minecraft.World/ConsoleJavaLibs/Arrays.h @@ -1,6 +1,6 @@ #pragma once -#include "ArrayWithLength.h" +#include "../ConsoleHelpers/ArrayWithLength.h" class Arrays { public: diff --git a/Minecraft.World/IO/Streams/Buffer.cpp b/Minecraft.World/ConsoleJavaLibs/Buffer.cpp similarity index 98% rename from Minecraft.World/IO/Streams/Buffer.cpp rename to Minecraft.World/ConsoleJavaLibs/Buffer.cpp index e2705aa1b..86c0b8746 100644 --- a/Minecraft.World/IO/Streams/Buffer.cpp +++ b/Minecraft.World/ConsoleJavaLibs/Buffer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "Buffer.h" Buffer::Buffer(unsigned int capacity) diff --git a/Minecraft.World/IO/Streams/Buffer.h b/Minecraft.World/ConsoleJavaLibs/Buffer.h similarity index 100% rename from Minecraft.World/IO/Streams/Buffer.h rename to Minecraft.World/ConsoleJavaLibs/Buffer.h diff --git a/Minecraft.World/IO/Streams/ByteBuffer.cpp b/Minecraft.World/ConsoleJavaLibs/ByteBuffer.cpp similarity index 99% rename from Minecraft.World/IO/Streams/ByteBuffer.cpp rename to Minecraft.World/ConsoleJavaLibs/ByteBuffer.cpp index 96168693c..9bf801557 100644 --- a/Minecraft.World/IO/Streams/ByteBuffer.cpp +++ b/Minecraft.World/ConsoleJavaLibs/ByteBuffer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "IntBuffer.h" #include "FloatBuffer.h" diff --git a/Minecraft.World/IO/Streams/ByteBuffer.h b/Minecraft.World/ConsoleJavaLibs/ByteBuffer.h similarity index 96% rename from Minecraft.World/IO/Streams/ByteBuffer.h rename to Minecraft.World/ConsoleJavaLibs/ByteBuffer.h index 74dd5fafd..a43ebb410 100644 --- a/Minecraft.World/IO/Streams/ByteBuffer.h +++ b/Minecraft.World/ConsoleJavaLibs/ByteBuffer.h @@ -1,7 +1,7 @@ #pragma once #include "Buffer.h" -#include "../../Util/Definitions.h" +#include "../ConsoleHelpers/Definitions.h" class IntBuffer; class FloatBuffer; diff --git a/Minecraft.World/Util/Class.cpp b/Minecraft.World/ConsoleJavaLibs/Class.cpp similarity index 81% rename from Minecraft.World/Util/Class.cpp rename to Minecraft.World/ConsoleJavaLibs/Class.cpp index 48c13b3a1..9880131ee 100644 --- a/Minecraft.World/Util/Class.cpp +++ b/Minecraft.World/ConsoleJavaLibs/Class.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "Class.h" // 4J Stu - To ensure that other classes can get the _class object of it's diff --git a/Minecraft.World/Util/Class.h b/Minecraft.World/ConsoleJavaLibs/Class.h similarity index 100% rename from Minecraft.World/Util/Class.h rename to Minecraft.World/ConsoleJavaLibs/Class.h diff --git a/Minecraft.World/Util/Color.cpp b/Minecraft.World/ConsoleJavaLibs/Color.cpp similarity index 98% rename from Minecraft.World/Util/Color.cpp rename to Minecraft.World/ConsoleJavaLibs/Color.cpp index 8843b01ca..15ad6c77e 100644 --- a/Minecraft.World/Util/Color.cpp +++ b/Minecraft.World/ConsoleJavaLibs/Color.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "Color.h" diff --git a/Minecraft.World/Util/Color.h b/Minecraft.World/ConsoleJavaLibs/Color.h similarity index 100% rename from Minecraft.World/Util/Color.h rename to Minecraft.World/ConsoleJavaLibs/Color.h diff --git a/Minecraft.World/Util/Exceptions.h b/Minecraft.World/ConsoleJavaLibs/Exceptions.h similarity index 100% rename from Minecraft.World/Util/Exceptions.h rename to Minecraft.World/ConsoleJavaLibs/Exceptions.h diff --git a/Minecraft.World/IO/Files/File.cpp b/Minecraft.World/ConsoleJavaLibs/File.cpp similarity index 98% rename from Minecraft.World/IO/Files/File.cpp rename to Minecraft.World/ConsoleJavaLibs/File.cpp index be3926eef..0d17436ba 100644 --- a/Minecraft.World/IO/Files/File.cpp +++ b/Minecraft.World/ConsoleJavaLibs/File.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "FileFilter.h" -#include "../../Level/Storage/McRegionLevelStorageSource.h" +#include "../net/minecraft/world/level/storage/McRegionLevelStorageSource.h" #include "File.h" -#include "../../../Minecraft.World/Util/PathHelper.h" +#include "../Header Files/PathHelper.h" #include #include diff --git a/Minecraft.World/IO/Files/File.h b/Minecraft.World/ConsoleJavaLibs/File.h similarity index 100% rename from Minecraft.World/IO/Files/File.h rename to Minecraft.World/ConsoleJavaLibs/File.h diff --git a/Minecraft.World/IO/Files/FileFilter.h b/Minecraft.World/ConsoleJavaLibs/FileFilter.h similarity index 100% rename from Minecraft.World/IO/Files/FileFilter.h rename to Minecraft.World/ConsoleJavaLibs/FileFilter.h diff --git a/Minecraft.World/IO/Files/FilenameFilter.h b/Minecraft.World/ConsoleJavaLibs/FilenameFilter.h similarity index 81% rename from Minecraft.World/IO/Files/FilenameFilter.h rename to Minecraft.World/ConsoleJavaLibs/FilenameFilter.h index 1e475783d..687412f5a 100644 --- a/Minecraft.World/IO/Files/FilenameFilter.h +++ b/Minecraft.World/ConsoleJavaLibs/FilenameFilter.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Platform/stdafx.h" +#include "../Header Files/stdafx.h" class File; diff --git a/Minecraft.World/IO/Streams/FloatBuffer.cpp b/Minecraft.World/ConsoleJavaLibs/FloatBuffer.cpp similarity index 97% rename from Minecraft.World/IO/Streams/FloatBuffer.cpp rename to Minecraft.World/ConsoleJavaLibs/FloatBuffer.cpp index ea753ec6c..0a0c1e916 100644 --- a/Minecraft.World/IO/Streams/FloatBuffer.cpp +++ b/Minecraft.World/ConsoleJavaLibs/FloatBuffer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "FloatBuffer.h" // Allocates a new float buffer. diff --git a/Minecraft.World/IO/Streams/FloatBuffer.h b/Minecraft.World/ConsoleJavaLibs/FloatBuffer.h similarity index 100% rename from Minecraft.World/IO/Streams/FloatBuffer.h rename to Minecraft.World/ConsoleJavaLibs/FloatBuffer.h diff --git a/Minecraft.World/IO/Streams/BufferedOutputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.cpp similarity index 98% rename from Minecraft.World/IO/Streams/BufferedOutputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.cpp index 5e41fb5c2..99e0cc9e6 100644 --- a/Minecraft.World/IO/Streams/BufferedOutputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "BufferedOutputStream.h" diff --git a/Minecraft.World/IO/Streams/BufferedOutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/BufferedOutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.h diff --git a/Minecraft.World/IO/Streams/BufferedReader.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.cpp similarity index 99% rename from Minecraft.World/IO/Streams/BufferedReader.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.cpp index ab8996790..ad440c228 100644 --- a/Minecraft.World/IO/Streams/BufferedReader.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "BufferedReader.h" diff --git a/Minecraft.World/IO/Streams/BufferedReader.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.h similarity index 100% rename from Minecraft.World/IO/Streams/BufferedReader.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.h diff --git a/Minecraft.World/IO/Streams/ByteArrayInputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.cpp similarity index 99% rename from Minecraft.World/IO/Streams/ByteArrayInputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.cpp index f4b317b18..96c94f350 100644 --- a/Minecraft.World/IO/Streams/ByteArrayInputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "InputOutputStream.h" diff --git a/Minecraft.World/IO/Streams/ByteArrayInputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/ByteArrayInputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.h diff --git a/Minecraft.World/IO/Streams/ByteArrayOutputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.cpp similarity index 98% rename from Minecraft.World/IO/Streams/ByteArrayOutputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.cpp index 7cc8b4efb..e6bd50dfd 100644 --- a/Minecraft.World/IO/Streams/ByteArrayOutputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "ByteArrayOutputStream.h" diff --git a/Minecraft.World/IO/Streams/ByteArrayOutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/ByteArrayOutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h diff --git a/Minecraft.World/IO/Streams/DataInput.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInput.h similarity index 100% rename from Minecraft.World/IO/Streams/DataInput.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInput.h diff --git a/Minecraft.World/IO/Streams/DataInputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.cpp similarity index 99% rename from Minecraft.World/IO/Streams/DataInputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.cpp index 3cc3988ac..8c70b3a79 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "DataInputStream.h" #include diff --git a/Minecraft.World/IO/Streams/DataInputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/DataInputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h diff --git a/Minecraft.World/IO/Streams/DataOutput.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutput.h similarity index 100% rename from Minecraft.World/IO/Streams/DataOutput.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutput.h diff --git a/Minecraft.World/IO/Streams/DataOutputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.cpp similarity index 99% rename from Minecraft.World/IO/Streams/DataOutputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.cpp index fc5d80451..3b14dbfa7 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "DataOutputStream.h" #include diff --git a/Minecraft.World/IO/Streams/DataOutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/DataOutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h diff --git a/Minecraft.World/IO/Files/FileInputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.cpp similarity index 99% rename from Minecraft.World/IO/Files/FileInputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.cpp index 84c5220b1..92348c197 100644 --- a/Minecraft.World/IO/Files/FileInputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" -#include "File.h" +#include "../File.h" #include "FileInputStream.h" #include diff --git a/Minecraft.World/IO/Files/FileInputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h similarity index 92% rename from Minecraft.World/IO/Files/FileInputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h index 7d3d3eed7..80d6aa91f 100644 --- a/Minecraft.World/IO/Files/FileInputStream.h +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h @@ -3,7 +3,7 @@ #include -#include "../Streams/InputStream.h" +#include "InputStream.h" class File; diff --git a/Minecraft.World/IO/Files/FileOutputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.cpp similarity index 98% rename from Minecraft.World/IO/Files/FileOutputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.cpp index bc7685228..e66ce451c 100644 --- a/Minecraft.World/IO/Files/FileOutputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "File.h" +#include "../../Header Files/stdafx.h" +#include "../File.h" #include "FileOutputStream.h" // Creates a file output stream to write to the file represented by the diff --git a/Minecraft.World/IO/Files/FileOutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h similarity index 92% rename from Minecraft.World/IO/Files/FileOutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h index 988dc9222..0df2cd6b4 100644 --- a/Minecraft.World/IO/Files/FileOutputStream.h +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h @@ -3,7 +3,7 @@ #include -#include "../Streams/OutputStream.h" +#include "OutputStream.h" class File; diff --git a/Minecraft.World/IO/Streams/GZIPInputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPInputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/GZIPInputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPInputStream.h diff --git a/Minecraft.World/IO/Streams/GZIPOutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPOutputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/GZIPOutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPOutputStream.h diff --git a/Minecraft.World/IO/Streams/InputOutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h similarity index 84% rename from Minecraft.World/IO/Streams/InputOutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h index 5005c2309..1708c213a 100644 --- a/Minecraft.World/IO/Streams/InputOutputStream.h +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h @@ -4,7 +4,7 @@ #include "ByteArrayInputStream.h" #include "DataInput.h" #include "DataInputStream.h" -#include "../Files/FileInputStream.h" +#include "FileInputStream.h" #include "GZIPInputStream.h" #include "OutputStream.h" @@ -12,7 +12,7 @@ #include "DataOutput.h" #include "BufferedOutputStream.h" #include "DataOutputStream.h" -#include "../Files/FileOutputStream.h" +#include "FileOutputStream.h" #include "GZIPOutputStream.h" #include "Reader.h" diff --git a/Minecraft.World/IO/Streams/InputStream.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.cpp similarity index 78% rename from Minecraft.World/IO/Streams/InputStream.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.cpp index bcb6ff928..7798095f2 100644 --- a/Minecraft.World/IO/Streams/InputStream.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../Files/File.h" +#include "../../Header Files/stdafx.h" +#include "../File.h" #include "InputOutputStream.h" #include "InputStream.h" diff --git a/Minecraft.World/IO/Streams/InputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/InputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h diff --git a/Minecraft.World/IO/Streams/InputStreamReader.cpp b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.cpp similarity index 97% rename from Minecraft.World/IO/Streams/InputStreamReader.cpp rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.cpp index 44af81283..77c4223c0 100644 --- a/Minecraft.World/IO/Streams/InputStreamReader.cpp +++ b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "InputStream.h" #include "DataInputStream.h" diff --git a/Minecraft.World/IO/Streams/InputStreamReader.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h similarity index 100% rename from Minecraft.World/IO/Streams/InputStreamReader.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h diff --git a/Minecraft.World/IO/Streams/OutputStream.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/OutputStream.h similarity index 100% rename from Minecraft.World/IO/Streams/OutputStream.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/OutputStream.h diff --git a/Minecraft.World/IO/Streams/Reader.h b/Minecraft.World/ConsoleJavaLibs/InputOutputStream/Reader.h similarity index 100% rename from Minecraft.World/IO/Streams/Reader.h rename to Minecraft.World/ConsoleJavaLibs/InputOutputStream/Reader.h diff --git a/Minecraft.World/IO/Streams/IntBuffer.cpp b/Minecraft.World/ConsoleJavaLibs/IntBuffer.cpp similarity index 98% rename from Minecraft.World/IO/Streams/IntBuffer.cpp rename to Minecraft.World/ConsoleJavaLibs/IntBuffer.cpp index 857866d10..87c6ccf0a 100644 --- a/Minecraft.World/IO/Streams/IntBuffer.cpp +++ b/Minecraft.World/ConsoleJavaLibs/IntBuffer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "IntBuffer.h" diff --git a/Minecraft.World/IO/Streams/IntBuffer.h b/Minecraft.World/ConsoleJavaLibs/IntBuffer.h similarity index 100% rename from Minecraft.World/IO/Streams/IntBuffer.h rename to Minecraft.World/ConsoleJavaLibs/IntBuffer.h diff --git a/Minecraft.World/Util/JavaIntHash.h b/Minecraft.World/ConsoleJavaLibs/JavaIntHash.h similarity index 100% rename from Minecraft.World/Util/JavaIntHash.h rename to Minecraft.World/ConsoleJavaLibs/JavaIntHash.h diff --git a/Minecraft.World/Util/JavaMath.cpp b/Minecraft.World/ConsoleJavaLibs/JavaMath.cpp similarity index 98% rename from Minecraft.World/Util/JavaMath.cpp rename to Minecraft.World/ConsoleJavaLibs/JavaMath.cpp index d83332c8e..70bb230bc 100644 --- a/Minecraft.World/Util/JavaMath.cpp +++ b/Minecraft.World/ConsoleJavaLibs/JavaMath.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "JavaMath.h" diff --git a/Minecraft.World/Util/JavaMath.h b/Minecraft.World/ConsoleJavaLibs/JavaMath.h similarity index 100% rename from Minecraft.World/Util/JavaMath.h rename to Minecraft.World/ConsoleJavaLibs/JavaMath.h diff --git a/Minecraft.World/Util/Random.cpp b/Minecraft.World/ConsoleJavaLibs/Random.cpp similarity index 97% rename from Minecraft.World/Util/Random.cpp rename to Minecraft.World/ConsoleJavaLibs/Random.cpp index 55bead661..0e305835f 100644 --- a/Minecraft.World/Util/Random.cpp +++ b/Minecraft.World/ConsoleJavaLibs/Random.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../Header Files/stdafx.h" #include "Random.h" #include #include // for int64_t -#include "../Platform/System.h" +#include "System.h" Random::Random() { // 4J - jave now uses the system nanosecond counter added to a diff --git a/Minecraft.World/Util/Random.h b/Minecraft.World/ConsoleJavaLibs/Random.h similarity index 100% rename from Minecraft.World/Util/Random.h rename to Minecraft.World/ConsoleJavaLibs/Random.h diff --git a/Minecraft.World/Util/Reference.h b/Minecraft.World/ConsoleJavaLibs/Reference.h similarity index 100% rename from Minecraft.World/Util/Reference.h rename to Minecraft.World/ConsoleJavaLibs/Reference.h diff --git a/Minecraft.World/Network/Socket.cpp b/Minecraft.World/ConsoleJavaLibs/Socket.cpp similarity index 98% rename from Minecraft.World/Network/Socket.cpp rename to Minecraft.World/ConsoleJavaLibs/Socket.cpp index 120cd5700..d278924b3 100644 --- a/Minecraft.World/Network/Socket.cpp +++ b/Minecraft.World/ConsoleJavaLibs/Socket.cpp @@ -1,14 +1,14 @@ #include #include -#include "../Platform/stdafx.h" -#include "../IO/Streams/InputOutputStream.h" +#include "../Header Files/stdafx.h" +#include "InputOutputStream/InputOutputStream.h" #include "SocketAddress.h" #include "Socket.h" -#include "../Util/ThreadName.h" -#include "../../Minecraft.Client/Network/ServerConnection.h" +#include "../ConsoleHelpers/ThreadName.h" +#include "../../Minecraft.Client/net/minecraft/server/network/ServerConnection.h" #include -#include "../../Minecraft.Client/Platform/Common/ShutdownManager.h" +#include "../../Minecraft.Client/Common/ShutdownManager.h" // This current socket implementation is for the creation of a single local // link. 2 sockets can be created, one for either end of this local link, the diff --git a/Minecraft.World/Network/Socket.h b/Minecraft.World/ConsoleJavaLibs/Socket.h similarity index 98% rename from Minecraft.World/Network/Socket.h rename to Minecraft.World/ConsoleJavaLibs/Socket.h index 6a26e1001..b1027f8ba 100644 --- a/Minecraft.World/Network/Socket.h +++ b/Minecraft.World/ConsoleJavaLibs/Socket.h @@ -7,8 +7,8 @@ #endif #include #include -#include "../IO/Streams/InputStream.h" -#include "../IO/Streams/OutputStream.h" +#include "InputOutputStream/InputStream.h" +#include "InputOutputStream/OutputStream.h" #define SOCKET_CLIENT_END 0 #define SOCKET_SERVER_END 1 diff --git a/Minecraft.World/Network/SocketAddress.h b/Minecraft.World/ConsoleJavaLibs/SocketAddress.h similarity index 100% rename from Minecraft.World/Network/SocketAddress.h rename to Minecraft.World/ConsoleJavaLibs/SocketAddress.h diff --git a/Minecraft.World/Platform/System.h b/Minecraft.World/ConsoleJavaLibs/System.h similarity index 97% rename from Minecraft.World/Platform/System.h rename to Minecraft.World/ConsoleJavaLibs/System.h index 20424e4f7..82321cdf2 100644 --- a/Minecraft.World/Platform/System.h +++ b/Minecraft.World/ConsoleJavaLibs/System.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../Util/ArrayWithLength.h" +#include "../ConsoleHelpers/ArrayWithLength.h" // 4J Jev, just thought it would be easier this way. #define ArrayCopyFunctionDeclaration(x) \ diff --git a/Minecraft.World/Platform/System.cpp b/Minecraft.World/ConsoleJavaLibs/system.cpp similarity index 99% rename from Minecraft.World/Platform/System.cpp rename to Minecraft.World/ConsoleJavaLibs/system.cpp index 23d92499e..74a4af283 100644 --- a/Minecraft.World/Platform/System.cpp +++ b/Minecraft.World/ConsoleJavaLibs/system.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "../Header Files/stdafx.h" #include "System.h" #if defined(__linux__) #include diff --git a/Minecraft.World/Entities/GlobalEntity.cpp b/Minecraft.World/Entities/GlobalEntity.cpp deleted file mode 100644 index beb18c0f5..000000000 --- a/Minecraft.World/Entities/GlobalEntity.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "../Platform/stdafx.h" -#include "GlobalEntity.h" diff --git a/Minecraft.World/Entities/Mobs/Creature.cpp b/Minecraft.World/Entities/Mobs/Creature.cpp deleted file mode 100644 index fb5ede2d2..000000000 --- a/Minecraft.World/Entities/Mobs/Creature.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Platform/stdafx.h" -#include "Creature.h" diff --git a/Minecraft.World/Entities/Mobs/Npc.cpp b/Minecraft.World/Entities/Mobs/Npc.cpp deleted file mode 100644 index 7a0cbf996..000000000 --- a/Minecraft.World/Entities/Mobs/Npc.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "../../Platform/stdafx.h" - -#include "Npc.h" diff --git a/Minecraft.World/Level/Events/LevelObjectInputStream.h b/Minecraft.World/Header Files/LevelObjectInputStream.h similarity index 100% rename from Minecraft.World/Level/Events/LevelObjectInputStream.h rename to Minecraft.World/Header Files/LevelObjectInputStream.h diff --git a/Minecraft.World/Platform/Minecraft.World.h b/Minecraft.World/Header Files/Minecraft.World.h similarity index 100% rename from Minecraft.World/Platform/Minecraft.World.h rename to Minecraft.World/Header Files/Minecraft.World.h diff --git a/Minecraft.World/Util/ParticleTypes.h b/Minecraft.World/Header Files/ParticleTypes.h similarity index 100% rename from Minecraft.World/Util/ParticleTypes.h rename to Minecraft.World/Header Files/ParticleTypes.h diff --git a/Minecraft.World/Util/PathHelper.h b/Minecraft.World/Header Files/PathHelper.h similarity index 100% rename from Minecraft.World/Util/PathHelper.h rename to Minecraft.World/Header Files/PathHelper.h diff --git a/Minecraft.World/Util/PortableFileIO.h b/Minecraft.World/Header Files/PortableFileIO.h similarity index 98% rename from Minecraft.World/Util/PortableFileIO.h rename to Minecraft.World/Header Files/PortableFileIO.h index 75dd2ed6d..02a576c45 100644 --- a/Minecraft.World/Util/PortableFileIO.h +++ b/Minecraft.World/Header Files/PortableFileIO.h @@ -4,7 +4,7 @@ #include #include -#include "StringHelpers.h" +#include "../ConsoleHelpers/StringHelpers.h" namespace PortableFileIO { enum class BinaryReadStatus { diff --git a/Minecraft.World/Util/SoundTypes.h b/Minecraft.World/Header Files/SoundTypes.h similarity index 100% rename from Minecraft.World/Util/SoundTypes.h rename to Minecraft.World/Header Files/SoundTypes.h diff --git a/Minecraft.World/IO/Streams/Compression.h b/Minecraft.World/Header Files/compression.h similarity index 98% rename from Minecraft.World/IO/Streams/Compression.h rename to Minecraft.World/Header Files/compression.h index 2ff65a491..82cf5b46e 100644 --- a/Minecraft.World/IO/Streams/Compression.h +++ b/Minecraft.World/Header Files/compression.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../Files/FileHeader.h" +#include "../ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h" class Compression { public: diff --git a/Minecraft.World/Util/libdivide.h b/Minecraft.World/Header Files/libdivide.h similarity index 100% rename from Minecraft.World/Util/libdivide.h rename to Minecraft.World/Header Files/libdivide.h diff --git a/Minecraft.World/Header Files/stdafx.h b/Minecraft.World/Header Files/stdafx.h new file mode 100644 index 000000000..a56f2e4b1 --- /dev/null +++ b/Minecraft.World/Header Files/stdafx.h @@ -0,0 +1,116 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// +#pragma once + +#ifdef _WINDOWS64 +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#include +#include +#include +#include +#endif + +#ifdef __linux__ +#include +#include +#include +#include "../../Minecraft.Client/Linux/Stubs/LinuxStubs.h" +#else +#include +#include +#include +#include +#endif + +#include + +#include "../x64headers/extraX64.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "../ConsoleHelpers/Definitions.h" +#include "../ConsoleJavaLibs/Class.h" +#include "../ConsoleJavaLibs/Exceptions.h" +#include "../net/minecraft/util/Mth.h" +#include "../ConsoleHelpers/StringHelpers.h" +#include "../ConsoleHelpers/ArrayWithLength.h" +#include "../ConsoleJavaLibs/Random.h" +#include "../net/minecraft/world/level/TilePos.h" +#include "../net/minecraft/world/level/ChunkPos.h" +#include "compression.h" +#include "../ConsoleHelpers/PerformanceTimer.h" + +#ifdef _FINAL_BUILD +#define printf BREAKTHECOMPILE +#define wprintf BREAKTHECOMPILE +#undef OutputDebugString +#define OutputDebugString BREAKTHECOMPILE +#define OutputDebugStringA BREAKTHECOMPILE +#define OutputDebugStringW BREAKTHECOMPILE +#endif + +void MemSect(int sect); + +#ifdef _WINDOWS64 +#include "../../Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h" +#include "../../Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Render.h" +#include "../../Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h" +#include "../../Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h" +#else +#include "4J_Profile.h" +#include "4J_Render.h" +#include "4J_Storage.h" +#include "4J_Input.h" +#endif + +#include "../../Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h" + +#include "../../Minecraft.Client/Common/Source Files/UI/All Platforms/UIEnums.h" +#include "../../Minecraft.Client/Common/App_Defines.h" +#include "../../Minecraft.Client/Common/App_enums.h" +#include "../../Minecraft.Client/Common/Source Files/Tutorial/TutorialEnum.h" +#include "../../Minecraft.Client/Common/App_structs.h" + +#include "../../Minecraft.Client/Common/Consoles_App.h" +#include "../../Minecraft.Client/Common/Minecraft_Macros.h" +#include "../../Minecraft.Client/Common/Source Files/Colours/ColourTable.h" + +#include "../../Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h" + +// This is generated at build time via scripts/pack_loc.py +#include "strings.h" + +#ifdef _WINDOWS64 +#include "../../Minecraft.Client/Windows64/Windows64_App.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/MinecraftTelemetry.h" +#else +// Use the Linux runtime path with supported metadata/config headers only. +#include "../../Minecraft.Client/Linux/Linux_App.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/DynamicConfigurations.h" +#include "../../Minecraft.Client/Header Files/Minecraft.spa.h" +#endif + +#include "../../Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.h" +#include "../../Minecraft.Client/Common/Source Files/Console_Awards_enum.h" +#include "../../Minecraft.Client/Common/Potion_Macros.h" +#include "../../Minecraft.Client/Common/Source Files/Console_Debug_enum.h" +#include "../../Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRulesConstants.h" +#include "../../Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRules.h" +#include "../../Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.h" diff --git a/Minecraft.World/Headers/com.mojang.nbt.h b/Minecraft.World/Headers/com.mojang.nbt.h deleted file mode 100644 index e337cffd9..000000000 --- a/Minecraft.World/Headers/com.mojang.nbt.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "../IO/NBT/NbtIO.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.commands.common.h b/Minecraft.World/Headers/net.minecraft.commands.common.h deleted file mode 100644 index 7f5a886cf..000000000 --- a/Minecraft.World/Headers/net.minecraft.commands.common.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "../Commands/DefaultGameModeCommand.h" -#include "../Commands/EffectCommand.h" -#include "../Commands/EnchantItemCommand.h" -#include "../Commands/ExperienceCommand.h" -#include "../Commands/GameModeCommand.h" -#include "../Commands/GiveItemCommand.h" -#include "../Commands/KillCommand.h" -#include "../Commands/TimeCommand.h" -#include "../Commands/ToggleDownfallCommand.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.commands.h b/Minecraft.World/Headers/net.minecraft.commands.h deleted file mode 100644 index 3646a7425..000000000 --- a/Minecraft.World/Headers/net.minecraft.commands.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "../Commands/AdminLogCommand.h" -#include "../Commands/CommandsEnum.h" -#include "../Commands/Command.h" -#include "../Commands/CommandDispatcher.h" -#include "../Commands/CommandSender.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.core.h b/Minecraft.World/Headers/net.minecraft.core.h deleted file mode 100644 index 985a72f95..000000000 --- a/Minecraft.World/Headers/net.minecraft.core.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include "../Core/Behavior.h" -#include "../Core/BlockSource.h" -#include "../Core/BlockSourceImpl.h" -#include "../Core/BehaviorRegistry.h" -#include "../Core/DispenseItemBehavior.h" -#include "../Core/DefaultDispenseItemBehavior.h" -#include "../Core/AbstractProjectileDispenseBehavior.h" -#include "../Core/ItemDispenseBehaviors.h" -#include "../Core/FacingEnum.h" -#include "../Core/LocatableSource.h" -#include "../Core/Location.h" -#include "../Core/Position.h" -#include "../Core/PositionImpl.h" -#include "../Core/Source.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.h b/Minecraft.World/Headers/net.minecraft.h deleted file mode 100644 index 000b8bd72..000000000 --- a/Minecraft.World/Headers/net.minecraft.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "../Util/Facing.h" -#include "../Util/Direction.h" -#include "../Util/Pos.h" -#include "../Util/SharedConstants.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.locale.h b/Minecraft.World/Headers/net.minecraft.locale.h deleted file mode 100644 index 0a8e80fe5..000000000 --- a/Minecraft.World/Headers/net.minecraft.locale.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "../Util/Language.h" -#include "../Util/I18n.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.network.h b/Minecraft.World/Headers/net.minecraft.network.h deleted file mode 100644 index 6e120e9d1..000000000 --- a/Minecraft.World/Headers/net.minecraft.network.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "../Network/Connection.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.network.packet.h b/Minecraft.World/Headers/net.minecraft.network.packet.h deleted file mode 100644 index 514756eb5..000000000 --- a/Minecraft.World/Headers/net.minecraft.network.packet.h +++ /dev/null @@ -1,110 +0,0 @@ -#pragma once - -#include "../Network/Packets/AddEntityPacket.h" -#include "../Network/Packets/AddGlobalEntityPacket.h" -#include "../Network/Packets/AddMobPacket.h" -#include "../Network/Packets/AddPaintingPacket.h" -#include "../Network/Packets/AddPlayerPacket.h" -#include "../Network/Packets/AnimatePacket.h" -#include "../Network/Packets/AwardStatPacket.h" -#include "../Network/Packets/BlockRegionUpdatePacket.h" -#include "../Network/Packets/ChatPacket.h" -#include "../Network/Packets/ChunkTilesUpdatePacket.h" -#include "../Network/Packets/ChunkVisibilityPacket.h" -#include "../Network/Packets/ComplexItemDataPacket.h" -#include "../Network/Packets/ContainerAckPacket.h" -#include "../Network/Packets/ContainerClickPacket.h" -#include "../Network/Packets/ContainerClosePacket.h" -#include "../Network/Packets/ContainerOpenPacket.h" -#include "../Network/Packets/ContainerSetContentPacket.h" -#include "../Network/Packets/ContainerSetDataPacket.h" -#include "../Network/Packets/ContainerSetSlotPacket.h" -#include "../Network/Packets/DisconnectPacket.h" -#include "../Network/Packets/EntityActionAtPositionPacket.h" -#include "../Network/Packets/EntityEventPacket.h" -#include "../Network/Packets/ExplodePacket.h" -#include "../Network/Packets/GameEventPacket.h" -#include "../Network/Packets/InteractPacket.h" -#include "../Network/Packets/KeepAlivePacket.h" -#include "../Network/Packets/LevelEventPacket.h" -#include "../Network/Packets/LoginPacket.h" -#include "../Network/Packets/MoveEntityPacket.h" -#include "../Network/Packets/MoveEntityPacketSmall.h" -#include "../Network/Packets/MovePlayerPacket.h" -#include "../Network/Packets/Packet.h" -#include "../Network/Packets/PacketListener.h" -#include "../Network/Packets/PlayerActionPacket.h" -#include "../Network/Packets/PlayerCommandPacket.h" -#include "../Network/Packets/PlayerInputPacket.h" -#include "../Network/Packets/PreLoginPacket.h" -#include "../Network/Packets/RemoveEntitiesPacket.h" -#include "../Network/Packets/RespawnPacket.h" - -#include "../Network/Packets/SetCarriedItemPacket.h" -#include "../Network/Packets/SetEntityDataPacket.h" -#include "../Network/Packets/SetEntityMotionPacket.h" -#include "../Network/Packets/SetEquippedItemPacket.h" -#include "../Network/Packets/SetHealthPacket.h" -#include "../Network/Packets/SetEntityLinkPacket.h" -#include "../Network/Packets/SetSpawnPositionPacket.h" -#include "../Network/Packets/SetTimePacket.h" -#include "../Network/Packets/SignUpdatePacket.h" -#include "../Network/Packets/TakeItemEntityPacket.h" -#include "../Network/Packets/TeleportEntityPacket.h" -#include "../Network/Packets/TileEventPacket.h" -#include "../Network/Packets/TileUpdatePacket.h" -#include "../Network/Packets/UseItemPacket.h" - -// 1.8.2 Added -#include "../Network/Packets/AddExperienceOrbPacket.h" -#include "../Network/Packets/GetInfoPacket.h" -#include "../Network/Packets/PlayerInfoPacket.h" -#include "../Network/Packets/RemoveMobEffectPacket.h" -#include "../Network/Packets/SetCreativeModeSlotPacket.h" -#include "../Network/Packets/SetExperiencePacket.h" -#include "../Network/Packets/UpdateMobEffectPacket.h" - -// 1.0.1 Added -#include "../Network/Packets/ContainerButtonClickPacket.h" -#include "../Network/Packets/TileEntityDataPacket.h" - -// 1.1 Added (TU9) -#include "../Network/Packets/CustomPayloadPacket.h" - -// 1.2.3 -#include "../Network/Packets/RotateHeadPacket.h" - -// 1.3.2 -#include "../Network/Packets/ChatAutoCompletePacket.h" -#include "../Network/Packets/ClientCommandPacket.h" -#include "../Network/Packets/ClientInformationPacket.h" -#include "../Network/Packets/ClientProtocolPacket.h" -#include "../Network/Packets/LevelSoundPacket.h" -#include "../Network/Packets/PlayerAbilitiesPacket.h" -#include "../Network/Packets/ServerAuthDataPacket.h" -#include "../Network/Packets/TileDestructionPacket.h" - -// 1.6.4 -#include "../Network/Packets/LevelParticlesPacket.h" -#include "../Network/Packets/SetDisplayObjectivePacket.h" -#include "../Network/Packets/SetObjectivePacket.h" -#include "../Network/Packets/SetPlayerTeamPacket.h" -#include "../Network/Packets/SetScorePacket.h" -#include "../Network/Packets/TileEditorOpenPacket.h" -#include "../Network/Packets/UpdateAttributesPacket.h" - -// 4J Added -#include "../Network/Packets/CraftItemPacket.h" -#include "../Network/Packets/TradeItemPacket.h" -#include "../Network/Packets/DebugOptionsPacket.h" -#include "../Network/Packets/ServerSettingsChangedPacket.h" -#include "../Network/Packets/TexturePacket.h" -#include "../Network/Packets/TextureAndGeometryPacket.h" -#include "../Network/Packets/ChunkVisibilityAreaPacket.h" -#include "../Network/Packets/UpdateProgressPacket.h" -#include "../Network/Packets/TextureChangePacket.h" -#include "../Network/Packets/TextureAndGeometryChangePacket.h" -#include "../Network/Packets/UpdateGameRuleProgressPacket.h" -#include "../Network/Packets/KickPlayerPacket.h" -#include "../Network/Packets/XZPacket.h" -#include "../Network/Packets/GameCommandPacket.h" diff --git a/Minecraft.World/Headers/net.minecraft.stats.h b/Minecraft.World/Headers/net.minecraft.stats.h deleted file mode 100644 index 14e78ce1e..000000000 --- a/Minecraft.World/Headers/net.minecraft.stats.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "../Stats/Achievement.h" -#include "../Stats/Achievements.h" -#include "../Util/DescFormatter.h" -#include "../Stats/GeneralStat.h" -#include "../Stats/ItemStat.h" -#include "../Stats/Stat.h" -#include "../Stats/StatFormatter.h" -#include "../Stats/Stats.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.damagesource.h b/Minecraft.World/Headers/net.minecraft.world.damagesource.h deleted file mode 100644 index 22d7164a7..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.damagesource.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "../Util/CombatEntry.h" -#include "../Util/CombatTracker.h" -#include "../Util/DamageSource.h" -#include "../Entities/EntityDamageSource.h" -#include "../Entities/IndirectEntityDamageSource.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.effect.h b/Minecraft.World/Headers/net.minecraft.world.effect.h deleted file mode 100644 index badfd0e1e..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.effect.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "../Entities/AbsoptionMobEffect.h" -#include "../Entities/AttackDamageMobEffect.h" -#include "../Entities/HealthBoostMobEffect.h" -#include "../Entities/MobEffect.h" -#include "../Entities/InstantaneousMobEffect.h" -#include "../Entities/MobEffectInstance.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.attributes.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.attributes.h deleted file mode 100644 index 51cd4f5af..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.attributes.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "../AI/Attributes/Attribute.h" -#include "../AI/Attributes/AttributeInstance.h" -#include "../AI/Attributes/AttributeModifier.h" -#include "../AI/Attributes/BaseAttribute.h" -#include "../AI/Attributes/BaseAttributeMap.h" -#include "../AI/Attributes/ModifiableAttributeInstance.h" -#include "../AI/Attributes/RangedAttribute.h" -#include "../AI/Attributes/ServersideAttributeMap.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.control.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.control.h deleted file mode 100644 index 2639461d0..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.control.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "../AI/Control/Control.h" -#include "../AI/Control/BodyControl.h" -#include "../AI/Control/JumpControl.h" -#include "../AI/Control/LookControl.h" -#include "../AI/Control/MoveControl.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.goal.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.goal.h deleted file mode 100644 index 9f95bc82b..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.goal.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "../AI/Goals/Goal.h" -#include "../AI/Goals/AvoidPlayerGoal.h" -#include "../AI/Goals/BegGoal.h" -#include "../AI/Goals/BreakDoorGoal.h" -#include "../AI/Goals/BreedGoal.h" -#include "../AI/Goals/ControlledByPlayerGoal.h" -#include "../AI/Goals/DoorInteractGoal.h" -#include "../AI/Goals/EatTileGoal.h" -#include "../AI/Goals/FleeSunGoal.h" -#include "../AI/Goals/FollowOwnerGoal.h" -#include "../AI/Goals/FollowParentGoal.h" -#include "../AI/Goals/FloatGoal.h" -#include "../AI/Goals/GoalSelector.h" -#include "../AI/Goals/InteractGoal.h" -#include "../AI/Goals/LeapAtTargetGoal.h" -#include "../AI/Goals/LookAtPlayerGoal.h" -#include "../AI/Goals/LookAtTradingPlayerGoal.h" -#include "../AI/Goals/MakeLoveGoal.h" -#include "../AI/Goals/MeleeAttackGoal.h" -#include "../AI/Goals/MoveIndoorsGoal.h" -#include "../AI/Goals/MoveThroughVillageGoal.h" -#include "../AI/Goals/MoveTowardsRestrictionGoal.h" -#include "../AI/Goals/MoveTowardsTargetGoal.h" -#include "../AI/Goals/OcelotSitOnTileGoal.h" -#include "../AI/Goals/OfferFlowerGoal.h" -#include "../AI/Goals/OpenDoorGoal.h" -#include "../AI/Goals/OcelotAttackGoal.h" -#include "../AI/Goals/PanicGoal.h" -#include "../AI/Goals/PlayGoal.h" -#include "../AI/Goals/RandomLookAroundGoal.h" -#include "../AI/Goals/RandomStrollGoal.h" -#include "../AI/Goals/RangedAttackGoal.h" -#include "../AI/Goals/RestrictOpenDoorGoal.h" -#include "../AI/Goals/RestrictSunGoal.h" -#include "../AI/Goals/RunAroundLikeCrazyGoal.h" -#include "../AI/Goals/SitGoal.h" -#include "../AI/Goals/SwellGoal.h" -#include "../AI/Goals/TakeFlowerGoal.h" -#include "../AI/Goals/TemptGoal.h" -#include "../AI/Goals/TradeWithPlayerGoal.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.goal.target.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.goal.target.h deleted file mode 100644 index 30220807e..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.goal.target.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "../AI/Goals/TargetGoal.h" -#include "../AI/Goals/DefendVillageTargetGoal.h" -#include "../AI/Goals/HurtByTargetGoal.h" -#include "../AI/Goals/NearestAttackableTargetGoal.h" -#include "../AI/Goals/NonTameRandomTargetGoal.h" -#include "../AI/Goals/OwnerHurtByTargetGoal.h" -#include "../AI/Goals/OwnerHurtTargetGoal.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.navigation.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.navigation.h deleted file mode 100644 index 971421f86..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.navigation.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "../AI/Navigation/PathNavigation.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.sensing.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.sensing.h deleted file mode 100644 index b866d3e20..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.sensing.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "../AI/Control/Sensing.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.util.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.util.h deleted file mode 100644 index 88890596c..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.util.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "../AI/Navigation/RandomPos.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ai.village.h b/Minecraft.World/Headers/net.minecraft.world.entity.ai.village.h deleted file mode 100644 index 4ed86a9a1..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ai.village.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "../Entities/DoorInfo.h" -#include "../WorldGen/Structures/Village.h" -#include "../WorldGen/Structures/Villages.h" -#include "../Level/Events/VillageSiege.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.ambient.h b/Minecraft.World/Headers/net.minecraft.world.entity.ambient.h deleted file mode 100644 index d293c7bd2..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.ambient.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/AmbientCreature.h" -#include "../Entities/Mobs/Bat.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.animal.h b/Minecraft.World/Headers/net.minecraft.world.entity.animal.h deleted file mode 100644 index bc9cfa784..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.animal.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/Animal.h" -#include "../Entities/Mobs/Chicken.h" -#include "../Entities/Mobs/Cow.h" -#include "../Entities/Mobs/Pig.h" -#include "../Entities/Mobs/Sheep.h" -#include "../Entities/Mobs/Squid.h" -#include "../Entities/WaterAnimal.h" -#include "../Entities/Mobs/Wolf.h" - -// 1.0.1 -#include "../Entities/Mobs/Golem.h" -#include "../Entities/Mobs/MushroomCow.h" -#include "../Entities/Mobs/SnowMan.h" - -// 1.2.3 -#include "../Entities/Mobs/Ocelot.h" -#include "../Entities/Mobs/VillagerGolem.h" - -// 1.6.4 -#include "../Entities/Mobs/EntityHorse.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h b/Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h deleted file mode 100644 index 546dc383c..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.boss.enderdragon.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/EnderCrystal.h" -#include "../Entities/Mobs/EnderDragon.h" -#include "../WorldGen/Features/NetherSphereFeature.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.boss.h b/Minecraft.World/Headers/net.minecraft.world.entity.boss.h deleted file mode 100644 index 108bb0e08..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.boss.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/BossMob.h" -#include "../Entities/Mobs/MultiEntityMob.h" -#include "../Entities/Mobs/MultiEntityMobPart.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.global.h b/Minecraft.World/Headers/net.minecraft.world.entity.global.h deleted file mode 100644 index e38731cc6..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.global.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "../Entities/GlobalEntity.h" -#include "../Entities/Mobs/LightningBolt.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.h b/Minecraft.World/Headers/net.minecraft.world.entity.h deleted file mode 100644 index fa51b8bbb..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/Creature.h" -#include "../Entities/SyncedEntityData.h" -#include "../Entities/Entity.h" -#include "../Entities/EntityEvent.h" -#include "../Level/Storage/EntityIO.h" -#include "../Entities/EntityPos.h" -#include "../Entities/FlyingMob.h" -#include "../Entities/Mob.h" -#include "../Entities/MobCategory.h" -#include "../Entities/Mobs/Painting.h" -#include "../Entities/PathfinderMob.h" - -// 1.8.2 -#include "../Util/DelayedRelease.h" -#include "../Entities/Mobs/ExperienceOrb.h" - -// 1.0.1 -#include "../Entities/MobType.h" - -// TU9 -#include "../Entities/Mobs/ItemFrame.h" - -// 1.2.3 -#include "../Entities/Mobs/AgeableMob.h" -#include "../Entities/TamableAnimal.h" - -// 1.6.4 -#include "../Entities/LeashFenceKnotEntity.h" -#include "../Entities/Mobs/MobGroupData.h" -#include "../Entities/OwnableEntity.h" -#include "../Entities/EntitySelector.h" -#include "../Entities/LivingEntity.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.item.h b/Minecraft.World/Headers/net.minecraft.world.entity.item.h deleted file mode 100644 index 79f7fd07e..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.item.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/Boat.h" -#include "../Blocks/FallingTile.h" -#include "../Entities/ItemEntity.h" -#include "../Entities/Mobs/Minecart.h" -#include "../Entities/MinecartChest.h" -#include "../Entities/MinecartContainer.h" -#include "../Entities/MinecartHopper.h" -#include "../Entities/MinecartFurnace.h" -#include "../Entities/MinecartRideable.h" -#include "../Entities/MinecartSpawner.h" -#include "../Entities/MinecartTNT.h" -#include "../Entities/Mobs/PrimedTnt.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.monster.h b/Minecraft.World/Headers/net.minecraft.world.entity.monster.h deleted file mode 100644 index 9102c6c6e..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.monster.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "../Entities/Enemy.h" -#include "../Entities/Monster.h" -#include "../Entities/Mobs/Creeper.h" -#include "../Entities/Mobs/Ghast.h" -#include "../Entities/Mobs/Giant.h" -#include "../Entities/Mobs/Zombie.h" -#include "../Entities/Mobs/PigZombie.h" -#include "../Entities/Mobs/Skeleton.h" -#include "../Entities/Mobs/Slime.h" -#include "../Entities/Mobs/Spider.h" - -// 1.8.2 -#include "../Entities/Mobs/CaveSpider.h" -#include "../Entities/Mobs/EnderMan.h" -#include "../Entities/Mobs/Silverfish.h" - -// 1.0.1 -#include "../Entities/Mobs/Blaze.h" -#include "../Entities/Mobs/LavaSlime.h" - -// 1.6.4 -#include "../Entities/Mobs/RangedAttackMob.h" -#include "../Entities/Mobs/SharedMonsterAttributes.h" -#include "../Entities/Mobs/Witch.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.npc.h b/Minecraft.World/Headers/net.minecraft.world.entity.npc.h deleted file mode 100644 index 96f8f08f6..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.npc.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/Npc.h" -#include "../Entities/Mobs/Villager.h" -#include "../Containers/ClientSideMerchant.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.player.h b/Minecraft.World/Headers/net.minecraft.world.entity.player.h deleted file mode 100644 index 907614a52..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.player.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "../Containers/Inventory.h" -#include "../Player/Player.h" -#include "../Player/Abilities.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.entity.projectile.h b/Minecraft.World/Headers/net.minecraft.world.entity.projectile.h deleted file mode 100644 index df0777e9b..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.entity.projectile.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "../Entities/Mobs/Arrow.h" -#include "../Entities/Mobs/Fireball.h" -#include "../Entities/Mobs/FishingHook.h" -#include "../Entities/Mobs/Snowball.h" -#include "../Entities/Mobs/ThrownEgg.h" - -// 1.0.1 -#include "../Entities/Mobs/EyeOfEnderSignal.h" -#include "../Entities/Mobs/SmallFireball.h" -#include "../Entities/Throwable.h" -#include "../Entities/Mobs/ThrownEnderPearl.h" -#include "../Entities/Mobs/ThrownPotion.h" -#include "../Entities/Mobs/ThrownExpBottle.h" // Brought forward from 1.2 - -// Added TU 9 -#include "../Entities/Mobs/DragonFireball.h" - -// 1.6.4 -#include "../Entities/FireworksRocketEntity.h" -#include "../Entities/LargeFireball.h" -#include "../Entities/Projectile.h" -#include "../Entities/WitherSkull.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.food.h b/Minecraft.World/Headers/net.minecraft.world.food.h deleted file mode 100644 index 2b272b5e2..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.food.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "../Util/FoodConstants.h" -#include "../Player/FoodData.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.h b/Minecraft.World/Headers/net.minecraft.world.h deleted file mode 100644 index fb211fc3f..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "../Containers/CompoundContainer.h" -#include "../Containers/Container.h" -#include "../Util/Difficulty.h" -#include "../Containers/MouseInventoryClickHandler.h" -#include "net.minecraft.world.ContainerListener.h" -#include "../Containers/SimpleContainer.h" - -// TU10 -#include "../Util/Icon.h" -#include "../Util/IconRegister.h" -#include "../Util/FlippedIcon.h" - -#include "../Containers/WorldlyContainer.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.inventory.h b/Minecraft.World/Headers/net.minecraft.world.inventory.h deleted file mode 100644 index 58aa00f65..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.inventory.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "../Containers/AbstractContainerMenu.h" -#include "../Containers/AnimalChest.h" -#include "../Containers/ArmorSlot.h" -#include "../Containers/BeaconMenu.h" -#include "net.minecraft.world.inventory.ContainerListener.h" -#include "../Containers/ContainerMenu.h" -#include "../Containers/CraftingContainer.h" -#include "../Containers/CraftingMenu.h" -#include "../Containers/FireworksMenu.h" -#include "../Containers/FurnaceMenu.h" -#include "../Containers/FurnaceResultSlot.h" -#include "../Containers/HopperMenu.h" -#include "../Containers/HorseInventoryMenu.h" -#include "../Containers/InventoryMenu.h" -#include "../Containers/MenuBackup.h" -#include "../Containers/ResultContainer.h" -#include "../Containers/ResultSlot.h" -#include "../Containers/Slot.h" -#include "../Containers/TrapMenu.h" -#include "../Containers/EnchantmentMenu.h" -#include "../Containers/EnchantmentSlot.h" -#include "../Containers/EnchantmentContainer.h" -#include "../Containers/BrewingStandMenu.h" -#include "../Containers/MerchantContainer.h" -#include "../Containers/MerchantMenu.h" -#include "../Containers/MerchantResultSlot.h" -#include "../Player/PlayerEnderChestContainer.h" -#include "../Containers/AnvilMenu.h" -#include "../Containers/RepairContainer.h" -#include "../Containers/RepairResultSlot.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.item.alchemy.h b/Minecraft.World/Headers/net.minecraft.world.item.alchemy.h deleted file mode 100644 index d60626895..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.item.alchemy.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "../Blocks/TileEntities/PotionBrewing.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.item.crafting.h b/Minecraft.World/Headers/net.minecraft.world.item.crafting.h deleted file mode 100644 index 0c49d9fa3..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.item.crafting.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include "../Recipes/Recipes.h" -#include "../Recipes/Recipy.h" -#include "../Recipes/ArmorDyeRecipe.h" -#include "../Recipes/ArmorRecipes.h" -#include "../Recipes/ClothDyeRecipes.h" -#include "../Recipes/FoodRecipes.h" -#include "../Recipes/FireworksRecipe.h" -#include "../Recipes/FurnaceRecipes.h" -#include "../Recipes/OreRecipes.h" -#include "../Recipes/ShapedRecipy.h" -#include "../Recipes/ShapelessRecipy.h" -#include "../Recipes/StructureRecipes.h" -#include "../Recipes/ToolRecipes.h" -#include "../Recipes/WeaponRecipes.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.item.enchantment.h b/Minecraft.World/Headers/net.minecraft.world.item.enchantment.h deleted file mode 100644 index 556d1c01d..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.item.enchantment.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "../Enchantments/DamageEnchantment.h" -#include "../Enchantments/DigDurabilityEnchantment.h" -#include "../Enchantments/DiggingEnchantment.h" -#include "../Enchantments/Enchantment.h" -#include "../Enchantments/EnchantmentCategory.h" -#include "../Enchantments/EnchantmentHelper.h" -#include "../Enchantments/EnchantmentInstance.h" -#include "../Enchantments/FireAspectEnchantment.h" -#include "../Enchantments/KnockbackEnchantment.h" -#include "../Enchantments/LootBonusEnchantment.h" -#include "../Enchantments/OxygenEnchantment.h" -#include "../Enchantments/ProtectionEnchantment.h" -#include "../Enchantments/UntouchingEnchantment.h" -#include "../Enchantments/WaterWorkerEnchantment.h" - -// 4J Stu - Brought forward -#include "../Enchantments/ArrowDamageEnchantment.h" -#include "../Enchantments/ArrowFireEnchantment.h" -#include "../Enchantments/ArrowInfiniteEnchantment.h" -#include "../Enchantments/ArrowKnockbackEnchantment.h" - -#include "../Enchantments/ThornsEnchantment.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.item.h b/Minecraft.World/Headers/net.minecraft.world.item.h deleted file mode 100644 index e560bd9f5..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.item.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include "../Items/ArmorItem.h" -#include "../Items/BedItem.h" -#include "../Items/BoatItem.h" -#include "../Items/BowItem.h" -#include "../Items/BowlFoodItem.h" -#include "../Items/BucketItem.h" -#include "../Items/TileItems/WoolTileItem.h" -#include "../Items/CoalItem.h" -#include "../Items/ComplexItem.h" -#include "../Items/DiggerItem.h" -#include "../Items/DoorItem.h" -#include "../Items/DyePowderItem.h" -#include "../Items/EggItem.h" -#include "../Items/FishingRodItem.h" -#include "../Items/FlintAndSteelItem.h" -#include "../Items/FoodItem.h" -#include "../Items/HatchetItem.h" -#include "../Items/HoeItem.h" -#include "../Items/Item.h" -#include "../Items/ItemInstance.h" -#include "../Items/TileItems/LeafTileItem.h" -#include "../Items/MapItem.h" -#include "../Items/MinecartItem.h" -// #include "PaintingItem.h" -#include "../Items/PickaxeItem.h" -#include "../Items/TileItems/PistonTileItem.h" -#include "../Items/RecordingItem.h" -#include "../Items/RedstoneItem.h" -#include "../Items/SaddleItem.h" -#include "../Items/TileItems/SaplingTileItem.h" -#include "../Items/SeedItem.h" -#include "../Items/ShearsItem.h" -#include "../Items/ShovelItem.h" -#include "../Items/SignItem.h" -#include "../Items/SnowballItem.h" -#include "../Items/TileItems/StoneSlabTileItem.h" -#include "../Items/TileItems/TileItem.h" -#include "../Items/TileItems/PlanterTileItem.h" -#include "../Items/WeaponItem.h" - -// 1.8.2 -#include "../Items/TileItems/AuxDataTileItem.h" -#include "../Items/TileItems/ColoredTileItem.h" -#include "../Util/UseAnim.h" - -// 1.0.1 -#include "../Items/BottleItem.h" -#include "../Items/EnderEyeItem.h" -#include "../Items/EnderPearlItem.h" -#include "../Items/GoldenAppleItem.h" -#include "../Items/MilkBucketItem.h" -#include "../Items/PotionItem.h" -#include "../Util/Rarity.h" -#include "../Items/TileItems/WaterLilyTileItem.h" -#include "../Items/ExperienceItem.h" // 4J Stu brought forward - -// TU9 -#include "../Items/FireChargeItem.h" -#include "../Entities/Mobs/ItemFrame.h" -#include "../Items/SpawnEggItem.h" -#include "../Items/TileItems/MultiTextureTileItem.h" - -// TU12 -#include "../Items/TileItems/SkullItem.h" - -// TU14 -#include "../Items/TileItems/AnvilTileItem.h" -#include "../Items/BookItem.h" -#include "../Items/CarrotOnAStickItem.h" -#include "../Items/EnchantedBookItem.h" -#include "../Items/SeedFoodItem.h" - -// 1.6.4 -#include "../Items/FireworksChargeItem.h" -#include "../Items/FireworksItem.h" -#include "../Items/LeashItem.h" -#include "../Items/NameTagItem.h" -#include "../Items/SimpleFoiledItem.h" -#include "../Items/SnowItem.h" -#include "../Items/EmptyMapItem.h" - -// 4J Added -#include "../Items/ClockItem.h" -#include "../Items/CompassItem.h" -#include "../Util/HtmlString.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.item.trading.h b/Minecraft.World/Headers/net.minecraft.world.item.trading.h deleted file mode 100644 index fa8762ecd..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.item.trading.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "../Containers/Merchant.h" -#include "../Containers/MerchantRecipe.h" -#include "../Containers/MerchantRecipeList.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.biome.h b/Minecraft.World/Headers/net.minecraft.world.level.biome.h deleted file mode 100644 index 66861636e..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.biome.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "../WorldGen/Biomes/Biome.h" -#include "../WorldGen/Biomes/ForestBiome.h" -#include "../WorldGen/Biomes/HellBiome.h" -#include "../WorldGen/Biomes/RainforestBiome.h" -#include "../WorldGen/Biomes/IceBiome.h" -#include "../WorldGen/Biomes/MushroomIslandBiome.h" -#include "../WorldGen/Biomes/TheEndBiome.h" -#include "../WorldGen/Structures/TheEndBiomeDecorator.h" -#include "../WorldGen/Features/WaterlilyFeature.h" -#include "../WorldGen/Biomes/SwampBiome.h" -#include "../WorldGen/Biomes/TaigaBiome.h" -#include "../Level/Storage/LevelSource.h" -#include "../WorldGen/Biomes/BiomeSource.h" -#include "../WorldGen/Biomes/FixedBiomeSource.h" - -// 1.8.2 -#include "../WorldGen/Biomes/BiomeCache.h" -#include "../WorldGen/Biomes/BiomeDecorator.h" -#include "../WorldGen/Biomes/DesertBiome.h" -#include "../WorldGen/Biomes/ExtremeHillsBiome.h" -#include "../WorldGen/Biomes/OceanBiome.h" -#include "../WorldGen/Biomes/PlainsBiome.h" -#include "../WorldGen/Biomes/RiverBiome.h" - -// 1.1 -#include "../WorldGen/Biomes/BeachBiome.h" - -// 1.2.3 -#include "../WorldGen/Biomes/JungleBiome.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.chunk.h b/Minecraft.World/Headers/net.minecraft.world.level.chunk.h deleted file mode 100644 index 4742b685d..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.chunk.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "../Level/BlockReplacements.h" -#include "../Level/ChunkSource.h" -#include "../Level/Storage/DataLayer.h" -#include "../Level/EmptyLevelChunk.h" -#include "../Level/LevelChunk.h" -#include "../Level/Storage/ReadOnlyChunkCache.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.level.chunk.storage.h b/Minecraft.World/Headers/net.minecraft.world.level.chunk.storage.h deleted file mode 100644 index 5e2c1528f..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.chunk.storage.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "../Level/Storage/ChunkStorage.h" -#include "../Level/Storage/ChunkStorageProfileDecorator.h" -#include "../Level/Storage/MemoryChunkStorage.h" -#include "../Level/Storage/McRegionChunkStorage.h" -#include "../IO/NBT/NbtSlotFile.h" -#include "../Level/Storage/OldChunkStorage.h" -#include "../Level/Storage/RegionFile.h" -#include "../Level/Storage/RegionFileCache.h" -#include "../Level/Storage/ZonedChunkStorage.h" -#include "../Level/Storage/ZoneFile.h" -#include "../Level/Storage/ZoneIO.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.dimension.h b/Minecraft.World/Headers/net.minecraft.world.level.dimension.h deleted file mode 100644 index a44759836..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.dimension.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "../Level/Dimensions/Dimension.h" -#include "../Level/Dimensions/HellDimension.h" -#include "../Level/Dimensions/NormalDimension.h" -#include "../Level/Dimensions/TheEndDimension.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.h b/Minecraft.World/Headers/net.minecraft.world.level.h deleted file mode 100644 index d1839f9ea..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "../Level/BaseMobSpawner.h" -#include "../Level/BlockDestructionProgress.h" -#include "../Level/ChunkPos.h" -#include "../Util/Coord.h" -#include "../Level/Explosion.h" -#include "../Util/FoliageColor.h" -#include "../Level/GameRules.h" -#include "../Util/GrassColor.h" -#include "../Level/LevelConflictException.h" -#include "../Level/Events/LevelListener.h" -#include "../Level/Storage/LevelSource.h" -#include "../Util/LightLayer.h" -#include "../Blocks/MobSpawner.h" -#include "../Level/Storage/PortalForcer.h" -#include "../Level/Storage/Region.h" -#include "../Level/TickNextTickData.h" -#include "../Level/TileEventData.h" -#include "../Level/TilePos.h" -#include "../Util/WaterColor.h" -#include "../Level/Level.h" -#include "../Level/Storage/LevelType.h" -#include "../Level/Storage/LevelSettings.h" - -#include "../Level/Calendar.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.feature.h b/Minecraft.World/Headers/net.minecraft.world.level.levelgen.feature.h deleted file mode 100644 index f0c147f25..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.feature.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "../WorldGen/Features/BasicTreeFeature.h" -#include "../WorldGen/Features/BirchFeature.h" -#include "../WorldGen/Features/CactusFeature.h" -#include "../WorldGen/Features/CaveFeature.h" -#include "../WorldGen/Features/ClayFeature.h" -#include "../WorldGen/Features/DeadBushFeature.h" -#include "../WorldGen/Features/Feature.h" -#include "../WorldGen/Features/FlowerFeature.h" -#include "../WorldGen/Features/HellFireFeature.h" -#include "../WorldGen/Features/HellPortalFeature.h" -#include "../WorldGen/Features/HellSpringFeature.h" -#include "../WorldGen/Features/HouseFeature.h" -#include "../WorldGen/Features/LakeFeature.h" -#include "../WorldGen/Features/LightGemFeature.h" -#include "../WorldGen/Features/MonsterRoomFeature.h" -#include "../WorldGen/Features/OreFeature.h" -#include "../WorldGen/Features/PineFeature.h" -#include "../WorldGen/Features/PumpkinFeature.h" -#include "../WorldGen/Features/ReedsFeature.h" -#include "../WorldGen/Features/SpringFeature.h" -#include "../WorldGen/Features/SpruceFeature.h" -#include "../WorldGen/Features/TallGrassFeature.h" -#include "../WorldGen/Features/TreeFeature.h" - -#include "../WorldGen/Features/HugeMushroomFeature.h" -#include "../WorldGen/Features/SandFeature.h" -#include "../WorldGen/Features/SwampTreeFeature.h" -#include "../WorldGen/Features/BonusChestFeature.h" -#include "../WorldGen/Features/SpikeFeature.h" -#include "../WorldGen/Features/EndPodiumFeature.h" - -#include "../WorldGen/Features/DesertWellFeature.h" -#include "../WorldGen/Features/MegaTreeFeature.h" -#include "../WorldGen/Features/VinesFeature.h" -#include "../WorldGen/Features/GroundBushFeature.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.flat.h b/Minecraft.World/Headers/net.minecraft.world.level.levelgen.flat.h deleted file mode 100644 index 0cfe19ebd..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.flat.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "../WorldGen/Flat/FlatGeneratorInfo.h" -#include "../WorldGen/Flat/FlatLayerInfo.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.h b/Minecraft.World/Headers/net.minecraft.world.level.levelgen.h deleted file mode 100644 index 07bc30ee5..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "../WorldGen/Features/CanyonFeature.h" -#include "../WorldGen/Features/DungeonFeature.h" -#include "../WorldGen/Sources/HellRandomLevelSource.h" -#include "../WorldGen/Sources/HellFlatLevelSource.h" -#include "../WorldGen/Features/LargeCaveFeature.h" -#include "../WorldGen/Features/LargeFeature.h" -#include "../WorldGen/Features/LargeHellCaveFeature.h" -#include "../Level/RandomLevelSource.h" -#include "../WorldGen/Sources/FlatLevelSource.h" -#include "../WorldGen/Features/TownFeature.h" -#include "../WorldGen/Sources/TheEndLevelRandomLevelSource.h" - -#include "../Level/CustomLevelSource.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h b/Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h deleted file mode 100644 index 98cbec5b0..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.structure.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "../Level/BlockGenMethods.h" -#include "../Util/BoundingBox.h" -#include "../WorldGen/Features/MineShaftFeature.h" -#include "../WorldGen/Structures/MineShaftPieces.h" -#include "../WorldGen/Structures/MineShaftStart.h" -#include "../WorldGen/Features/NetherBridgeFeature.h" -#include "../WorldGen/Structures/NetherBridgePieces.h" -#include "../WorldGen/Features/StrongholdFeature.h" -#include "../WorldGen/Structures/StrongholdPieces.h" -#include "../WorldGen/Features/StructureFeature.h" -#include "../WorldGen/StructureFeatureIO.h" -#include "../WorldGen/StructureFeatureSavedData.h" -#include "../WorldGen/Structures/StructurePiece.h" -#include "../WorldGen/Structures/StructureStart.h" -#include "../WorldGen/Features/VillageFeature.h" -#include "../WorldGen/Structures/VillagePieces.h" -#include "../WorldGen/Features/RandomScatteredLargeFeature.h" -#include "../WorldGen/Structures/ScatteredFeaturePieces.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.synth.h b/Minecraft.World/Headers/net.minecraft.world.level.levelgen.synth.h deleted file mode 100644 index d3b04d56a..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.levelgen.synth.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "../Util/Distort.h" -#include "../Util/Emboss.h" -#include "../WorldGen/Noise/FastNoise.h" -#include "../WorldGen/Noise/ImprovedNoise.h" -#include "../WorldGen/Noise/PerlinNoise.h" -#include "../WorldGen/Noise/PerlinSimplexNoise.h" -#include "../Util/Rotate.h" -#include "../Util/Scale.h" -#include "../WorldGen/Noise/SimplexNoise.h" -#include "../WorldGen/Noise/Synth.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.material.h b/Minecraft.World/Headers/net.minecraft.world.level.material.h deleted file mode 100644 index a686fa6d1..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.material.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "../Blocks/DecorationMaterial.h" -#include "../Blocks/GasMaterial.h" -#include "../Blocks/LiquidMaterial.h" -#include "../Blocks/Material.h" -#include "../Blocks/MaterialColor.h" -#include "../Blocks/PortalMaterial.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.newbiome.layer.h b/Minecraft.World/Headers/net.minecraft.world.level.newbiome.layer.h deleted file mode 100644 index c77578b3d..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.newbiome.layer.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "../WorldGen/Layers/AddIslandLayer.h" -#include "../WorldGen/Layers/AddMushroomIslandLayer.h" -#include "../WorldGen/Layers/AddSnowLayer.h" -#include "../WorldGen/Layers/BiomeInitLayer.h" -#include "../WorldGen/Layers/DownfallLayer.h" -#include "../WorldGen/Layers/DownfallMixerLayer.h" -#include "../WorldGen/Layers/FlatLayer.h" -#include "../WorldGen/Layers/FuzzyZoomLayer.h" -#include "../WorldGen/Layers/IslandLayer.h" -#include "../WorldGen/Layers/Layer.h" -#include "../WorldGen/Layers/RiverInitLayer.h" -#include "../WorldGen/Layers/RiverLayer.h" -#include "../WorldGen/Layers/RiverMixerLayer.h" -#include "../WorldGen/Layers/ShoreLayer.h" -#include "../WorldGen/Layers/SmoothLayer.h" -#include "../WorldGen/Layers/SmoothZoomLayer.h" -#include "../WorldGen/Layers/TemperatureLayer.h" -#include "../WorldGen/Layers/TemperatureMixerLayer.h" -#include "../WorldGen/Layers/VoronoiZoom.h" -#include "../WorldGen/Layers/ZoomLayer.h" -#include "../WorldGen/Layers/GrowMushroomIslandLayer.h" // 4J added - -// 1.1. -#include "../WorldGen/Layers/RegionHillsLayer.h" -#include "../WorldGen/Layers/SwampRiversLayer.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.level.pathfinder.h b/Minecraft.World/Headers/net.minecraft.world.level.pathfinder.h deleted file mode 100644 index cb5731660..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.pathfinder.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "../Util/BinaryHeap.h" -#include "../AI/Navigation/Node.h" -#include "../AI/Navigation/Path.h" -#include "../AI/Navigation/PathFinder.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.level.redstone.h b/Minecraft.World/Headers/net.minecraft.world.level.redstone.h deleted file mode 100644 index cea785b1c..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.redstone.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "../Level/Redstone.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.saveddata.h b/Minecraft.World/Headers/net.minecraft.world.level.saveddata.h deleted file mode 100644 index 71ee2f91e..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.saveddata.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "../Level/Storage/SavedData.h" -#include "../Level/Storage/MapItemSavedData.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.level.storage.h b/Minecraft.World/Headers/net.minecraft.world.level.storage.h deleted file mode 100644 index 7d9fc08d7..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.storage.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "../Level/Storage/DirectoryLevelStorage.h" -#include "../Level/Storage/DirectoryLevelStorageSource.h" -#include "../Level/LevelData.h" -#include "../Level/Storage/LevelStorage.h" -#include "../Level/Storage/LevelStorageProfilerDecorator.h" -#include "../Level/Storage/LevelStorageSource.h" -#include "../Level/Storage/LevelSummary.h" -#include "../Level/Storage/McRegionLevelStorage.h" -#include "../Level/Storage/McRegionLevelStorageSource.h" -// #include "../Level/Storage/MemoryLevelStorage.h" // 4J removed as unused -// #include "../Level/Storage/MemoryLevelStorageSource.h" // 4J removed as -// unused -#include "../Level/Storage/MockedLevelStorage.h" -#include "../Level/Storage/PlayerIO.h" -#include "../Level/Storage/SavedDataStorage.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h b/Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h deleted file mode 100644 index 77a97cac5..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.tile.entity.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "../Blocks/TileEntities/BeaconTileEntity.h" -#include "../Blocks/TileEntities/BrewingStandTileEntity.h" -#include "../Blocks/TileEntities/ChestTileEntity.h" -#include "../Blocks/TileEntities/CommandBlockEntity.h" -#include "../Blocks/TileEntities/ComparatorTileEntity.h" -#include "../Blocks/TileEntities/DaylightDetectorTileEntity.h" -#include "../Blocks/TileEntities/DispenserTileEntity.h" -#include "../Blocks/TileEntities/DropperTileEntity.h" -#include "../Blocks/TileEntities/EnchantmentTableTileEntity.h" -#include "../Blocks/TileEntities/FurnaceTileEntity.h" -#include "../Blocks/TileEntities/Hopper.h" -#include "../Blocks/TileEntities/HopperTileEntity.h" -#include "../Blocks/TileEntities/MobSpawnerTileEntity.h" -#include "../Blocks/TileEntities/MusicTileEntity.h" -#include "../Blocks/TileEntities/SignTileEntity.h" -#include "../Blocks/TileEntities/TileEntity.h" -#include "../Blocks/PistonMovingTileEntity.h" -#include "../Blocks/TileEntities/TheEndPortalTileEntity.h" -#include "../Blocks/TileEntities/SkullTileEntity.h" -#include "../Blocks/TileEntities/EnderChestTileEntity.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.level.tile.h b/Minecraft.World/Headers/net.minecraft.world.level.tile.h deleted file mode 100644 index ad30850c8..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.tile.h +++ /dev/null @@ -1,131 +0,0 @@ -#pragma once - -#include "../Blocks/Tile.h" -#include "../Blocks/AirTile.h" -#include "../Blocks/AnvilTile.h" -#include "../Blocks/BaseEntityTile.h" -#include "../Blocks/BasePressurePlateTile.h" -#include "../Blocks/BaseRailTile.h" -#include "../Blocks/BeaconTile.h" -#include "../Blocks/BedTile.h" -#include "../Blocks/BookshelfTile.h" -#include "../Blocks/BrewingStandTile.h" -#include "../Blocks/PlantTile.h" -#include "../Blocks/ButtonTile.h" -#include "../Blocks/CactusTile.h" -#include "../Blocks/CakeTile.h" -#include "../Blocks/CarrotTile.h" -#include "../Blocks/CauldronTile.h" -#include "../Blocks/ChestTile.h" -#include "../Blocks/ClayTile.h" -#include "../Blocks/CocoaTile.h" -#include "../Blocks/ColoredTile.h" -#include "../Blocks/CommandBlock.h" -#include "../Blocks/ComparatorTile.h" -#include "../Blocks/CoralTile.h" -#include "../Blocks/CropTile.h" -#include "../Blocks/DaylightDetectorTile.h" -#include "../Blocks/DeadBushTile.h" -#include "../Blocks/DetectorRailTile.h" -#include "../Blocks/DiodeTile.h" -#include "../Blocks/DirectionalTile.h" -#include "../Blocks/DirtTile.h" -#include "../Blocks/DispenserTile.h" -#include "../Blocks/DoorTile.h" -#include "../Blocks/DropperTile.h" -#include "../Blocks/EggTile.h" -#include "../Blocks/EnchantmentTableTile.h" -#include "../Blocks/EnderChestTile.h" -#include "../Blocks/TileEntities/EntityTile.h" -#include "../Blocks/FarmTile.h" -#include "../Blocks/FenceGateTile.h" -#include "../Blocks/FenceTile.h" -#include "../Blocks/FireTile.h" -#include "../Blocks/FlowerPotTile.h" -#include "../Blocks/FurnaceTile.h" -#include "../Blocks/GlassTile.h" -#include "../Blocks/GlowstoneTile.h" -#include "../Blocks/GrassTile.h" -#include "../Blocks/GravelTile.h" -#include "../Blocks/HalfSlabTile.h" -#include "../Blocks/HalfTransparentTile.h" -#include "../Blocks/HayBlockTile.h" -#include "../Blocks/HeavyTile.h" -#include "../Blocks/HopperTile.h" -#include "../Blocks/HugeMushroomTile.h" -#include "../Blocks/IceTile.h" -#include "../Blocks/JukeboxTile.h" -#include "../Blocks/LadderTile.h" -#include "../Blocks/LeafTile.h" -#include "../Level/Events/LevelEvent.h" -#include "../Blocks/LeverTile.h" -#include "../Blocks/LiquidTile.h" -#include "../Blocks/LiquidTileDynamic.h" -#include "../Blocks/LiquidTileStatic.h" -#include "../Blocks/LockedChestTile.h" -#include "../Blocks/MelonTile.h" -#include "../Blocks/MetalTile.h" -#include "../Blocks/MobSpawnerTile.h" -#include "../Blocks/MushroomPlantTile.h" -#include "../Blocks/NoteBlockTile.h" -#include "../Blocks/MycelTile.h" -#include "../Blocks/NetherrackTile.h" -#include "../Blocks/NetherWartTile.h" -#include "../Blocks/NotGateTile.h" -#include "../Blocks/ObsidianTile.h" -#include "../Blocks/OreTile.h" -#include "../Blocks/PistonBaseTile.h" -#include "../Blocks/PistonExtensionTile.h" -#include "../Blocks/PortalTile.h" -#include "../Blocks/PotatoTile.h" -#include "../Blocks/PoweredMetalTile.h" -#include "../Blocks/PoweredRailTile.h" -#include "../Blocks/PressurePlateTile.h" -#include "../Blocks/PumpkinTile.h" -#include "../Blocks/QuartzBlockTile.h" -#include "../Blocks/RailTile.h" -#include "../Blocks/RedLightTile.h" -#include "../Blocks/RedStoneDustTile.h" -#include "../Blocks/RedStoneOreTile.h" -#include "../Blocks/ReedTile.h" -#include "../Blocks/RepeaterTile.h" -#include "../Blocks/RotatedPillarTile.h" -#include "../Blocks/SandStoneTile.h" -#include "../Blocks/SaplingPlantTile.h" -#include "../Blocks/SignTile.h" -#include "../Blocks/SkullTile.h" -#include "../Blocks/SmoothStoneBrickTile.h" -#include "../Blocks/SnowTile.h" -#include "../Blocks/SoulSandTile.h" -#include "../Blocks/SpongeTile.h" -#include "../Blocks/StainedGlassBlock.h" -#include "../Blocks/StainedGlassPaneBlock.h" -#include "../Blocks/StairTile.h" -#include "../Blocks/StemTile.h" -#include "../Blocks/StoneButtonTile.h" -#include "../Blocks/StoneMonsterTile.h" -#include "../Blocks/StoneSlabTile.h" -#include "../Blocks/StoneTile.h" -#include "../Blocks/TallGrassPlantTile.h" -#include "../Blocks/TheEndPortalTile.h" -#include "../Blocks/TheEndPortalFrameTile.h" -#include "../Blocks/ThinFenceTile.h" -#include "../Blocks/TntTile.h" -#include "../Blocks/TopSnowTile.h" -#include "../Blocks/TorchTile.h" -#include "../Blocks/TransparentTile.h" -#include "../Blocks/TrapDoorTile.h" -#include "../Blocks/TreeTile.h" -#include "../Blocks/TripWireSourceTile.h" -#include "../Blocks/TripWireTile.h" -#include "../Blocks/VineTile.h" -#include "../Blocks/WallTile.h" -#include "../Blocks/WaterLilyTile.h" -#include "../Blocks/WebTile.h" -#include "../Blocks/WeightedPressurePlateTile.h" -#include "../Blocks/WoodButtonTile.h" -#include "../Blocks/WorkbenchTile.h" -#include "../Blocks/WoodTile.h" -#include "../Blocks/HalfSlabTile.h" -#include "../Blocks/WoodSlabTile.h" -#include "../Blocks/WoolCarpetTile.h" diff --git a/Minecraft.World/Headers/net.minecraft.world.level.tile.piston.h b/Minecraft.World/Headers/net.minecraft.world.level.tile.piston.h deleted file mode 100644 index f6de64b54..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.level.tile.piston.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "../Blocks/PistonBaseTile.h" -#include "../Blocks/PistonExtensionTile.h" -#include "../Blocks/PistonMovingTileEntity.h" -#include "../Blocks/TileEntities/PistonPieceTileEntity.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.phys.h b/Minecraft.World/Headers/net.minecraft.world.phys.h deleted file mode 100644 index cdc742b2a..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.phys.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "../Util/AABB.h" -#include "../Util/HitResult.h" -#include "../Util/Vec3.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.scores.criteria.h b/Minecraft.World/Headers/net.minecraft.world.scores.criteria.h deleted file mode 100644 index 74dd60806..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.scores.criteria.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "../Scores/Criteria/DummyCriteria.h" -#include "../Scores/Criteria/HealthCriteria.h" -#include "../Scores/Criteria/ObjectiveCriteria.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.scores.h b/Minecraft.World/Headers/net.minecraft.world.scores.h deleted file mode 100644 index 0a7dbc3f0..000000000 --- a/Minecraft.World/Headers/net.minecraft.world.scores.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "../Scores/Objective.h" -#include "../Scores/PlayerTeam.h" -#include "../Scores/Score.h" -#include "../Scores/Scoreboard.h" -#include "../Scores/ScoreboardSaveData.h" -#include "../Scores/ScoreHolder.h" -#include "../Scores/Team.h" \ No newline at end of file diff --git a/Minecraft.World/Items/EggItem.cpp b/Minecraft.World/Items/EggItem.cpp deleted file mode 100644 index b47cf12da..000000000 --- a/Minecraft.World/Items/EggItem.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.global.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "EggItem.h" -#include "../Util/SoundTypes.h" - -EggItem::EggItem(int id) : Item(id) { maxStackSize = 16; } - -std::shared_ptr EggItem::use( - std::shared_ptr instance, Level* level, - std::shared_ptr player) { - if (!player->abilities.instabuild) { - instance->count--; - } - level->playEntitySound(player, eSoundType_RANDOM_BOW, 0.5f, - 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) - level->addEntity( - std::shared_ptr(new ThrownEgg(level, player))); - return instance; -} diff --git a/Minecraft.World/Platform/stdafx.h b/Minecraft.World/Platform/stdafx.h index 5f03e70a1..a56f2e4b1 100644 --- a/Minecraft.World/Platform/stdafx.h +++ b/Minecraft.World/Platform/stdafx.h @@ -16,7 +16,7 @@ #include #include #include -#include "../../Minecraft.Client/Platform/Linux/Stubs/LinuxStubs.h" +#include "../../Minecraft.Client/Linux/Stubs/LinuxStubs.h" #else #include #include @@ -26,7 +26,7 @@ #include -#include "x64headers/extraX64.h" +#include "../x64headers/extraX64.h" #include #include @@ -43,17 +43,17 @@ #include -#include "../Util/Definitions.h" -#include "../Util/Class.h" -#include "../Util/Exceptions.h" -#include "../Util/Mth.h" -#include "../Util/StringHelpers.h" -#include "../Util/ArrayWithLength.h" -#include "../Util/Random.h" -#include "../Level/TilePos.h" -#include "../Level/ChunkPos.h" -#include "../IO/Streams/Compression.h" -#include "../Util/PerformanceTimer.h" +#include "../ConsoleHelpers/Definitions.h" +#include "../ConsoleJavaLibs/Class.h" +#include "../ConsoleJavaLibs/Exceptions.h" +#include "../net/minecraft/util/Mth.h" +#include "../ConsoleHelpers/StringHelpers.h" +#include "../ConsoleHelpers/ArrayWithLength.h" +#include "../ConsoleJavaLibs/Random.h" +#include "../net/minecraft/world/level/TilePos.h" +#include "../net/minecraft/world/level/ChunkPos.h" +#include "compression.h" +#include "../ConsoleHelpers/PerformanceTimer.h" #ifdef _FINAL_BUILD #define printf BREAKTHECOMPILE @@ -78,39 +78,39 @@ void MemSect(int sect); #include "4J_Input.h" #endif -#include "../../Minecraft.Client/Platform/Common/Network/GameNetworkManager.h" +#include "../../Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h" -#include "../../Minecraft.Client/Platform/Common/UI/UIEnums.h" -#include "../../Minecraft.Client/Platform/Common/App_Defines.h" -#include "../../Minecraft.Client/Platform/Common/App_enums.h" -#include "../../Minecraft.Client/Platform/Common/Tutorial/TutorialEnum.h" -#include "../../Minecraft.Client/Platform/Common/App_structs.h" +#include "../../Minecraft.Client/Common/Source Files/UI/All Platforms/UIEnums.h" +#include "../../Minecraft.Client/Common/App_Defines.h" +#include "../../Minecraft.Client/Common/App_enums.h" +#include "../../Minecraft.Client/Common/Source Files/Tutorial/TutorialEnum.h" +#include "../../Minecraft.Client/Common/App_structs.h" -#include "../../Minecraft.Client/Platform/Common/Consoles_App.h" -#include "../../Minecraft.Client/Platform/Common/Minecraft_Macros.h" -#include "../../Minecraft.Client/Platform/Common/Colours/ColourTable.h" +#include "../../Minecraft.Client/Common/Consoles_App.h" +#include "../../Minecraft.Client/Common/Minecraft_Macros.h" +#include "../../Minecraft.Client/Common/Source Files/Colours/ColourTable.h" -#include "../../Minecraft.Client/Platform/Common/BuildVer.h" +#include "../../Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h" // This is generated at build time via scripts/pack_loc.py #include "strings.h" #ifdef _WINDOWS64 -#include "../../Minecraft.Client/Platform/Windows64/Windows64_App.h" -#include "../../Minecraft.Client/Platform/Windows64/Sentient/SentientTelemetryCommon.h" -#include "../../Minecraft.Client/Platform/Windows64/Sentient/MinecraftTelemetry.h" +#include "../../Minecraft.Client/Windows64/Windows64_App.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/MinecraftTelemetry.h" #else // Use the Linux runtime path with supported metadata/config headers only. -#include "../../Minecraft.Client/Platform/Linux/Linux_App.h" -#include "../../Minecraft.Client/Platform/Linux/Sentient/SentientTelemetryCommon.h" -#include "../../Minecraft.Client/Platform/Linux/Sentient/DynamicConfigurations.h" -#include "../../Minecraft.Client/Platform/Windows64/GameConfig/Minecraft.spa.h" +#include "../../Minecraft.Client/Linux/Linux_App.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/SentientTelemetryCommon.h" +#include "../../Minecraft.Client/Windows64/Source Files/Sentient/DynamicConfigurations.h" +#include "../../Minecraft.Client/Header Files/Minecraft.spa.h" #endif -#include "../../Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h" -#include "../../Minecraft.Client/Platform/Common/Console_Awards_enum.h" -#include "../../Minecraft.Client/Platform/Common/Potion_Macros.h" -#include "../../Minecraft.Client/Platform/Common/Console_Debug_enum.h" -#include "../../Minecraft.Client/Platform/Common/GameRules/ConsoleGameRulesConstants.h" -#include "../../Minecraft.Client/Platform/Common/GameRules/ConsoleGameRules.h" -#include "../../Minecraft.Client/Platform/Common/Telemetry/TelemetryManager.h" +#include "../../Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.h" +#include "../../Minecraft.Client/Common/Source Files/Console_Awards_enum.h" +#include "../../Minecraft.Client/Common/Potion_Macros.h" +#include "../../Minecraft.Client/Common/Source Files/Console_Debug_enum.h" +#include "../../Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRulesConstants.h" +#include "../../Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRules.h" +#include "../../Minecraft.Client/Common/Source Files/Telemetry/TelemetryManager.h" diff --git a/Minecraft.World/Platform/Minecraft.World.cpp b/Minecraft.World/Source Files/Minecraft.World.cpp similarity index 57% rename from Minecraft.World/Platform/Minecraft.World.cpp rename to Minecraft.World/Source Files/Minecraft.World.cpp index 3770f4c39..9d3a235f3 100644 --- a/Minecraft.World/Platform/Minecraft.World.cpp +++ b/Minecraft.World/Source Files/Minecraft.World.cpp @@ -1,23 +1,23 @@ -#include "stdafx.h" +#include "../Header Files/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.alchemy.h" -#include "../Headers/net.minecraft.world.item.crafting.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.level.chunk.h" -#include "../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.entity.npc.h" -#include "../Headers/net.minecraft.world.effect.h" +#include "../net/minecraft/world/item/net.minecraft.world.item.h" +#include "../net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h" +#include "../net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" +#include "../net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h" +#include "../net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" +#include "../net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../net/minecraft/world/entity/net.minecraft.world.entity.h" +#include "../net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h" +#include "../net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h" +#include "../net/minecraft/world/effect/net.minecraft.world.effect.h" -#include "Minecraft.World.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" +#include "../Header Files/Minecraft.World.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" -#include "../Stats/CommonStats.h" +#include "../net/minecraft/stats/CommonStats.h" void MinecraftWorld_RunStaticCtors() { // The ordering of these static ctors can be important. If they are within diff --git a/Minecraft.World/IO/Streams/Compression.cpp b/Minecraft.World/Source Files/compression.cpp similarity index 99% rename from Minecraft.World/IO/Streams/Compression.cpp rename to Minecraft.World/Source Files/compression.cpp index 91c840fa3..0237fe7de 100644 --- a/Minecraft.World/IO/Streams/Compression.cpp +++ b/Minecraft.World/Source Files/compression.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "Compression.h" +#include "../Header Files/stdafx.h" +#include "../Header Files/compression.h" #if defined(_WIN64) || defined(__linux__) // zconf.h defines "typedef unsigned char Byte" which conflicts with the // project's "class Byte" from BasicTypeContainers.h (via stdafx.h). diff --git a/Minecraft.World/Platform/stdafx.cpp b/Minecraft.World/Source Files/stdafx.cpp similarity index 88% rename from Minecraft.World/Platform/stdafx.cpp rename to Minecraft.World/Source Files/stdafx.cpp index 8e08093d4..0979d0e47 100644 --- a/Minecraft.World/Platform/stdafx.cpp +++ b/Minecraft.World/Source Files/stdafx.cpp @@ -2,7 +2,7 @@ // Minecraft.World.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information -#include "stdafx.h" +#include "../Header Files/stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file diff --git a/Minecraft.World/IO/NBT/ByteArrayTag.h b/Minecraft.World/com/mojang/nbt/ByteArrayTag.h similarity index 97% rename from Minecraft.World/IO/NBT/ByteArrayTag.h rename to Minecraft.World/com/mojang/nbt/ByteArrayTag.h index 63170e585..35bb29314 100644 --- a/Minecraft.World/IO/NBT/ByteArrayTag.h +++ b/Minecraft.World/com/mojang/nbt/ByteArrayTag.h @@ -1,6 +1,6 @@ #pragma once #include "Tag.h" -#include "../../Platform/System.h" +#include "../../../ConsoleJavaLibs/System.h" class ByteArrayTag : public Tag { public: diff --git a/Minecraft.World/IO/NBT/ByteTag.h b/Minecraft.World/com/mojang/nbt/ByteTag.h similarity index 100% rename from Minecraft.World/IO/NBT/ByteTag.h rename to Minecraft.World/com/mojang/nbt/ByteTag.h diff --git a/Minecraft.World/IO/NBT/CompoundTag.h b/Minecraft.World/com/mojang/nbt/CompoundTag.h similarity index 100% rename from Minecraft.World/IO/NBT/CompoundTag.h rename to Minecraft.World/com/mojang/nbt/CompoundTag.h diff --git a/Minecraft.World/IO/NBT/DoubleTag.h b/Minecraft.World/com/mojang/nbt/DoubleTag.h similarity index 91% rename from Minecraft.World/IO/NBT/DoubleTag.h rename to Minecraft.World/com/mojang/nbt/DoubleTag.h index 319c9bb33..7999b7b57 100644 --- a/Minecraft.World/IO/NBT/DoubleTag.h +++ b/Minecraft.World/com/mojang/nbt/DoubleTag.h @@ -1,5 +1,5 @@ #pragma once -#include "../Streams/InputOutputStream.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "Tag.h" class DoubleTag : public Tag { diff --git a/Minecraft.World/IO/NBT/EndTag.h b/Minecraft.World/com/mojang/nbt/EndTag.h similarity index 100% rename from Minecraft.World/IO/NBT/EndTag.h rename to Minecraft.World/com/mojang/nbt/EndTag.h diff --git a/Minecraft.World/IO/NBT/FloatTag.h b/Minecraft.World/com/mojang/nbt/FloatTag.h similarity index 91% rename from Minecraft.World/IO/NBT/FloatTag.h rename to Minecraft.World/com/mojang/nbt/FloatTag.h index 7651d761c..d9b2cb24e 100644 --- a/Minecraft.World/IO/NBT/FloatTag.h +++ b/Minecraft.World/com/mojang/nbt/FloatTag.h @@ -1,5 +1,5 @@ #pragma once -#include "../Streams/InputOutputStream.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "Tag.h" class FloatTag : public Tag { diff --git a/Minecraft.World/IO/NBT/IntArrayTag.h b/Minecraft.World/com/mojang/nbt/IntArrayTag.h similarity index 97% rename from Minecraft.World/IO/NBT/IntArrayTag.h rename to Minecraft.World/com/mojang/nbt/IntArrayTag.h index 626d042d7..40420b3e2 100644 --- a/Minecraft.World/IO/NBT/IntArrayTag.h +++ b/Minecraft.World/com/mojang/nbt/IntArrayTag.h @@ -1,7 +1,7 @@ #pragma once #include "Tag.h" -#include "../../Platform/System.h" +#include "../../../ConsoleJavaLibs/System.h" class IntArrayTag : public Tag { public: diff --git a/Minecraft.World/IO/NBT/IntTag.h b/Minecraft.World/com/mojang/nbt/IntTag.h similarity index 100% rename from Minecraft.World/IO/NBT/IntTag.h rename to Minecraft.World/com/mojang/nbt/IntTag.h diff --git a/Minecraft.World/IO/NBT/ListTag.h b/Minecraft.World/com/mojang/nbt/ListTag.h similarity index 100% rename from Minecraft.World/IO/NBT/ListTag.h rename to Minecraft.World/com/mojang/nbt/ListTag.h diff --git a/Minecraft.World/IO/NBT/LongTag.h b/Minecraft.World/com/mojang/nbt/LongTag.h similarity index 100% rename from Minecraft.World/IO/NBT/LongTag.h rename to Minecraft.World/com/mojang/nbt/LongTag.h diff --git a/Minecraft.World/IO/NBT/NbtIO.cpp b/Minecraft.World/com/mojang/nbt/NbtIo.cpp similarity index 93% rename from Minecraft.World/IO/NBT/NbtIO.cpp rename to Minecraft.World/com/mojang/nbt/NbtIo.cpp index f6c39040c..eda1841ec 100644 --- a/Minecraft.World/IO/NBT/NbtIO.cpp +++ b/Minecraft.World/com/mojang/nbt/NbtIo.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../Streams/InputOutputStream.h" -#include "NbtIO.h" +#include "../../../Header Files/stdafx.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "NbtIo.h" CompoundTag* NbtIo::readCompressed(InputStream* in) { MemSect(26); diff --git a/Minecraft.World/IO/NBT/NbtIO.h b/Minecraft.World/com/mojang/nbt/NbtIo.h similarity index 100% rename from Minecraft.World/IO/NBT/NbtIO.h rename to Minecraft.World/com/mojang/nbt/NbtIo.h diff --git a/Minecraft.World/IO/NBT/ShortTag.h b/Minecraft.World/com/mojang/nbt/ShortTag.h similarity index 100% rename from Minecraft.World/IO/NBT/ShortTag.h rename to Minecraft.World/com/mojang/nbt/ShortTag.h diff --git a/Minecraft.World/IO/NBT/StringTag.h b/Minecraft.World/com/mojang/nbt/StringTag.h similarity index 100% rename from Minecraft.World/IO/NBT/StringTag.h rename to Minecraft.World/com/mojang/nbt/StringTag.h diff --git a/Minecraft.World/IO/NBT/Tag.cpp b/Minecraft.World/com/mojang/nbt/Tag.cpp similarity index 98% rename from Minecraft.World/IO/NBT/Tag.cpp rename to Minecraft.World/com/mojang/nbt/Tag.cpp index 14115ae3a..8d7f89bce 100644 --- a/Minecraft.World/IO/NBT/Tag.cpp +++ b/Minecraft.World/com/mojang/nbt/Tag.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "Tag.h" #include "EndTag.h" #include "ByteTag.h" diff --git a/Minecraft.World/IO/NBT/Tag.h b/Minecraft.World/com/mojang/nbt/Tag.h similarity index 95% rename from Minecraft.World/IO/NBT/Tag.h rename to Minecraft.World/com/mojang/nbt/Tag.h index a4c8ea07d..3c32df1c1 100644 --- a/Minecraft.World/IO/NBT/Tag.h +++ b/Minecraft.World/com/mojang/nbt/Tag.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../Streams/InputOutputStream.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" class Tag { public: diff --git a/Minecraft.World/com/mojang/nbt/com.mojang.nbt.h b/Minecraft.World/com/mojang/nbt/com.mojang.nbt.h new file mode 100644 index 000000000..7edae5e04 --- /dev/null +++ b/Minecraft.World/com/mojang/nbt/com.mojang.nbt.h @@ -0,0 +1,2 @@ +#pragma once +#include "NbtIo.h" \ No newline at end of file diff --git a/Minecraft.World/Util/Direction.cpp b/Minecraft.World/net/minecraft/Direction.cpp similarity index 97% rename from Minecraft.World/Util/Direction.cpp rename to Minecraft.World/net/minecraft/Direction.cpp index bac1a79af..ca3ece296 100644 --- a/Minecraft.World/Util/Direction.cpp +++ b/Minecraft.World/net/minecraft/Direction.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "Direction.h" #include "Facing.h" diff --git a/Minecraft.World/Util/Direction.h b/Minecraft.World/net/minecraft/Direction.h similarity index 100% rename from Minecraft.World/Util/Direction.h rename to Minecraft.World/net/minecraft/Direction.h diff --git a/Minecraft.World/Util/Facing.cpp b/Minecraft.World/net/minecraft/Facing.cpp similarity index 90% rename from Minecraft.World/Util/Facing.cpp rename to Minecraft.World/net/minecraft/Facing.cpp index 4476da038..d5b9f9fc4 100644 --- a/Minecraft.World/Util/Facing.cpp +++ b/Minecraft.World/net/minecraft/Facing.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "Facing.h" const int Facing::OPPOSITE_FACING[6] = {UP, DOWN, SOUTH, NORTH, EAST, WEST}; diff --git a/Minecraft.World/Util/Facing.h b/Minecraft.World/net/minecraft/Facing.h similarity index 100% rename from Minecraft.World/Util/Facing.h rename to Minecraft.World/net/minecraft/Facing.h diff --git a/Minecraft.World/Util/Pos.cpp b/Minecraft.World/net/minecraft/Pos.cpp similarity index 98% rename from Minecraft.World/Util/Pos.cpp rename to Minecraft.World/net/minecraft/Pos.cpp index 194765f4a..181523e6d 100644 --- a/Minecraft.World/Util/Pos.cpp +++ b/Minecraft.World/net/minecraft/Pos.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../Header Files/stdafx.h" #include "Pos.h" diff --git a/Minecraft.World/Util/Pos.h b/Minecraft.World/net/minecraft/Pos.h similarity index 100% rename from Minecraft.World/Util/Pos.h rename to Minecraft.World/net/minecraft/Pos.h diff --git a/Minecraft.World/Util/SharedConstants.cpp b/Minecraft.World/net/minecraft/SharedConstants.cpp similarity index 88% rename from Minecraft.World/Util/SharedConstants.cpp rename to Minecraft.World/net/minecraft/SharedConstants.cpp index 77077c19e..73f3afdbb 100644 --- a/Minecraft.World/Util/SharedConstants.cpp +++ b/Minecraft.World/net/minecraft/SharedConstants.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../IO/Files/File.h" -#include "../IO/Streams/InputOutputStream.h" +#include "../../Header Files/stdafx.h" +#include "../../ConsoleJavaLibs/File.h" +#include "../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "SharedConstants.h" const std::wstring SharedConstants::VERSION_STRING = L"1.6.4"; diff --git a/Minecraft.World/Util/SharedConstants.h b/Minecraft.World/net/minecraft/SharedConstants.h similarity index 95% rename from Minecraft.World/Util/SharedConstants.h rename to Minecraft.World/net/minecraft/SharedConstants.h index 94c0e1dc4..45466b8e6 100644 --- a/Minecraft.World/Util/SharedConstants.h +++ b/Minecraft.World/net/minecraft/SharedConstants.h @@ -1,6 +1,6 @@ #pragma once -#include "Class.h" +#include "../../ConsoleJavaLibs/Class.h" class SharedConstants { public: diff --git a/Minecraft.World/Commands/AdminLogCommand.h b/Minecraft.World/net/minecraft/commands/AdminLogCommand.h similarity index 90% rename from Minecraft.World/Commands/AdminLogCommand.h rename to Minecraft.World/net/minecraft/commands/AdminLogCommand.h index 6b1d0e177..eff1abaf2 100644 --- a/Minecraft.World/Commands/AdminLogCommand.h +++ b/Minecraft.World/net/minecraft/commands/AdminLogCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "../Network/Packets/ChatPacket.h" +#include "../network/packet/ChatPacket.h" class CommandSender; diff --git a/Minecraft.World/Commands/Command.cpp b/Minecraft.World/net/minecraft/commands/Command.cpp similarity index 83% rename from Minecraft.World/Commands/Command.cpp rename to Minecraft.World/net/minecraft/commands/Command.cpp index 443678861..e13a26443 100644 --- a/Minecraft.World/Commands/Command.cpp +++ b/Minecraft.World/net/minecraft/commands/Command.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Network/PlayerList.h" -#include "../../Minecraft.Client/Player/ServerPlayer.h" +#include "../../../Header Files/stdafx.h" +#include "net.minecraft.commands.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/server/PlayerList.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" #include "Command.h" AdminLogCommand* Command::logger; diff --git a/Minecraft.World/Commands/Command.h b/Minecraft.World/net/minecraft/commands/Command.h similarity index 97% rename from Minecraft.World/Commands/Command.h rename to Minecraft.World/net/minecraft/commands/Command.h index 6a8fb5220..50d624d46 100644 --- a/Minecraft.World/Commands/Command.h +++ b/Minecraft.World/net/minecraft/commands/Command.h @@ -3,7 +3,7 @@ // 4J Stu - Based loosely on the Java versions #include "CommandsEnum.h" -#include "../Network/Packets/ChatPacket.h" +#include "../network/packet/ChatPacket.h" class AdminLogCommand; class CommandSender; diff --git a/Minecraft.World/Commands/CommandDispatcher.cpp b/Minecraft.World/net/minecraft/commands/CommandDispatcher.cpp similarity index 91% rename from Minecraft.World/Commands/CommandDispatcher.cpp rename to Minecraft.World/net/minecraft/commands/CommandDispatcher.cpp index 4c6f0b4cd..a1ce0c9db 100644 --- a/Minecraft.World/Commands/CommandDispatcher.cpp +++ b/Minecraft.World/net/minecraft/commands/CommandDispatcher.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" +#include "../../../Header Files/stdafx.h" +#include "net.minecraft.commands.h" #include "CommandDispatcher.h" int CommandDispatcher::performCommand(std::shared_ptr sender, diff --git a/Minecraft.World/Commands/CommandDispatcher.h b/Minecraft.World/net/minecraft/commands/CommandDispatcher.h similarity index 100% rename from Minecraft.World/Commands/CommandDispatcher.h rename to Minecraft.World/net/minecraft/commands/CommandDispatcher.h diff --git a/Minecraft.World/Commands/CommandSender.h b/Minecraft.World/net/minecraft/commands/CommandSender.h similarity index 89% rename from Minecraft.World/Commands/CommandSender.h rename to Minecraft.World/net/minecraft/commands/CommandSender.h index e2271d21d..287f4fe8a 100644 --- a/Minecraft.World/Commands/CommandSender.h +++ b/Minecraft.World/net/minecraft/commands/CommandSender.h @@ -1,7 +1,7 @@ #pragma once #include "CommandsEnum.h" -#include "../Network/Packets/ChatPacket.h" +#include "../network/packet/ChatPacket.h" class CommandSender { public: diff --git a/Minecraft.World/Commands/CommandsEnum.h b/Minecraft.World/net/minecraft/commands/CommandsEnum.h similarity index 100% rename from Minecraft.World/Commands/CommandsEnum.h rename to Minecraft.World/net/minecraft/commands/CommandsEnum.h diff --git a/Minecraft.World/Commands/PlayerSelector.h b/Minecraft.World/net/minecraft/commands/PlayerSelector.h similarity index 100% rename from Minecraft.World/Commands/PlayerSelector.h rename to Minecraft.World/net/minecraft/commands/PlayerSelector.h diff --git a/Minecraft.World/Commands/DefaultGameModeCommand.cpp b/Minecraft.World/net/minecraft/commands/common/DefaultGameModeCommand.cpp similarity index 93% rename from Minecraft.World/Commands/DefaultGameModeCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/DefaultGameModeCommand.cpp index b40001083..f5b293447 100644 --- a/Minecraft.World/Commands/DefaultGameModeCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/DefaultGameModeCommand.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.commands.h" #include "DefaultGameModeCommand.h" EGameCommand DefaultGameModeCommand::getId() { diff --git a/Minecraft.World/Commands/DefaultGameModeCommand.h b/Minecraft.World/net/minecraft/commands/common/DefaultGameModeCommand.h similarity index 100% rename from Minecraft.World/Commands/DefaultGameModeCommand.h rename to Minecraft.World/net/minecraft/commands/common/DefaultGameModeCommand.h diff --git a/Minecraft.World/Commands/EffectCommand.cpp b/Minecraft.World/net/minecraft/commands/common/EffectCommand.cpp similarity index 94% rename from Minecraft.World/Commands/EffectCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/EffectCommand.cpp index 890e03d66..4911ec346 100644 --- a/Minecraft.World/Commands/EffectCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/EffectCommand.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.common.h" -#include "../../Minecraft.Client/MinecraftServer.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.commands.common.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" EGameCommand EffectCommand::getId() { return eGameCommand_Effect; } diff --git a/Minecraft.World/Commands/EffectCommand.h b/Minecraft.World/net/minecraft/commands/common/EffectCommand.h similarity index 94% rename from Minecraft.World/Commands/EffectCommand.h rename to Minecraft.World/net/minecraft/commands/common/EffectCommand.h index 71842af45..436a9084f 100644 --- a/Minecraft.World/Commands/EffectCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/EffectCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class EffectCommand : public Command { public: diff --git a/Minecraft.World/Commands/EnchantItemCommand.cpp b/Minecraft.World/net/minecraft/commands/common/EnchantItemCommand.cpp similarity index 89% rename from Minecraft.World/Commands/EnchantItemCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/EnchantItemCommand.cpp index 13e1df281..6f9f24d86 100644 --- a/Minecraft.World/Commands/EnchantItemCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/EnchantItemCommand.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../../Minecraft.Client/Player/ServerPlayer.h" +#include "../../../../Header Files/stdafx.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../../world/item/net.minecraft.world.item.h" +#include "../../world/item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" #include "EnchantItemCommand.h" EGameCommand EnchantItemCommand::getId() { return eGameCommand_EnchantItem; } diff --git a/Minecraft.World/Commands/EnchantItemCommand.h b/Minecraft.World/net/minecraft/commands/common/EnchantItemCommand.h similarity index 94% rename from Minecraft.World/Commands/EnchantItemCommand.h rename to Minecraft.World/net/minecraft/commands/common/EnchantItemCommand.h index 87f186484..77f914683 100644 --- a/Minecraft.World/Commands/EnchantItemCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/EnchantItemCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class GameCommandPacket; diff --git a/Minecraft.World/Commands/ExperienceCommand.cpp b/Minecraft.World/net/minecraft/commands/common/ExperienceCommand.cpp similarity index 85% rename from Minecraft.World/Commands/ExperienceCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/ExperienceCommand.cpp index 025bcf356..e724a80ab 100644 --- a/Minecraft.World/Commands/ExperienceCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/ExperienceCommand.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Network/PlayerList.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.commands.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/server/PlayerList.h" +#include "../../world/level/net.minecraft.world.level.h" #include "ExperienceCommand.h" EGameCommand ExperienceCommand::getId() { return eGameCommand_Experience; } diff --git a/Minecraft.World/Commands/ExperienceCommand.h b/Minecraft.World/net/minecraft/commands/common/ExperienceCommand.h similarity index 91% rename from Minecraft.World/Commands/ExperienceCommand.h rename to Minecraft.World/net/minecraft/commands/common/ExperienceCommand.h index 4f41f03b1..54dbe732c 100644 --- a/Minecraft.World/Commands/ExperienceCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/ExperienceCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class CommandSender; diff --git a/Minecraft.World/Commands/GameDifficultyCommand.h b/Minecraft.World/net/minecraft/commands/common/GameDifficultyCommand.h similarity index 100% rename from Minecraft.World/Commands/GameDifficultyCommand.h rename to Minecraft.World/net/minecraft/commands/common/GameDifficultyCommand.h diff --git a/Minecraft.World/Commands/GameModeCommand.cpp b/Minecraft.World/net/minecraft/commands/common/GameModeCommand.cpp similarity index 95% rename from Minecraft.World/Commands/GameModeCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/GameModeCommand.cpp index 06a5fdb34..507973245 100644 --- a/Minecraft.World/Commands/GameModeCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/GameModeCommand.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.commands.h" #include "GameModeCommand.h" EGameCommand GameModeCommand::getId() { return eGameCommand_GameMode; } diff --git a/Minecraft.World/Commands/GameModeCommand.h b/Minecraft.World/net/minecraft/commands/common/GameModeCommand.h similarity index 94% rename from Minecraft.World/Commands/GameModeCommand.h rename to Minecraft.World/net/minecraft/commands/common/GameModeCommand.h index 514cf1969..87f9c1eec 100644 --- a/Minecraft.World/Commands/GameModeCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/GameModeCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class GameType; diff --git a/Minecraft.World/Commands/GameRuleCommand.h b/Minecraft.World/net/minecraft/commands/common/GameRuleCommand.h similarity index 100% rename from Minecraft.World/Commands/GameRuleCommand.h rename to Minecraft.World/net/minecraft/commands/common/GameRuleCommand.h diff --git a/Minecraft.World/Commands/GiveItemCommand.cpp b/Minecraft.World/net/minecraft/commands/common/GiveItemCommand.cpp similarity index 83% rename from Minecraft.World/Commands/GiveItemCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/GiveItemCommand.cpp index 2ab658c7c..b0ba0808c 100644 --- a/Minecraft.World/Commands/GiveItemCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/GiveItemCommand.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../../Minecraft.Client/Player/ServerPlayer.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.commands.h" +#include "../../world/entity/item/net.minecraft.world.entity.item.h" +#include "../../world/item/net.minecraft.world.item.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" #include "GiveItemCommand.h" EGameCommand GiveItemCommand::getId() { return eGameCommand_Give; } diff --git a/Minecraft.World/Commands/GiveItemCommand.h b/Minecraft.World/net/minecraft/commands/common/GiveItemCommand.h similarity index 95% rename from Minecraft.World/Commands/GiveItemCommand.h rename to Minecraft.World/net/minecraft/commands/common/GiveItemCommand.h index 9bf214056..3df5ac671 100644 --- a/Minecraft.World/Commands/GiveItemCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/GiveItemCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class GameCommandPacket; diff --git a/Minecraft.World/Commands/KillCommand.cpp b/Minecraft.World/net/minecraft/commands/common/KillCommand.cpp similarity index 72% rename from Minecraft.World/Commands/KillCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/KillCommand.cpp index fef099420..732313952 100644 --- a/Minecraft.World/Commands/KillCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/KillCommand.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.damagesource.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.commands.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" +#include "../../world/damageSource/net.minecraft.world.damagesource.h" #include "KillCommand.h" #include diff --git a/Minecraft.World/Commands/KillCommand.h b/Minecraft.World/net/minecraft/commands/common/KillCommand.h similarity index 91% rename from Minecraft.World/Commands/KillCommand.h rename to Minecraft.World/net/minecraft/commands/common/KillCommand.h index a69b23b66..43a7c40ee 100644 --- a/Minecraft.World/Commands/KillCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/KillCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class KillCommand : public Command { public: diff --git a/Minecraft.World/Commands/PlaySoundCommand.h b/Minecraft.World/net/minecraft/commands/common/PlaySoundCommand.h similarity index 100% rename from Minecraft.World/Commands/PlaySoundCommand.h rename to Minecraft.World/net/minecraft/commands/common/PlaySoundCommand.h diff --git a/Minecraft.World/Commands/SetPlayerTimeoutCommand.h b/Minecraft.World/net/minecraft/commands/common/SetPlayerTimeoutCommand.h similarity index 100% rename from Minecraft.World/Commands/SetPlayerTimeoutCommand.h rename to Minecraft.World/net/minecraft/commands/common/SetPlayerTimeoutCommand.h diff --git a/Minecraft.World/Commands/ShowSeedCommand.h b/Minecraft.World/net/minecraft/commands/common/ShowSeedCommand.h similarity index 100% rename from Minecraft.World/Commands/ShowSeedCommand.h rename to Minecraft.World/net/minecraft/commands/common/ShowSeedCommand.h diff --git a/Minecraft.World/Commands/SpreadPlayersCommand.h b/Minecraft.World/net/minecraft/commands/common/SpreadPlayersCommand.h similarity index 100% rename from Minecraft.World/Commands/SpreadPlayersCommand.h rename to Minecraft.World/net/minecraft/commands/common/SpreadPlayersCommand.h diff --git a/Minecraft.World/Commands/TimeCommand.cpp b/Minecraft.World/net/minecraft/commands/common/TimeCommand.cpp similarity index 87% rename from Minecraft.World/Commands/TimeCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/TimeCommand.cpp index 051bc2862..fdb2f0ef5 100644 --- a/Minecraft.World/Commands/TimeCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/TimeCommand.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.commands.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.commands.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../network/packet/net.minecraft.network.packet.h" #include "TimeCommand.h" EGameCommand TimeCommand::getId() { return eGameCommand_Time; } diff --git a/Minecraft.World/Commands/TimeCommand.h b/Minecraft.World/net/minecraft/commands/common/TimeCommand.h similarity index 95% rename from Minecraft.World/Commands/TimeCommand.h rename to Minecraft.World/net/minecraft/commands/common/TimeCommand.h index 2b38a4b9b..18db1ca21 100644 --- a/Minecraft.World/Commands/TimeCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/TimeCommand.h @@ -1,6 +1,6 @@ #pragma once -#include "Command.h" +#include "../Command.h" class TimeCommand : public Command { public: diff --git a/Minecraft.World/Commands/ToggleDownfallCommand.cpp b/Minecraft.World/net/minecraft/commands/common/ToggleDownfallCommand.cpp similarity index 67% rename from Minecraft.World/Commands/ToggleDownfallCommand.cpp rename to Minecraft.World/net/minecraft/commands/common/ToggleDownfallCommand.cpp index fa760f539..d9d5a92f6 100644 --- a/Minecraft.World/Commands/ToggleDownfallCommand.cpp +++ b/Minecraft.World/net/minecraft/commands/common/ToggleDownfallCommand.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" -#include "../Headers/net.minecraft.commands.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.storage.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../net.minecraft.commands.h" +#include "../../world/level/net.minecraft.world.level.h" +#include "../../world/level/storage/net.minecraft.world.level.storage.h" +#include "../../network/packet/net.minecraft.network.packet.h" #include "ToggleDownfallCommand.h" EGameCommand ToggleDownfallCommand::getId() { diff --git a/Minecraft.World/Commands/ToggleDownfallCommand.h b/Minecraft.World/net/minecraft/commands/common/ToggleDownfallCommand.h similarity index 94% rename from Minecraft.World/Commands/ToggleDownfallCommand.h rename to Minecraft.World/net/minecraft/commands/common/ToggleDownfallCommand.h index 1b9000b4d..944fcc969 100644 --- a/Minecraft.World/Commands/ToggleDownfallCommand.h +++ b/Minecraft.World/net/minecraft/commands/common/ToggleDownfallCommand.h @@ -1,5 +1,5 @@ #pragma once -#include "Command.h" +#include "../Command.h" class GameCommandPacket; diff --git a/Minecraft.World/Commands/WeatherCommand.h b/Minecraft.World/net/minecraft/commands/common/WeatherCommand.h similarity index 100% rename from Minecraft.World/Commands/WeatherCommand.h rename to Minecraft.World/net/minecraft/commands/common/WeatherCommand.h diff --git a/Minecraft.World/net/minecraft/commands/common/net.minecraft.commands.common.h b/Minecraft.World/net/minecraft/commands/common/net.minecraft.commands.common.h new file mode 100644 index 000000000..83b0dca5c --- /dev/null +++ b/Minecraft.World/net/minecraft/commands/common/net.minecraft.commands.common.h @@ -0,0 +1,11 @@ +#pragma once + +#include "DefaultGameModeCommand.h" +#include "EffectCommand.h" +#include "EnchantItemCommand.h" +#include "ExperienceCommand.h" +#include "GameModeCommand.h" +#include "GiveItemCommand.h" +#include "KillCommand.h" +#include "TimeCommand.h" +#include "ToggleDownfallCommand.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/commands/net.minecraft.commands.h b/Minecraft.World/net/minecraft/commands/net.minecraft.commands.h new file mode 100644 index 000000000..616b2e076 --- /dev/null +++ b/Minecraft.World/net/minecraft/commands/net.minecraft.commands.h @@ -0,0 +1,7 @@ +#pragma once + +#include "AdminLogCommand.h" +#include "CommandsEnum.h" +#include "Command.h" +#include "CommandDispatcher.h" +#include "CommandSender.h" \ No newline at end of file diff --git a/Minecraft.World/Core/AbstractProjectileDispenseBehavior.cpp b/Minecraft.World/net/minecraft/core/AbstractProjectileDispenseBehavior.cpp similarity index 85% rename from Minecraft.World/Core/AbstractProjectileDispenseBehavior.cpp rename to Minecraft.World/net/minecraft/core/AbstractProjectileDispenseBehavior.cpp index d81edbc7e..7e318e01c 100644 --- a/Minecraft.World/Core/AbstractProjectileDispenseBehavior.cpp +++ b/Minecraft.World/net/minecraft/core/AbstractProjectileDispenseBehavior.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "AbstractProjectileDispenseBehavior.h" -#include "../Blocks/DispenserTile.h" -#include "../Entities/Projectile.h" -#include "../Level/Level.h" -#include "../Level/Events/LevelEvent.h" -#include "../Items/ItemInstance.h" +#include "../world/level/tile/DispenserTile.h" +#include "../world/entity/projectile/Projectile.h" +#include "../world/level/Level.h" +#include "../world/level/tile/LevelEvent.h" +#include "../world/item/ItemInstance.h" std::shared_ptr AbstractProjectileDispenseBehavior::execute( BlockSource* source, std::shared_ptr dispensed, diff --git a/Minecraft.World/Core/AbstractProjectileDispenseBehavior.h b/Minecraft.World/net/minecraft/core/AbstractProjectileDispenseBehavior.h similarity index 100% rename from Minecraft.World/Core/AbstractProjectileDispenseBehavior.h rename to Minecraft.World/net/minecraft/core/AbstractProjectileDispenseBehavior.h diff --git a/Minecraft.World/Core/Behavior.h b/Minecraft.World/net/minecraft/core/Behavior.h similarity index 100% rename from Minecraft.World/Core/Behavior.h rename to Minecraft.World/net/minecraft/core/Behavior.h diff --git a/Minecraft.World/Core/BehaviorRegistry.cpp b/Minecraft.World/net/minecraft/core/BehaviorRegistry.cpp similarity index 93% rename from Minecraft.World/Core/BehaviorRegistry.cpp rename to Minecraft.World/net/minecraft/core/BehaviorRegistry.cpp index 0b9e965ab..ab046e54e 100644 --- a/Minecraft.World/Core/BehaviorRegistry.cpp +++ b/Minecraft.World/net/minecraft/core/BehaviorRegistry.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "BehaviorRegistry.h" diff --git a/Minecraft.World/Core/BehaviorRegistry.h b/Minecraft.World/net/minecraft/core/BehaviorRegistry.h similarity index 100% rename from Minecraft.World/Core/BehaviorRegistry.h rename to Minecraft.World/net/minecraft/core/BehaviorRegistry.h diff --git a/Minecraft.World/Core/BlockSource.h b/Minecraft.World/net/minecraft/core/BlockSource.h similarity index 100% rename from Minecraft.World/Core/BlockSource.h rename to Minecraft.World/net/minecraft/core/BlockSource.h diff --git a/Minecraft.World/Core/BlockSourceImpl.cpp b/Minecraft.World/net/minecraft/core/BlockSourceImpl.cpp similarity index 78% rename from Minecraft.World/Core/BlockSourceImpl.cpp rename to Minecraft.World/net/minecraft/core/BlockSourceImpl.cpp index 65ff22f95..5ff0692b7 100644 --- a/Minecraft.World/Core/BlockSourceImpl.cpp +++ b/Minecraft.World/net/minecraft/core/BlockSourceImpl.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "BlockSourceImpl.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../world/level/net.minecraft.world.level.h" +#include "../world/level/tile/net.minecraft.world.level.tile.h" +#include "../world/level/tile/entity/net.minecraft.world.level.tile.entity.h" BlockSourceImpl::BlockSourceImpl(Level* world, int x, int y, int z) { this->world = world; diff --git a/Minecraft.World/Core/BlockSourceImpl.h b/Minecraft.World/net/minecraft/core/BlockSourceImpl.h similarity index 100% rename from Minecraft.World/Core/BlockSourceImpl.h rename to Minecraft.World/net/minecraft/core/BlockSourceImpl.h diff --git a/Minecraft.World/Core/DefaultDispenseItemBehavior.cpp b/Minecraft.World/net/minecraft/core/DefaultDispenseItemBehavior.cpp similarity index 91% rename from Minecraft.World/Core/DefaultDispenseItemBehavior.cpp rename to Minecraft.World/net/minecraft/core/DefaultDispenseItemBehavior.cpp index a01ce291e..6ed45fd23 100644 --- a/Minecraft.World/Core/DefaultDispenseItemBehavior.cpp +++ b/Minecraft.World/net/minecraft/core/DefaultDispenseItemBehavior.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.core.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" +#include "../../../Header Files/stdafx.h" +#include "../net.minecraft.h" +#include "net.minecraft.core.h" +#include "../world/level/tile/net.minecraft.world.level.tile.h" +#include "../world/level/net.minecraft.world.level.h" +#include "../world/entity/item/net.minecraft.world.entity.item.h" #include "DefaultDispenseItemBehavior.h" std::shared_ptr DefaultDispenseItemBehavior::dispense( diff --git a/Minecraft.World/Core/DefaultDispenseItemBehavior.h b/Minecraft.World/net/minecraft/core/DefaultDispenseItemBehavior.h similarity index 100% rename from Minecraft.World/Core/DefaultDispenseItemBehavior.h rename to Minecraft.World/net/minecraft/core/DefaultDispenseItemBehavior.h diff --git a/Minecraft.World/Core/DispenseItemBehavior.cpp b/Minecraft.World/net/minecraft/core/DispenseItemBehavior.cpp similarity index 86% rename from Minecraft.World/Core/DispenseItemBehavior.cpp rename to Minecraft.World/net/minecraft/core/DispenseItemBehavior.cpp index a8946af17..fb83cde07 100644 --- a/Minecraft.World/Core/DispenseItemBehavior.cpp +++ b/Minecraft.World/net/minecraft/core/DispenseItemBehavior.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "DispenseItemBehavior.h" diff --git a/Minecraft.World/Core/DispenseItemBehavior.h b/Minecraft.World/net/minecraft/core/DispenseItemBehavior.h similarity index 100% rename from Minecraft.World/Core/DispenseItemBehavior.h rename to Minecraft.World/net/minecraft/core/DispenseItemBehavior.h diff --git a/Minecraft.World/Core/FacingEnum.cpp b/Minecraft.World/net/minecraft/core/FacingEnum.cpp similarity index 96% rename from Minecraft.World/Core/FacingEnum.cpp rename to Minecraft.World/net/minecraft/core/FacingEnum.cpp index 0f8c58f4e..dde690db3 100644 --- a/Minecraft.World/Core/FacingEnum.cpp +++ b/Minecraft.World/net/minecraft/core/FacingEnum.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "FacingEnum.h" diff --git a/Minecraft.World/Core/FacingEnum.h b/Minecraft.World/net/minecraft/core/FacingEnum.h similarity index 100% rename from Minecraft.World/Core/FacingEnum.h rename to Minecraft.World/net/minecraft/core/FacingEnum.h diff --git a/Minecraft.World/Core/ItemDispenseBehaviors.cpp b/Minecraft.World/net/minecraft/core/ItemDispenseBehaviors.cpp similarity index 97% rename from Minecraft.World/Core/ItemDispenseBehaviors.cpp rename to Minecraft.World/net/minecraft/core/ItemDispenseBehaviors.cpp index b15a58c9e..6e51efc51 100644 --- a/Minecraft.World/Core/ItemDispenseBehaviors.cpp +++ b/Minecraft.World/net/minecraft/core/ItemDispenseBehaviors.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../Header Files/stdafx.h" +#include "../world/entity/item/net.minecraft.world.entity.item.h" +#include "../world/entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../world/level/net.minecraft.world.level.h" +#include "../world/level/tile/net.minecraft.world.level.tile.h" +#include "../world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../world/item/net.minecraft.world.item.h" #include "ItemDispenseBehaviors.h" /* Arrow */ diff --git a/Minecraft.World/Core/ItemDispenseBehaviors.h b/Minecraft.World/net/minecraft/core/ItemDispenseBehaviors.h similarity index 100% rename from Minecraft.World/Core/ItemDispenseBehaviors.h rename to Minecraft.World/net/minecraft/core/ItemDispenseBehaviors.h diff --git a/Minecraft.World/Core/LocatableSource.h b/Minecraft.World/net/minecraft/core/LocatableSource.h similarity index 100% rename from Minecraft.World/Core/LocatableSource.h rename to Minecraft.World/net/minecraft/core/LocatableSource.h diff --git a/Minecraft.World/Core/Location.h b/Minecraft.World/net/minecraft/core/Location.h similarity index 100% rename from Minecraft.World/Core/Location.h rename to Minecraft.World/net/minecraft/core/Location.h diff --git a/Minecraft.World/Core/Position.h b/Minecraft.World/net/minecraft/core/Position.h similarity index 100% rename from Minecraft.World/Core/Position.h rename to Minecraft.World/net/minecraft/core/Position.h diff --git a/Minecraft.World/Core/PositionImpl.h b/Minecraft.World/net/minecraft/core/PositionImpl.h similarity index 100% rename from Minecraft.World/Core/PositionImpl.h rename to Minecraft.World/net/minecraft/core/PositionImpl.h diff --git a/Minecraft.World/Core/Source.h b/Minecraft.World/net/minecraft/core/Source.h similarity index 100% rename from Minecraft.World/Core/Source.h rename to Minecraft.World/net/minecraft/core/Source.h diff --git a/Minecraft.World/net/minecraft/core/net.minecraft.core.h b/Minecraft.World/net/minecraft/core/net.minecraft.core.h new file mode 100644 index 000000000..d67789892 --- /dev/null +++ b/Minecraft.World/net/minecraft/core/net.minecraft.core.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Behavior.h" +#include "BlockSource.h" +#include "BlockSourceImpl.h" +#include "BehaviorRegistry.h" +#include "DispenseItemBehavior.h" +#include "DefaultDispenseItemBehavior.h" +#include "AbstractProjectileDispenseBehavior.h" +#include "ItemDispenseBehaviors.h" +#include "FacingEnum.h" +#include "LocatableSource.h" +#include "Location.h" +#include "Position.h" +#include "PositionImpl.h" +#include "Source.h" \ No newline at end of file diff --git a/Minecraft.World/Util/I18n.cpp b/Minecraft.World/net/minecraft/locale/I18n.cpp similarity index 89% rename from Minecraft.World/Util/I18n.cpp rename to Minecraft.World/net/minecraft/locale/I18n.cpp index 19b76ac1e..e8f6ff6a4 100644 --- a/Minecraft.World/Util/I18n.cpp +++ b/Minecraft.World/net/minecraft/locale/I18n.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "Language.h" #include "I18n.h" diff --git a/Minecraft.World/Util/I18n.h b/Minecraft.World/net/minecraft/locale/I18n.h similarity index 83% rename from Minecraft.World/Util/I18n.h rename to Minecraft.World/net/minecraft/locale/I18n.h index 2393606fa..f995b7be6 100644 --- a/Minecraft.World/Util/I18n.h +++ b/Minecraft.World/net/minecraft/locale/I18n.h @@ -1,6 +1,6 @@ #pragma once -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "Language.h" class I18n { diff --git a/Minecraft.World/Util/Language.cpp b/Minecraft.World/net/minecraft/locale/Language.cpp similarity index 96% rename from Minecraft.World/Util/Language.cpp rename to Minecraft.World/net/minecraft/locale/Language.cpp index 2ac4f068f..01ab5e0ca 100644 --- a/Minecraft.World/Util/Language.cpp +++ b/Minecraft.World/net/minecraft/locale/Language.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "Language.h" -#include "../IO/Files/File.h" -#include "../IO/Files/FileInputStream.h" +#include "../../../ConsoleJavaLibs/File.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/FileInputStream.h" // 4J - TODO - properly implement // 4jcraft: done! diff --git a/Minecraft.World/Util/Language.h b/Minecraft.World/net/minecraft/locale/Language.h similarity index 100% rename from Minecraft.World/Util/Language.h rename to Minecraft.World/net/minecraft/locale/Language.h diff --git a/Minecraft.World/net/minecraft/locale/net.minecraft.locale.h b/Minecraft.World/net/minecraft/locale/net.minecraft.locale.h new file mode 100644 index 000000000..b6ed8a10d --- /dev/null +++ b/Minecraft.World/net/minecraft/locale/net.minecraft.locale.h @@ -0,0 +1,4 @@ +#pragma once + +#include "Language.h" +#include "I18n.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/net.minecraft.h b/Minecraft.World/net/minecraft/net.minecraft.h new file mode 100644 index 000000000..203a8b938 --- /dev/null +++ b/Minecraft.World/net/minecraft/net.minecraft.h @@ -0,0 +1,6 @@ +#pragma once + +#include "Facing.h" +#include "Direction.h" +#include "Pos.h" +#include "SharedConstants.h" \ No newline at end of file diff --git a/Minecraft.World/Network/Connection.cpp b/Minecraft.World/net/minecraft/network/Connection.cpp similarity index 98% rename from Minecraft.World/Network/Connection.cpp rename to Minecraft.World/net/minecraft/network/Connection.cpp index 871560dc2..6a4ed8dbe 100644 --- a/Minecraft.World/Network/Connection.cpp +++ b/Minecraft.World/net/minecraft/network/Connection.cpp @@ -1,13 +1,13 @@ #include #include -#include "../Platform/stdafx.h" -#include "../IO/Streams/InputOutputStream.h" -#include "Socket.h" +#include "../../../Header Files/stdafx.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../ConsoleJavaLibs/Socket.h" #include "Connection.h" -#include "../Util/ThreadName.h" -#include "../IO/Streams/Compression.h" -#include "../../Minecraft.Client/Platform/Common/ShutdownManager.h" +#include "../../../ConsoleHelpers/ThreadName.h" +#include "../../../Header Files/compression.h" +#include "../../Minecraft.Client/Common/ShutdownManager.h" // This should always be enabled, except for debugging use #if !defined(_DEBUG) diff --git a/Minecraft.World/Network/Connection.h b/Minecraft.World/net/minecraft/network/Connection.h similarity index 90% rename from Minecraft.World/Network/Connection.h rename to Minecraft.World/net/minecraft/network/Connection.h index 7759e6c1f..c9e3ba5b3 100644 --- a/Minecraft.World/Network/Connection.h +++ b/Minecraft.World/net/minecraft/network/Connection.h @@ -1,16 +1,16 @@ #pragma once -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include -#include "../Platform/System.h" -#include "../IO/Streams/DataInputStream.h" -#include "../IO/Streams/DataOutputStream.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Util/C4JThread.h" +#include "../../../ConsoleJavaLibs/System.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/DataInputStream.h" +#include "../../../ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "packet/net.minecraft.network.packet.h" +#include "../../../ConsoleHelpers/C4JThread.h" #include -#include "Socket.h" +#include "../../../ConsoleJavaLibs/Socket.h" // 4J JEV, size of the threads (bytes). #define READ_STACK_SIZE 0 diff --git a/Minecraft.World/net/minecraft/network/net.minecraft.network.h b/Minecraft.World/net/minecraft/network/net.minecraft.network.h new file mode 100644 index 000000000..cbeae4751 --- /dev/null +++ b/Minecraft.World/net/minecraft/network/net.minecraft.network.h @@ -0,0 +1,3 @@ +#pragma once + +#include "Connection.h" \ No newline at end of file diff --git a/Minecraft.World/Network/Packets/AddEntityPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/AddEntityPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp index 848b2cbf4..703f5cb93 100644 --- a/Minecraft.World/Network/Packets/AddEntityPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AddEntityPacket.h" #include diff --git a/Minecraft.World/Network/Packets/AddEntityPacket.h b/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/AddEntityPacket.h rename to Minecraft.World/net/minecraft/network/packet/AddEntityPacket.h diff --git a/Minecraft.World/Network/Packets/AddExperienceOrbPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp similarity index 84% rename from Minecraft.World/Network/Packets/AddExperienceOrbPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp index e8394e6bb..b15353cca 100644 --- a/Minecraft.World/Network/Packets/AddExperienceOrbPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/entity/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "AddExperienceOrbPacket.h" diff --git a/Minecraft.World/Network/Packets/AddExperienceOrbPacket.h b/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/AddExperienceOrbPacket.h rename to Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.h diff --git a/Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp similarity index 82% rename from Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp index 724dbb1f9..00f8b4812 100644 --- a/Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.global.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" +#include "../../world/entity/global/net.minecraft.world.entity.global.h" #include "PacketListener.h" #include "AddGlobalEntityPacket.h" diff --git a/Minecraft.World/Network/Packets/AddGlobalEntityPacket.h b/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/AddGlobalEntityPacket.h rename to Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.h diff --git a/Minecraft.World/Network/Packets/AddMobPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/AddMobPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp index b6ce8b268..7a9d2c7a4 100644 --- a/Minecraft.World/Network/Packets/AddMobPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AddMobPacket.h" diff --git a/Minecraft.World/Network/Packets/AddMobPacket.h b/Minecraft.World/net/minecraft/network/packet/AddMobPacket.h similarity index 95% rename from Minecraft.World/Network/Packets/AddMobPacket.h rename to Minecraft.World/net/minecraft/network/packet/AddMobPacket.h index adde6dcde..dbe13d3f0 100644 --- a/Minecraft.World/Network/Packets/AddMobPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/AddMobPacket.h @@ -1,7 +1,7 @@ #pragma once #include "Packet.h" -#include "../../Entities/SyncedEntityData.h" +#include "../../world/entity/SyncedEntityData.h" class LivingEntity; diff --git a/Minecraft.World/Network/Packets/AddPaintingPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp similarity index 85% rename from Minecraft.World/Network/Packets/AddPaintingPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp index c85296cb3..e4adc4591 100644 --- a/Minecraft.World/Network/Packets/AddPaintingPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AddPaintingPacket.h" diff --git a/Minecraft.World/Network/Packets/AddPaintingPacket.h b/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/AddPaintingPacket.h rename to Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.h diff --git a/Minecraft.World/Network/Packets/AddPlayerPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/AddPlayerPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp index a10aabed6..adfc49029 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "AddPlayerPacket.h" diff --git a/Minecraft.World/Network/Packets/AddPlayerPacket.h b/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.h similarity index 96% rename from Minecraft.World/Network/Packets/AddPlayerPacket.h rename to Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.h index 9a1e1324e..0604ebf44 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.h @@ -3,7 +3,7 @@ #include #include "Packet.h" -#include "../../Entities/SyncedEntityData.h" +#include "../../world/entity/SyncedEntityData.h" class Player; diff --git a/Minecraft.World/Network/Packets/AnimatePacket.cpp b/Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp similarity index 79% rename from Minecraft.World/Network/Packets/AnimatePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp index 363c88aa0..a211f7611 100644 --- a/Minecraft.World/Network/Packets/AnimatePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AnimatePacket.h" diff --git a/Minecraft.World/Network/Packets/AnimatePacket.h b/Minecraft.World/net/minecraft/network/packet/AnimatePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/AnimatePacket.h rename to Minecraft.World/net/minecraft/network/packet/AnimatePacket.h diff --git a/Minecraft.World/Network/Packets/AwardStatPacket.cpp b/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/AwardStatPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp index c95f201cd..1a610bd01 100644 --- a/Minecraft.World/Network/Packets/AwardStatPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "AwardStatPacket.h" diff --git a/Minecraft.World/Network/Packets/AwardStatPacket.h b/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/AwardStatPacket.h rename to Minecraft.World/net/minecraft/network/packet/AwardStatPacket.h diff --git a/Minecraft.World/Network/Packets/BlockRegionUpdatePacket.cpp b/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/BlockRegionUpdatePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp index c6ca7f954..2d05a04c1 100644 --- a/Minecraft.World/Network/Packets/BlockRegionUpdatePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../IO/Streams/Compression.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/level/net.minecraft.world.level.h" +#include "../../../../Header Files/compression.h" #include "PacketListener.h" #include "BlockRegionUpdatePacket.h" -#include "../../Level/LevelChunk.h" -#include "../../Level/Storage/DataLayer.h" -#include "../../Level/Dimensions/Dimension.h" +#include "../../world/level/chunk/LevelChunk.h" +#include "../../world/level/chunk/DataLayer.h" +#include "../../world/level/dimension/Dimension.h" #define BLOCK_REGION_UPDATE_FULLCHUNK 0x01 #define BLOCK_REGION_UPDATE_ZEROHEIGHT \ diff --git a/Minecraft.World/Network/Packets/BlockRegionUpdatePacket.h b/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/BlockRegionUpdatePacket.h rename to Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.h diff --git a/Minecraft.World/Network/Packets/ChatAutoCompletePacket.h b/Minecraft.World/net/minecraft/network/packet/ChatAutoCompletePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ChatAutoCompletePacket.h rename to Minecraft.World/net/minecraft/network/packet/ChatAutoCompletePacket.h diff --git a/Minecraft.World/Network/Packets/ChatPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ChatPacket.cpp similarity index 95% rename from Minecraft.World/Network/Packets/ChatPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ChatPacket.cpp index 4f8ee4b0e..82cfd7c3c 100644 --- a/Minecraft.World/Network/Packets/ChatPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ChatPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" #include "PacketListener.h" #include "ChatPacket.h" diff --git a/Minecraft.World/Network/Packets/ChatPacket.h b/Minecraft.World/net/minecraft/network/packet/ChatPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ChatPacket.h rename to Minecraft.World/net/minecraft/network/packet/ChatPacket.h diff --git a/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.cpp b/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp index 54308acec..505c80c2c 100644 --- a/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/level/net.minecraft.world.level.h" +#include "../../world/level/chunk/net.minecraft.world.level.chunk.h" #include "PacketListener.h" #include "ChunkTilesUpdatePacket.h" -#include "../../Level/Dimensions/Dimension.h" +#include "../../world/level/dimension/Dimension.h" ChunkTilesUpdatePacket::~ChunkTilesUpdatePacket() { delete[] blocks.data; diff --git a/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.h b/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.h rename to Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.h diff --git a/Minecraft.World/Network/Packets/ChunkVisibilityAreaPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp similarity index 85% rename from Minecraft.World/Network/Packets/ChunkVisibilityAreaPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp index 21ac83a91..6589b9ef3 100644 --- a/Minecraft.World/Network/Packets/ChunkVisibilityAreaPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/level/net.minecraft.world.level.h" #include "PacketListener.h" #include "ChunkVisibilityAreaPacket.h" diff --git a/Minecraft.World/Network/Packets/ChunkVisibilityAreaPacket.h b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ChunkVisibilityAreaPacket.h rename to Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.h diff --git a/Minecraft.World/Network/Packets/ChunkVisibilityPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp similarity index 87% rename from Minecraft.World/Network/Packets/ChunkVisibilityPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp index 18c4172da..463ab86a0 100644 --- a/Minecraft.World/Network/Packets/ChunkVisibilityPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ChunkVisibilityPacket.h" diff --git a/Minecraft.World/Network/Packets/ChunkVisibilityPacket.h b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.h similarity index 93% rename from Minecraft.World/Network/Packets/ChunkVisibilityPacket.h rename to Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.h index 34202ca5f..7b308053e 100644 --- a/Minecraft.World/Network/Packets/ChunkVisibilityPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.h @@ -2,7 +2,7 @@ #include "Packet.h" -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include "PacketListener.h" diff --git a/Minecraft.World/Network/Packets/ClientCommandPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ClientCommandPacket.cpp similarity index 93% rename from Minecraft.World/Network/Packets/ClientCommandPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ClientCommandPacket.cpp index 51397673c..fca8b013c 100644 --- a/Minecraft.World/Network/Packets/ClientCommandPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ClientCommandPacket.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "PacketListener.h" #include "ClientCommandPacket.h" diff --git a/Minecraft.World/Network/Packets/ClientCommandPacket.h b/Minecraft.World/net/minecraft/network/packet/ClientCommandPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ClientCommandPacket.h rename to Minecraft.World/net/minecraft/network/packet/ClientCommandPacket.h diff --git a/Minecraft.World/Network/Packets/ClientInformationPacket.h b/Minecraft.World/net/minecraft/network/packet/ClientInformationPacket.h similarity index 58% rename from Minecraft.World/Network/Packets/ClientInformationPacket.h rename to Minecraft.World/net/minecraft/network/packet/ClientInformationPacket.h index f4b73ad27..fbb376ab2 100644 --- a/Minecraft.World/Network/Packets/ClientInformationPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/ClientInformationPacket.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" class ClientInformationPacket : public Packet {}; \ No newline at end of file diff --git a/Minecraft.World/Network/Packets/ClientProtocolPacket.h b/Minecraft.World/net/minecraft/network/packet/ClientProtocolPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ClientProtocolPacket.h rename to Minecraft.World/net/minecraft/network/packet/ClientProtocolPacket.h diff --git a/Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp index a6767cc65..926b7ffa4 100644 --- a/Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ComplexItemDataPacket.h" diff --git a/Minecraft.World/Network/Packets/ComplexItemDataPacket.h b/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ComplexItemDataPacket.h rename to Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.h diff --git a/Minecraft.World/Network/Packets/ContainerAckPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/ContainerAckPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp index b78211a49..fc7eeff59 100644 --- a/Minecraft.World/Network/Packets/ContainerAckPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerAckPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerAckPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.h similarity index 93% rename from Minecraft.World/Network/Packets/ContainerAckPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.h index 92a931fa4..245439d6e 100644 --- a/Minecraft.World/Network/Packets/ContainerAckPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.h @@ -2,7 +2,7 @@ #include "Packet.h" -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include "PacketListener.h" diff --git a/Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp similarity index 82% rename from Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp index 512535ded..c8fed699b 100644 --- a/Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "ContainerButtonClickPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerButtonClickPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerButtonClickPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.h diff --git a/Minecraft.World/Network/Packets/ContainerClickPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp similarity index 90% rename from Minecraft.World/Network/Packets/ContainerClickPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp index de1e780d6..3e96482d5 100644 --- a/Minecraft.World/Network/Packets/ContainerClickPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ContainerClickPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerClickPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerClickPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.h diff --git a/Minecraft.World/Network/Packets/ContainerClosePacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp similarity index 84% rename from Minecraft.World/Network/Packets/ContainerClosePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp index bd8471950..e72bcb8c2 100644 --- a/Minecraft.World/Network/Packets/ContainerClosePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerClosePacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerClosePacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerClosePacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.h diff --git a/Minecraft.World/Network/Packets/ContainerOpenPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/ContainerOpenPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp index c70949f71..d1acd3f1d 100644 --- a/Minecraft.World/Network/Packets/ContainerOpenPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerOpenPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerOpenPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerOpenPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.h diff --git a/Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp index b25b11f2d..73e28d6a1 100644 --- a/Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ContainerSetContentPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerSetContentPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerSetContentPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.h diff --git a/Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp index a69818a49..9b59a5869 100644 --- a/Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerSetDataPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerSetDataPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerSetDataPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.h diff --git a/Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp index 5483c1a90..aec79be3a 100644 --- a/Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ContainerSetSlotPacket.h" diff --git a/Minecraft.World/Network/Packets/ContainerSetSlotPacket.h b/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ContainerSetSlotPacket.h rename to Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.h diff --git a/Minecraft.World/Network/Packets/CraftItemPacket.cpp b/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp similarity index 80% rename from Minecraft.World/Network/Packets/CraftItemPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp index 59f981a03..a691a3899 100644 --- a/Minecraft.World/Network/Packets/CraftItemPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "CraftItemPacket.h" diff --git a/Minecraft.World/Network/Packets/CraftItemPacket.h b/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/CraftItemPacket.h rename to Minecraft.World/net/minecraft/network/packet/CraftItemPacket.h diff --git a/Minecraft.World/Network/Packets/CustomPayloadPacket.cpp b/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/CustomPayloadPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp index 87e9af094..ff229363e 100644 --- a/Minecraft.World/Network/Packets/CustomPayloadPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "CustomPayloadPacket.h" #include diff --git a/Minecraft.World/Network/Packets/CustomPayloadPacket.h b/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/CustomPayloadPacket.h rename to Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.h diff --git a/Minecraft.World/Network/Packets/DebugOptionsPacket.cpp b/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp similarity index 79% rename from Minecraft.World/Network/Packets/DebugOptionsPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp index 3dcbbe295..efecbb485 100644 --- a/Minecraft.World/Network/Packets/DebugOptionsPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "DebugOptionsPacket.h" diff --git a/Minecraft.World/Network/Packets/DebugOptionsPacket.h b/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/DebugOptionsPacket.h rename to Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.h diff --git a/Minecraft.World/Network/Packets/DisconnectPacket.cpp b/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/DisconnectPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp index 2da1665d6..f864f8599 100644 --- a/Minecraft.World/Network/Packets/DisconnectPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Util/SharedConstants.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../SharedConstants.h" #include "PacketListener.h" #include "DisconnectPacket.h" diff --git a/Minecraft.World/Network/Packets/DisconnectPacket.h b/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/DisconnectPacket.h rename to Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h diff --git a/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp b/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp index 4a0255fee..63d455c95 100644 --- a/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "EntityActionAtPositionPacket.h" diff --git a/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.h b/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/EntityActionAtPositionPacket.h rename to Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.h diff --git a/Minecraft.World/Network/Packets/EntityEventPacket.cpp b/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/EntityEventPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp index 18ac96cef..3cae4a5db 100644 --- a/Minecraft.World/Network/Packets/EntityEventPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "EntityEventPacket.h" diff --git a/Minecraft.World/Network/Packets/EntityEventPacket.h b/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/EntityEventPacket.h rename to Minecraft.World/net/minecraft/network/packet/EntityEventPacket.h diff --git a/Minecraft.World/Network/Packets/ExplodePacket.cpp b/Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/ExplodePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp index 97650af0d..b355b2efd 100644 --- a/Minecraft.World/Network/Packets/ExplodePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/level/net.minecraft.world.level.h" #include "PacketListener.h" #include "ExplodePacket.h" diff --git a/Minecraft.World/Network/Packets/ExplodePacket.h b/Minecraft.World/net/minecraft/network/packet/ExplodePacket.h similarity index 96% rename from Minecraft.World/Network/Packets/ExplodePacket.h rename to Minecraft.World/net/minecraft/network/packet/ExplodePacket.h index c6b0a5bd4..9ffc077a6 100644 --- a/Minecraft.World/Network/Packets/ExplodePacket.h +++ b/Minecraft.World/net/minecraft/network/packet/ExplodePacket.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Level/TilePos.h" +#include "../../world/level/TilePos.h" #include "Packet.h" class ExplodePacket : public Packet, diff --git a/Minecraft.World/Network/Packets/GameCommandPacket.cpp b/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/GameCommandPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp index 33d1ebbf7..04a7ce3ab 100644 --- a/Minecraft.World/Network/Packets/GameCommandPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "GameCommandPacket.h" #include diff --git a/Minecraft.World/Network/Packets/GameCommandPacket.h b/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.h similarity index 94% rename from Minecraft.World/Network/Packets/GameCommandPacket.h rename to Minecraft.World/net/minecraft/network/packet/GameCommandPacket.h index cb8e9d5dd..453d61fca 100644 --- a/Minecraft.World/Network/Packets/GameCommandPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Commands/CommandsEnum.h" +#include "../../commands/CommandsEnum.h" #include "Packet.h" class GameCommandPacket diff --git a/Minecraft.World/Network/Packets/GameEventPacket.cpp b/Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/GameEventPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp index 0b5504141..d12a6ddb7 100644 --- a/Minecraft.World/Network/Packets/GameEventPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "GameEventPacket.h" diff --git a/Minecraft.World/Network/Packets/GameEventPacket.h b/Minecraft.World/net/minecraft/network/packet/GameEventPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/GameEventPacket.h rename to Minecraft.World/net/minecraft/network/packet/GameEventPacket.h diff --git a/Minecraft.World/Network/Packets/GetInfoPacket.cpp b/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp similarity index 72% rename from Minecraft.World/Network/Packets/GetInfoPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp index ddec91bb7..858c8e40c 100644 --- a/Minecraft.World/Network/Packets/GetInfoPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "GetInfoPacket.h" diff --git a/Minecraft.World/Network/Packets/GetInfoPacket.h b/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/GetInfoPacket.h rename to Minecraft.World/net/minecraft/network/packet/GetInfoPacket.h diff --git a/Minecraft.World/Network/Packets/InteractPacket.cpp b/Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/InteractPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp index 2078127ed..6a67ea236 100644 --- a/Minecraft.World/Network/Packets/InteractPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "InteractPacket.h" diff --git a/Minecraft.World/Network/Packets/InteractPacket.h b/Minecraft.World/net/minecraft/network/packet/InteractPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/InteractPacket.h rename to Minecraft.World/net/minecraft/network/packet/InteractPacket.h diff --git a/Minecraft.World/Network/Packets/KeepAlivePacket.cpp b/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/KeepAlivePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp index e5a4329ab..171c418ad 100644 --- a/Minecraft.World/Network/Packets/KeepAlivePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "KeepAlivePacket.h" diff --git a/Minecraft.World/Network/Packets/KeepAlivePacket.h b/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/KeepAlivePacket.h rename to Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.h diff --git a/Minecraft.World/Network/Packets/KickPlayerPacket.cpp b/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp similarity index 84% rename from Minecraft.World/Network/Packets/KickPlayerPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp index c1d52e149..95e28691c 100644 --- a/Minecraft.World/Network/Packets/KickPlayerPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "KickPlayerPacket.h" diff --git a/Minecraft.World/Network/Packets/KickPlayerPacket.h b/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/KickPlayerPacket.h rename to Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.h diff --git a/Minecraft.World/Network/Packets/LevelEventPacket.cpp b/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp similarity index 90% rename from Minecraft.World/Network/Packets/LevelEventPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp index 21f01e753..ffe45cdb0 100644 --- a/Minecraft.World/Network/Packets/LevelEventPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "LevelEventPacket.h" diff --git a/Minecraft.World/Network/Packets/LevelEventPacket.h b/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/LevelEventPacket.h rename to Minecraft.World/net/minecraft/network/packet/LevelEventPacket.h diff --git a/Minecraft.World/Network/Packets/LevelParticlesPacket.cpp b/Minecraft.World/net/minecraft/network/packet/LevelParticlesPacket.cpp similarity index 97% rename from Minecraft.World/Network/Packets/LevelParticlesPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/LevelParticlesPacket.cpp index a844f3a02..2eba51f9f 100644 --- a/Minecraft.World/Network/Packets/LevelParticlesPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/LevelParticlesPacket.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "PacketListener.h" #include "LevelParticlesPacket.h" diff --git a/Minecraft.World/Network/Packets/LevelParticlesPacket.h b/Minecraft.World/net/minecraft/network/packet/LevelParticlesPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/LevelParticlesPacket.h rename to Minecraft.World/net/minecraft/network/packet/LevelParticlesPacket.h diff --git a/Minecraft.World/Network/Packets/LevelSoundPacket.cpp b/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/LevelSoundPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp index 269136de6..2da855fc8 100644 --- a/Minecraft.World/Network/Packets/LevelSoundPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "net.minecraft.network.packet.h" #include "LevelSoundPacket.h" #include diff --git a/Minecraft.World/Network/Packets/LevelSoundPacket.h b/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/LevelSoundPacket.h rename to Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.h diff --git a/Minecraft.World/Network/Packets/LoginPacket.cpp b/Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp similarity index 96% rename from Minecraft.World/Network/Packets/LoginPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp index da4a00667..f13f6f94e 100644 --- a/Minecraft.World/Network/Packets/LoginPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.player.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" #include "PacketListener.h" #include "LoginPacket.h" -#include "../../Level/Storage/LevelType.h" +#include "../../world/level/LevelType.h" LoginPacket::LoginPacket() { this->userName = L""; diff --git a/Minecraft.World/Network/Packets/LoginPacket.h b/Minecraft.World/net/minecraft/network/packet/LoginPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/LoginPacket.h rename to Minecraft.World/net/minecraft/network/packet/LoginPacket.h diff --git a/Minecraft.World/Network/Packets/MoveEntityPacket.cpp b/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp similarity index 96% rename from Minecraft.World/Network/Packets/MoveEntityPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp index 1d4d114b2..fed630029 100644 --- a/Minecraft.World/Network/Packets/MoveEntityPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "MoveEntityPacket.h" diff --git a/Minecraft.World/Network/Packets/MoveEntityPacket.h b/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/MoveEntityPacket.h rename to Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.h diff --git a/Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp b/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp similarity index 97% rename from Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp rename to Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp index 844e400ba..dabf86ead 100644 --- a/Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp +++ b/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "MoveEntityPacketSmall.h" diff --git a/Minecraft.World/Network/Packets/MoveEntityPacketSmall.h b/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.h similarity index 100% rename from Minecraft.World/Network/Packets/MoveEntityPacketSmall.h rename to Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.h diff --git a/Minecraft.World/Network/Packets/MovePlayerPacket.cpp b/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp similarity index 97% rename from Minecraft.World/Network/Packets/MovePlayerPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp index e296dc7cf..63e6dd5c7 100644 --- a/Minecraft.World/Network/Packets/MovePlayerPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "MovePlayerPacket.h" diff --git a/Minecraft.World/Network/Packets/MovePlayerPacket.h b/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/MovePlayerPacket.h rename to Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.h diff --git a/Minecraft.World/Network/Packets/Packet.cpp b/Minecraft.World/net/minecraft/network/packet/Packet.cpp similarity index 98% rename from Minecraft.World/Network/Packets/Packet.cpp rename to Minecraft.World/net/minecraft/network/packet/Packet.cpp index 3ea1bbb7a..d1f761ed9 100644 --- a/Minecraft.World/Network/Packets/Packet.cpp +++ b/Minecraft.World/net/minecraft/network/packet/Packet.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Platform/System.h" -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/System.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "net.minecraft.network.packet.h" #include "PacketListener.h" #include "Packet.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #if !defined(_CONTENT_PACKAGE) -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/UI/Gui.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/client/gui/Gui.h" #endif void Packet::staticCtor() { diff --git a/Minecraft.World/Network/Packets/Packet.h b/Minecraft.World/net/minecraft/network/packet/Packet.h similarity index 100% rename from Minecraft.World/Network/Packets/Packet.h rename to Minecraft.World/net/minecraft/network/packet/Packet.h diff --git a/Minecraft.World/Network/Packets/PacketListener.cpp b/Minecraft.World/net/minecraft/network/packet/PacketListener.cpp similarity index 99% rename from Minecraft.World/Network/Packets/PacketListener.cpp rename to Minecraft.World/net/minecraft/network/packet/PacketListener.cpp index db1045e03..88071202a 100644 --- a/Minecraft.World/Network/Packets/PacketListener.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PacketListener.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.network.packet.h" #include "PacketListener.h" void PacketListener::handleBlockRegionUpdate( diff --git a/Minecraft.World/Network/Packets/PacketListener.h b/Minecraft.World/net/minecraft/network/packet/PacketListener.h similarity index 100% rename from Minecraft.World/Network/Packets/PacketListener.h rename to Minecraft.World/net/minecraft/network/packet/PacketListener.h diff --git a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp b/Minecraft.World/net/minecraft/network/packet/PlayerAbilitiesPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/PlayerAbilitiesPacket.cpp index 52b977607..212e3ca19 100644 --- a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PlayerAbilitiesPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.network.packet.h" #include "PlayerAbilitiesPacket.h" PlayerAbilitiesPacket::PlayerAbilitiesPacket() { diff --git a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.h b/Minecraft.World/net/minecraft/network/packet/PlayerAbilitiesPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/PlayerAbilitiesPacket.h rename to Minecraft.World/net/minecraft/network/packet/PlayerAbilitiesPacket.h diff --git a/Minecraft.World/Network/Packets/PlayerActionPacket.cpp b/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/PlayerActionPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp index b1f585297..306001e5e 100644 --- a/Minecraft.World/Network/Packets/PlayerActionPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "PlayerActionPacket.h" diff --git a/Minecraft.World/Network/Packets/PlayerActionPacket.h b/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/PlayerActionPacket.h rename to Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.h diff --git a/Minecraft.World/Network/Packets/PlayerCommandPacket.cpp b/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp similarity index 89% rename from Minecraft.World/Network/Packets/PlayerCommandPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp index 2f0996811..9aa28856f 100644 --- a/Minecraft.World/Network/Packets/PlayerCommandPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PlayerCommandPacket.h" const int PlayerCommandPacket::START_SNEAKING = 1; diff --git a/Minecraft.World/Network/Packets/PlayerCommandPacket.h b/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/PlayerCommandPacket.h rename to Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.h diff --git a/Minecraft.World/Network/Packets/PlayerInfoPacket.cpp b/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp similarity index 82% rename from Minecraft.World/Network/Packets/PlayerInfoPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp index 30b80762b..b351c353f 100644 --- a/Minecraft.World/Network/Packets/PlayerInfoPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../../Minecraft.Client/Player/ServerPlayer.h" -#include "../../../Minecraft.Client/Network/PlayerConnection.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" +#include "../../../Minecraft.Client/net/minecraft/server/network/PlayerConnection.h" #ifndef __linux__ #include #endif // __linux__ #include "PacketListener.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PlayerInfoPacket.h" PlayerInfoPacket::PlayerInfoPacket() { diff --git a/Minecraft.World/Network/Packets/PlayerInfoPacket.h b/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/PlayerInfoPacket.h rename to Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.h diff --git a/Minecraft.World/Network/Packets/PlayerInputPacket.cpp b/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/PlayerInputPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp index 8f1bad5b2..0a90ddef2 100644 --- a/Minecraft.World/Network/Packets/PlayerInputPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "PlayerInputPacket.h" diff --git a/Minecraft.World/Network/Packets/PlayerInputPacket.h b/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/PlayerInputPacket.h rename to Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.h diff --git a/Minecraft.World/Network/Packets/PreLoginPacket.cpp b/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp similarity index 96% rename from Minecraft.World/Network/Packets/PreLoginPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp index 4173fd6a8..8dbb25985 100644 --- a/Minecraft.World/Network/Packets/PreLoginPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include #include #include "PacketListener.h" #include "PreLoginPacket.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" PreLoginPacket::PreLoginPacket() { loginKey = L""; diff --git a/Minecraft.World/Network/Packets/PreLoginPacket.h b/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/PreLoginPacket.h rename to Minecraft.World/net/minecraft/network/packet/PreLoginPacket.h diff --git a/Minecraft.World/Network/Packets/RemoveEntitiesPacket.cpp b/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp similarity index 85% rename from Minecraft.World/Network/Packets/RemoveEntitiesPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp index 1b745c698..7d4cbecca 100644 --- a/Minecraft.World/Network/Packets/RemoveEntitiesPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../Util/ArrayWithLength.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleHelpers/ArrayWithLength.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "RemoveEntitiesPacket.h" diff --git a/Minecraft.World/Network/Packets/RemoveEntitiesPacket.h b/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/RemoveEntitiesPacket.h rename to Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.h diff --git a/Minecraft.World/Network/Packets/RemoveMobEffectPacket.cpp b/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp similarity index 80% rename from Minecraft.World/Network/Packets/RemoveMobEffectPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp index 67604d3a2..34071dd2e 100644 --- a/Minecraft.World/Network/Packets/RemoveMobEffectPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/effect/net.minecraft.world.effect.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "RemoveMobEffectPacket.h" diff --git a/Minecraft.World/Network/Packets/RemoveMobEffectPacket.h b/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/RemoveMobEffectPacket.h rename to Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.h diff --git a/Minecraft.World/Network/Packets/RespawnPacket.cpp b/Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/RespawnPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp index 494648da5..38e2b9afb 100644 --- a/Minecraft.World/Network/Packets/RespawnPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "RespawnPacket.h" -#include "../../Level/Storage/LevelType.h" +#include "../../world/level/LevelType.h" RespawnPacket::RespawnPacket() { this->dimension = 0; diff --git a/Minecraft.World/Network/Packets/RespawnPacket.h b/Minecraft.World/net/minecraft/network/packet/RespawnPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/RespawnPacket.h rename to Minecraft.World/net/minecraft/network/packet/RespawnPacket.h diff --git a/Minecraft.World/Network/Packets/RotateHeadPacket.cpp b/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.cpp similarity index 95% rename from Minecraft.World/Network/Packets/RotateHeadPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.cpp index ce9002fb1..f504b5cea 100644 --- a/Minecraft.World/Network/Packets/RotateHeadPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "RotateHeadPacket.h" diff --git a/Minecraft.World/Network/Packets/RotateHeadPacket.h b/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h similarity index 90% rename from Minecraft.World/Network/Packets/RotateHeadPacket.h rename to Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h index b1120e57c..828aa5bd9 100644 --- a/Minecraft.World/Network/Packets/RotateHeadPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h @@ -1,6 +1,6 @@ #pragma once -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "Packet.h" diff --git a/Minecraft.World/Network/Packets/ServerAuthDataPacket.h b/Minecraft.World/net/minecraft/network/packet/ServerAuthDataPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ServerAuthDataPacket.h rename to Minecraft.World/net/minecraft/network/packet/ServerAuthDataPacket.h diff --git a/Minecraft.World/Network/Packets/ServerSettingsChangedPacket.cpp b/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp similarity index 87% rename from Minecraft.World/Network/Packets/ServerSettingsChangedPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp index 441117163..f1c6a890d 100644 --- a/Minecraft.World/Network/Packets/ServerSettingsChangedPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ServerSettingsChangedPacket.h" diff --git a/Minecraft.World/Network/Packets/ServerSettingsChangedPacket.h b/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/ServerSettingsChangedPacket.h rename to Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.h diff --git a/Minecraft.World/Network/Packets/SetCarriedItemPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/SetCarriedItemPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp index 886cf1ae5..233b8208a 100644 --- a/Minecraft.World/Network/Packets/SetCarriedItemPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetCarriedItemPacket.h" diff --git a/Minecraft.World/Network/Packets/SetCarriedItemPacket.h b/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetCarriedItemPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.h diff --git a/Minecraft.World/Network/Packets/SetCreativeModeSlotPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/SetCreativeModeSlotPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp index 85e09bbcc..0cda8e9f9 100644 --- a/Minecraft.World/Network/Packets/SetCreativeModeSlotPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetCreativeModeSlotPacket.h" diff --git a/Minecraft.World/Network/Packets/SetCreativeModeSlotPacket.h b/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetCreativeModeSlotPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.h diff --git a/Minecraft.World/Network/Packets/SetDisplayObjectivePacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetDisplayObjectivePacket.cpp similarity index 90% rename from Minecraft.World/Network/Packets/SetDisplayObjectivePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetDisplayObjectivePacket.cpp index 266c8130d..be8a491d6 100644 --- a/Minecraft.World/Network/Packets/SetDisplayObjectivePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetDisplayObjectivePacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "PacketListener.h" -#include "../../Headers/net.minecraft.world.scores.h" +#include "../../world/scores/net.minecraft.world.scores.h" #include "SetDisplayObjectivePacket.h" SetDisplayObjectivePacket::SetDisplayObjectivePacket() { diff --git a/Minecraft.World/Network/Packets/SetDisplayObjectivePacket.h b/Minecraft.World/net/minecraft/network/packet/SetDisplayObjectivePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetDisplayObjectivePacket.h rename to Minecraft.World/net/minecraft/network/packet/SetDisplayObjectivePacket.h diff --git a/Minecraft.World/Network/Packets/SetEntityDataPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/SetEntityDataPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp index 74598842e..4f5985f8c 100644 --- a/Minecraft.World/Network/Packets/SetEntityDataPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "SetEntityDataPacket.h" diff --git a/Minecraft.World/Network/Packets/SetEntityDataPacket.h b/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.h similarity index 94% rename from Minecraft.World/Network/Packets/SetEntityDataPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.h index 4ffffbc5d..4a6bf3881 100644 --- a/Minecraft.World/Network/Packets/SetEntityDataPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.h @@ -1,7 +1,7 @@ #pragma once #include "Packet.h" -#include "../../Entities/SyncedEntityData.h" +#include "../../world/entity/SyncedEntityData.h" class SetEntityDataPacket : public Packet, diff --git a/Minecraft.World/Network/Packets/SetEntityLinkPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/SetEntityLinkPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp index 4172e3eba..52977acf9 100644 --- a/Minecraft.World/Network/Packets/SetEntityLinkPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "SetEntityLinkPacket.h" SetEntityLinkPacket::SetEntityLinkPacket() { diff --git a/Minecraft.World/Network/Packets/SetEntityLinkPacket.h b/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetEntityLinkPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.h diff --git a/Minecraft.World/Network/Packets/SetEntityMotionPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp similarity index 93% rename from Minecraft.World/Network/Packets/SetEntityMotionPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp index 4e37d3eb1..a949e5d9d 100644 --- a/Minecraft.World/Network/Packets/SetEntityMotionPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "SetEntityMotionPacket.h" diff --git a/Minecraft.World/Network/Packets/SetEntityMotionPacket.h b/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetEntityMotionPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.h diff --git a/Minecraft.World/Network/Packets/SetEquippedItemPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/SetEquippedItemPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp index 1e47d66cb..a24b36bac 100644 --- a/Minecraft.World/Network/Packets/SetEquippedItemPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "SetEquippedItemPacket.h" diff --git a/Minecraft.World/Network/Packets/SetEquippedItemPacket.h b/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetEquippedItemPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.h diff --git a/Minecraft.World/Network/Packets/SetExperiencePacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/SetExperiencePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp index 0966b55e6..1843b8658 100644 --- a/Minecraft.World/Network/Packets/SetExperiencePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "SetExperiencePacket.h" #include "PacketListener.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" SetExperiencePacket::SetExperiencePacket() { this->experienceProgress = 0; diff --git a/Minecraft.World/Network/Packets/SetExperiencePacket.h b/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetExperiencePacket.h rename to Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.h diff --git a/Minecraft.World/Network/Packets/SetHealthPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/SetHealthPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp index ed529ecfe..78bdb2d44 100644 --- a/Minecraft.World/Network/Packets/SetHealthPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetHealthPacket.h" diff --git a/Minecraft.World/Network/Packets/SetHealthPacket.h b/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetHealthPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetHealthPacket.h diff --git a/Minecraft.World/Network/Packets/SetObjectivePacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetObjectivePacket.cpp similarity index 90% rename from Minecraft.World/Network/Packets/SetObjectivePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetObjectivePacket.cpp index e2a867a44..b567e2065 100644 --- a/Minecraft.World/Network/Packets/SetObjectivePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetObjectivePacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.scores.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/scores/net.minecraft.world.scores.h" #include "PacketListener.h" #include "SetObjectivePacket.h" diff --git a/Minecraft.World/Network/Packets/SetObjectivePacket.h b/Minecraft.World/net/minecraft/network/packet/SetObjectivePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetObjectivePacket.h rename to Minecraft.World/net/minecraft/network/packet/SetObjectivePacket.h diff --git a/Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetPlayerTeamPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetPlayerTeamPacket.cpp index d20c639f3..118666ee0 100644 --- a/Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetPlayerTeamPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.scores.h" -#include "../../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/scores/net.minecraft.world.scores.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" #include "PacketListener.h" #include "SetPlayerTeamPacket.h" diff --git a/Minecraft.World/Network/Packets/SetPlayerTeamPacket.h b/Minecraft.World/net/minecraft/network/packet/SetPlayerTeamPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetPlayerTeamPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetPlayerTeamPacket.h diff --git a/Minecraft.World/Network/Packets/SetScorePacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetScorePacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/SetScorePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetScorePacket.cpp index 47a0a5e2f..842b91fc7 100644 --- a/Minecraft.World/Network/Packets/SetScorePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetScorePacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.scores.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/entity/player/net.minecraft.world.entity.player.h" +#include "../../world/scores/net.minecraft.world.scores.h" #include "PacketListener.h" #include "SetScorePacket.h" diff --git a/Minecraft.World/Network/Packets/SetScorePacket.h b/Minecraft.World/net/minecraft/network/packet/SetScorePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetScorePacket.h rename to Minecraft.World/net/minecraft/network/packet/SetScorePacket.h diff --git a/Minecraft.World/Network/Packets/SetSpawnPositionPacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp similarity index 89% rename from Minecraft.World/Network/Packets/SetSpawnPositionPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp index 591f83fdf..6563d3745 100644 --- a/Minecraft.World/Network/Packets/SetSpawnPositionPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetSpawnPositionPacket.h" diff --git a/Minecraft.World/Network/Packets/SetSpawnPositionPacket.h b/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetSpawnPositionPacket.h rename to Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.h diff --git a/Minecraft.World/Network/Packets/SetTimePacket.cpp b/Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp similarity index 90% rename from Minecraft.World/Network/Packets/SetTimePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp index 0bafd9389..395acd088 100644 --- a/Minecraft.World/Network/Packets/SetTimePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetTimePacket.h" diff --git a/Minecraft.World/Network/Packets/SetTimePacket.h b/Minecraft.World/net/minecraft/network/packet/SetTimePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SetTimePacket.h rename to Minecraft.World/net/minecraft/network/packet/SetTimePacket.h diff --git a/Minecraft.World/Network/Packets/SharedKeyPacket.h b/Minecraft.World/net/minecraft/network/packet/SharedKeyPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SharedKeyPacket.h rename to Minecraft.World/net/minecraft/network/packet/SharedKeyPacket.h diff --git a/Minecraft.World/Network/Packets/SignUpdatePacket.cpp b/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp similarity index 88% rename from Minecraft.World/Network/Packets/SignUpdatePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp index e1addb4bc..6a68dfa04 100644 --- a/Minecraft.World/Network/Packets/SignUpdatePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "SignUpdatePacket.h" SignUpdatePacket::SignUpdatePacket() { diff --git a/Minecraft.World/Network/Packets/SignUpdatePacket.h b/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/SignUpdatePacket.h rename to Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.h diff --git a/Minecraft.World/Network/Packets/TakeItemEntityPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp similarity index 86% rename from Minecraft.World/Network/Packets/TakeItemEntityPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp index 837832d86..a2c54eb8f 100644 --- a/Minecraft.World/Network/Packets/TakeItemEntityPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TakeItemEntityPacket.h" diff --git a/Minecraft.World/Network/Packets/TakeItemEntityPacket.h b/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TakeItemEntityPacket.h rename to Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.h diff --git a/Minecraft.World/Network/Packets/TeleportEntityPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/TeleportEntityPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp index e2659f209..ea675d9c2 100644 --- a/Minecraft.World/Network/Packets/TeleportEntityPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "TeleportEntityPacket.h" diff --git a/Minecraft.World/Network/Packets/TeleportEntityPacket.h b/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TeleportEntityPacket.h rename to Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.h diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp similarity index 87% rename from Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp index 75b66c781..237c6a1f2 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "TextureAndGeometryChangePacket.h" diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.h b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.h rename to Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.h diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp similarity index 97% rename from Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp index df9876aee..eb99fe5fa 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TextureAndGeometryPacket.h" diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.h similarity index 91% rename from Minecraft.World/Network/Packets/TextureAndGeometryPacket.h rename to Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.h index a49b9f092..2e4a2d256 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.h @@ -2,8 +2,8 @@ #include #include "Packet.h" -#include "../../../Minecraft.Client/Rendering/Models/Model.h" -#include "../../../Minecraft.Client/Rendering/Models/SkinBox.h" +#include "../../../Minecraft.Client/net/minecraft/client/model/geom/Model.h" +#include "../../../Minecraft.Client/Header Files/SkinBox.h" class DLCSkinFile; diff --git a/Minecraft.World/Network/Packets/TextureChangePacket.cpp b/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp similarity index 84% rename from Minecraft.World/Network/Packets/TextureChangePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp index 086758c6d..1c3fb9b0f 100644 --- a/Minecraft.World/Network/Packets/TextureChangePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "TextureChangePacket.h" diff --git a/Minecraft.World/Network/Packets/TextureChangePacket.h b/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TextureChangePacket.h rename to Minecraft.World/net/minecraft/network/packet/TextureChangePacket.h diff --git a/Minecraft.World/Network/Packets/TexturePacket.cpp b/Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/TexturePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp index 2d5a10f78..9e348f413 100644 --- a/Minecraft.World/Network/Packets/TexturePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TexturePacket.h" diff --git a/Minecraft.World/Network/Packets/TexturePacket.h b/Minecraft.World/net/minecraft/network/packet/TexturePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TexturePacket.h rename to Minecraft.World/net/minecraft/network/packet/TexturePacket.h diff --git a/Minecraft.World/Network/Packets/TileDestructionPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TileDestructionPacket.cpp similarity index 94% rename from Minecraft.World/Network/Packets/TileDestructionPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TileDestructionPacket.cpp index 81c07581b..c89d52b66 100644 --- a/Minecraft.World/Network/Packets/TileDestructionPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TileDestructionPacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.network.packet.h" #include "TileDestructionPacket.h" TileDestructionPacket::TileDestructionPacket() { diff --git a/Minecraft.World/Network/Packets/TileDestructionPacket.h b/Minecraft.World/net/minecraft/network/packet/TileDestructionPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TileDestructionPacket.h rename to Minecraft.World/net/minecraft/network/packet/TileDestructionPacket.h diff --git a/Minecraft.World/Network/Packets/TileEditorOpenPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TileEditorOpenPacket.cpp similarity index 95% rename from Minecraft.World/Network/Packets/TileEditorOpenPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TileEditorOpenPacket.cpp index 049d37224..c26d8b055 100644 --- a/Minecraft.World/Network/Packets/TileEditorOpenPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TileEditorOpenPacket.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "PacketListener.h" #include "TileEditorOpenPacket.h" diff --git a/Minecraft.World/Network/Packets/TileEditorOpenPacket.h b/Minecraft.World/net/minecraft/network/packet/TileEditorOpenPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TileEditorOpenPacket.h rename to Minecraft.World/net/minecraft/network/packet/TileEditorOpenPacket.h diff --git a/Minecraft.World/Network/Packets/TileEntityDataPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp similarity index 90% rename from Minecraft.World/Network/Packets/TileEntityDataPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp index 0e2b129be..c24a6db91 100644 --- a/Minecraft.World/Network/Packets/TileEntityDataPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TileEntityDataPacket.h" diff --git a/Minecraft.World/Network/Packets/TileEntityDataPacket.h b/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TileEntityDataPacket.h rename to Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.h diff --git a/Minecraft.World/Network/Packets/TileEventPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp similarity index 85% rename from Minecraft.World/Network/Packets/TileEventPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp index f6f8a023b..8a2b0be1c 100644 --- a/Minecraft.World/Network/Packets/TileEventPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TileEventPacket.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../world/level/tile/net.minecraft.world.level.tile.h" TileEventPacket::TileEventPacket() { x = 0; diff --git a/Minecraft.World/Network/Packets/TileEventPacket.h b/Minecraft.World/net/minecraft/network/packet/TileEventPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TileEventPacket.h rename to Minecraft.World/net/minecraft/network/packet/TileEventPacket.h diff --git a/Minecraft.World/Network/Packets/TileUpdatePacket.cpp b/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp similarity index 91% rename from Minecraft.World/Network/Packets/TileUpdatePacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp index e6a83d150..77be8b070 100644 --- a/Minecraft.World/Network/Packets/TileUpdatePacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/level/net.minecraft.world.level.h" #include "PacketListener.h" #include "TileUpdatePacket.h" -#include "../../Level/Dimensions/Dimension.h" +#include "../../world/level/dimension/Dimension.h" TileUpdatePacket::TileUpdatePacket() { shouldDelay = true; } diff --git a/Minecraft.World/Network/Packets/TileUpdatePacket.h b/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.h similarity index 100% rename from Minecraft.World/Network/Packets/TileUpdatePacket.h rename to Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.h diff --git a/Minecraft.World/Network/Packets/TradeItemPacket.cpp b/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp similarity index 85% rename from Minecraft.World/Network/Packets/TradeItemPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp index 06c081872..942a77be6 100644 --- a/Minecraft.World/Network/Packets/TradeItemPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TradeItemPacket.h" diff --git a/Minecraft.World/Network/Packets/TradeItemPacket.h b/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.h similarity index 93% rename from Minecraft.World/Network/Packets/TradeItemPacket.h rename to Minecraft.World/net/minecraft/network/packet/TradeItemPacket.h index 671409154..46dfaebe4 100644 --- a/Minecraft.World/Network/Packets/TradeItemPacket.h +++ b/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.h @@ -4,7 +4,7 @@ #include "Packet.h" -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include #include "PacketListener.h" diff --git a/Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp b/Minecraft.World/net/minecraft/network/packet/UpdateAttributesPacket.cpp similarity index 96% rename from Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/UpdateAttributesPacket.cpp index 8e7e2be26..ff1cb0cd4 100644 --- a/Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/UpdateAttributesPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" +#include "../../world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" #include "PacketListener.h" #include "UpdateAttributesPacket.h" diff --git a/Minecraft.World/Network/Packets/UpdateAttributesPacket.h b/Minecraft.World/net/minecraft/network/packet/UpdateAttributesPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/UpdateAttributesPacket.h rename to Minecraft.World/net/minecraft/network/packet/UpdateAttributesPacket.h diff --git a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp b/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp similarity index 93% rename from Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp index b6065baa2..01c228120 100644 --- a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "UpdateGameRuleProgressPacket.h" diff --git a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.h b/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.h rename to Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.h diff --git a/Minecraft.World/Network/Packets/UpdateMobEffectPacket.cpp b/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp similarity index 87% rename from Minecraft.World/Network/Packets/UpdateMobEffectPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp index c099b9bfb..8a943642d 100644 --- a/Minecraft.World/Network/Packets/UpdateMobEffectPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../Header Files/stdafx.h" +#include "../../world/effect/net.minecraft.world.effect.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" -#include "../../WorldGen/Features/BasicTreeFeature.h" +#include "../../world/level/levelgen/feature/BasicTreeFeature.h" #include "UpdateMobEffectPacket.h" #include diff --git a/Minecraft.World/Network/Packets/UpdateMobEffectPacket.h b/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/UpdateMobEffectPacket.h rename to Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.h diff --git a/Minecraft.World/Network/Packets/UpdateProgressPacket.cpp b/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp similarity index 84% rename from Minecraft.World/Network/Packets/UpdateProgressPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp index e1253ed11..2cedb9e8f 100644 --- a/Minecraft.World/Network/Packets/UpdateProgressPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "UpdateProgressPacket.h" diff --git a/Minecraft.World/Network/Packets/UpdateProgressPacket.h b/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/UpdateProgressPacket.h rename to Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.h diff --git a/Minecraft.World/Network/Packets/UseItemPacket.cpp b/Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp similarity index 92% rename from Minecraft.World/Network/Packets/UseItemPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp index de3abc36e..d50e2f2dd 100644 --- a/Minecraft.World/Network/Packets/UseItemPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "UseItemPacket.h" diff --git a/Minecraft.World/Network/Packets/UseItemPacket.h b/Minecraft.World/net/minecraft/network/packet/UseItemPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/UseItemPacket.h rename to Minecraft.World/net/minecraft/network/packet/UseItemPacket.h diff --git a/Minecraft.World/Network/Packets/XZPacket.cpp b/Minecraft.World/net/minecraft/network/packet/XZPacket.cpp similarity index 80% rename from Minecraft.World/Network/Packets/XZPacket.cpp rename to Minecraft.World/net/minecraft/network/packet/XZPacket.cpp index c131cbbda..126ebddfe 100644 --- a/Minecraft.World/Network/Packets/XZPacket.cpp +++ b/Minecraft.World/net/minecraft/network/packet/XZPacket.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "XZPacket.h" diff --git a/Minecraft.World/Network/Packets/XZPacket.h b/Minecraft.World/net/minecraft/network/packet/XZPacket.h similarity index 100% rename from Minecraft.World/Network/Packets/XZPacket.h rename to Minecraft.World/net/minecraft/network/packet/XZPacket.h diff --git a/Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h b/Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h new file mode 100644 index 000000000..3705e4774 --- /dev/null +++ b/Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h @@ -0,0 +1,110 @@ +#pragma once + +#include "AddEntityPacket.h" +#include "AddGlobalEntityPacket.h" +#include "AddMobPacket.h" +#include "AddPaintingPacket.h" +#include "AddPlayerPacket.h" +#include "AnimatePacket.h" +#include "AwardStatPacket.h" +#include "BlockRegionUpdatePacket.h" +#include "ChatPacket.h" +#include "ChunkTilesUpdatePacket.h" +#include "ChunkVisibilityPacket.h" +#include "ComplexItemDataPacket.h" +#include "ContainerAckPacket.h" +#include "ContainerClickPacket.h" +#include "ContainerClosePacket.h" +#include "ContainerOpenPacket.h" +#include "ContainerSetContentPacket.h" +#include "ContainerSetDataPacket.h" +#include "ContainerSetSlotPacket.h" +#include "DisconnectPacket.h" +#include "EntityActionAtPositionPacket.h" +#include "EntityEventPacket.h" +#include "ExplodePacket.h" +#include "GameEventPacket.h" +#include "InteractPacket.h" +#include "KeepAlivePacket.h" +#include "LevelEventPacket.h" +#include "LoginPacket.h" +#include "MoveEntityPacket.h" +#include "MoveEntityPacketSmall.h" +#include "MovePlayerPacket.h" +#include "Packet.h" +#include "PacketListener.h" +#include "PlayerActionPacket.h" +#include "PlayerCommandPacket.h" +#include "PlayerInputPacket.h" +#include "PreLoginPacket.h" +#include "RemoveEntitiesPacket.h" +#include "RespawnPacket.h" + +#include "SetCarriedItemPacket.h" +#include "SetEntityDataPacket.h" +#include "SetEntityMotionPacket.h" +#include "SetEquippedItemPacket.h" +#include "SetHealthPacket.h" +#include "SetEntityLinkPacket.h" +#include "SetSpawnPositionPacket.h" +#include "SetTimePacket.h" +#include "SignUpdatePacket.h" +#include "TakeItemEntityPacket.h" +#include "TeleportEntityPacket.h" +#include "TileEventPacket.h" +#include "TileUpdatePacket.h" +#include "UseItemPacket.h" + +// 1.8.2 Added +#include "AddExperienceOrbPacket.h" +#include "GetInfoPacket.h" +#include "PlayerInfoPacket.h" +#include "RemoveMobEffectPacket.h" +#include "SetCreativeModeSlotPacket.h" +#include "SetExperiencePacket.h" +#include "UpdateMobEffectPacket.h" + +// 1.0.1 Added +#include "ContainerButtonClickPacket.h" +#include "TileEntityDataPacket.h" + +// 1.1 Added (TU9) +#include "CustomPayloadPacket.h" + +// 1.2.3 +#include "RotateHeadPacket.h" + +// 1.3.2 +#include "ChatAutoCompletePacket.h" +#include "ClientCommandPacket.h" +#include "ClientInformationPacket.h" +#include "ClientProtocolPacket.h" +#include "LevelSoundPacket.h" +#include "PlayerAbilitiesPacket.h" +#include "ServerAuthDataPacket.h" +#include "TileDestructionPacket.h" + +// 1.6.4 +#include "LevelParticlesPacket.h" +#include "SetDisplayObjectivePacket.h" +#include "SetObjectivePacket.h" +#include "SetPlayerTeamPacket.h" +#include "SetScorePacket.h" +#include "TileEditorOpenPacket.h" +#include "UpdateAttributesPacket.h" + +// 4J Added +#include "CraftItemPacket.h" +#include "TradeItemPacket.h" +#include "DebugOptionsPacket.h" +#include "ServerSettingsChangedPacket.h" +#include "TexturePacket.h" +#include "TextureAndGeometryPacket.h" +#include "ChunkVisibilityAreaPacket.h" +#include "UpdateProgressPacket.h" +#include "TextureChangePacket.h" +#include "TextureAndGeometryChangePacket.h" +#include "UpdateGameRuleProgressPacket.h" +#include "KickPlayerPacket.h" +#include "XZPacket.h" +#include "GameCommandPacket.h" diff --git a/Minecraft.World/Stats/Achievement.cpp b/Minecraft.World/net/minecraft/stats/Achievement.cpp similarity index 96% rename from Minecraft.World/Stats/Achievement.cpp rename to Minecraft.World/net/minecraft/stats/Achievement.cpp index 76bd0e3a1..573f59dce 100644 --- a/Minecraft.World/Stats/Achievement.cpp +++ b/Minecraft.World/net/minecraft/stats/Achievement.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.locale.h" -#include "../Items/ItemInstance.h" +#include "../../../Header Files/stdafx.h" +#include "../locale/net.minecraft.locale.h" +#include "../world/item/ItemInstance.h" #include "Achievements.h" -#include "../Util/DescFormatter.h" +#include "DescFormatter.h" #include "Achievement.h" /** diff --git a/Minecraft.World/Stats/Achievement.h b/Minecraft.World/net/minecraft/stats/Achievement.h similarity index 100% rename from Minecraft.World/Stats/Achievement.h rename to Minecraft.World/net/minecraft/stats/Achievement.h diff --git a/Minecraft.World/Stats/Achievements.cpp b/Minecraft.World/net/minecraft/stats/Achievements.cpp similarity index 98% rename from Minecraft.World/Stats/Achievements.cpp rename to Minecraft.World/net/minecraft/stats/Achievements.cpp index 8348b7a83..c0959ba0b 100644 --- a/Minecraft.World/Stats/Achievements.cpp +++ b/Minecraft.World/net/minecraft/stats/Achievements.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../Header Files/stdafx.h" +#include "net.minecraft.stats.h" +#include "../world/item/net.minecraft.world.item.h" +#include "../world/level/tile/net.minecraft.world.level.tile.h" #include #include "Achievement.h" #include "Achievements.h" diff --git a/Minecraft.World/Stats/Achievements.h b/Minecraft.World/net/minecraft/stats/Achievements.h similarity index 100% rename from Minecraft.World/Stats/Achievements.h rename to Minecraft.World/net/minecraft/stats/Achievements.h diff --git a/Minecraft.World/Stats/CommonStats.cpp b/Minecraft.World/net/minecraft/stats/CommonStats.cpp similarity index 98% rename from Minecraft.World/Stats/CommonStats.cpp rename to Minecraft.World/net/minecraft/stats/CommonStats.cpp index 2930a070b..9499ba0ad 100644 --- a/Minecraft.World/Stats/CommonStats.cpp +++ b/Minecraft.World/net/minecraft/stats/CommonStats.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "Achievements.h" -#include "../Items/Item.h" -#include "../Blocks/Tile.h" +#include "../world/item/Item.h" +#include "../world/level/tile/Tile.h" #include "CommonStats.h" Stat* CommonStats::get_stat(int i) { return Stats::get(i); } diff --git a/Minecraft.World/Stats/CommonStats.h b/Minecraft.World/net/minecraft/stats/CommonStats.h similarity index 100% rename from Minecraft.World/Stats/CommonStats.h rename to Minecraft.World/net/minecraft/stats/CommonStats.h diff --git a/Minecraft.World/Util/DescFormatter.h b/Minecraft.World/net/minecraft/stats/DescFormatter.h similarity index 100% rename from Minecraft.World/Util/DescFormatter.h rename to Minecraft.World/net/minecraft/stats/DescFormatter.h diff --git a/Minecraft.World/Stats/DurangoStats.h b/Minecraft.World/net/minecraft/stats/DurangoStats.h similarity index 100% rename from Minecraft.World/Stats/DurangoStats.h rename to Minecraft.World/net/minecraft/stats/DurangoStats.h diff --git a/Minecraft.World/Stats/GeneralStat.cpp b/Minecraft.World/net/minecraft/stats/GeneralStat.cpp similarity index 83% rename from Minecraft.World/Stats/GeneralStat.cpp rename to Minecraft.World/net/minecraft/stats/GeneralStat.cpp index ce1d767ac..43f2723d0 100644 --- a/Minecraft.World/Stats/GeneralStat.cpp +++ b/Minecraft.World/net/minecraft/stats/GeneralStat.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.stats.h" +#include "../../../Header Files/stdafx.h" +#include "net.minecraft.stats.h" #include "GeneralStat.h" GeneralStat::GeneralStat(int id, const std::wstring& name, diff --git a/Minecraft.World/Stats/GeneralStat.h b/Minecraft.World/net/minecraft/stats/GeneralStat.h similarity index 100% rename from Minecraft.World/Stats/GeneralStat.h rename to Minecraft.World/net/minecraft/stats/GeneralStat.h diff --git a/Minecraft.World/Stats/GenericStats.cpp b/Minecraft.World/net/minecraft/stats/GenericStats.cpp similarity index 99% rename from Minecraft.World/Stats/GenericStats.cpp rename to Minecraft.World/net/minecraft/stats/GenericStats.cpp index 5a79b03c5..1c4607499 100644 --- a/Minecraft.World/Stats/GenericStats.cpp +++ b/Minecraft.World/net/minecraft/stats/GenericStats.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" -#include "../Entities/Monster.h" +#include "../world/entity/monster/Monster.h" #include "GenericStats.h" diff --git a/Minecraft.World/Stats/GenericStats.h b/Minecraft.World/net/minecraft/stats/GenericStats.h similarity index 99% rename from Minecraft.World/Stats/GenericStats.h rename to Minecraft.World/net/minecraft/stats/GenericStats.h index 2277bf68e..77ef9833b 100644 --- a/Minecraft.World/Stats/GenericStats.h +++ b/Minecraft.World/net/minecraft/stats/GenericStats.h @@ -3,9 +3,9 @@ #include "Stat.h" #include "Stats.h" -// #include "../Util/DamageSource.h" +// #include "../world/damageSource/DamageSource.h" -// #include "../../Minecraft.Client/Platform/Common/Console_Awards_enum.h" +// #include "../../Minecraft.Client/Common/Source Files/Console_Awards_enum.h" /** 4J-JEV: diff --git a/Minecraft.World/Stats/ItemStat.cpp b/Minecraft.World/net/minecraft/stats/ItemStat.cpp similarity index 80% rename from Minecraft.World/Stats/ItemStat.cpp rename to Minecraft.World/net/minecraft/stats/ItemStat.cpp index c39824f9d..d71d770e2 100644 --- a/Minecraft.World/Stats/ItemStat.cpp +++ b/Minecraft.World/net/minecraft/stats/ItemStat.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "ItemStat.h" ItemStat::ItemStat(int id, const std::wstring& name, int itemId) diff --git a/Minecraft.World/Stats/ItemStat.h b/Minecraft.World/net/minecraft/stats/ItemStat.h similarity index 100% rename from Minecraft.World/Stats/ItemStat.h rename to Minecraft.World/net/minecraft/stats/ItemStat.h diff --git a/Minecraft.World/Util/NumberFormatters.h b/Minecraft.World/net/minecraft/stats/NumberFormatters.h similarity index 100% rename from Minecraft.World/Util/NumberFormatters.h rename to Minecraft.World/net/minecraft/stats/NumberFormatters.h diff --git a/Minecraft.World/Stats/Stat.cpp b/Minecraft.World/net/minecraft/stats/Stat.cpp similarity index 97% rename from Minecraft.World/Stats/Stat.cpp rename to Minecraft.World/net/minecraft/stats/Stat.cpp index 64aa04dff..31ba84efb 100644 --- a/Minecraft.World/Stats/Stat.cpp +++ b/Minecraft.World/net/minecraft/stats/Stat.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include -#include "../Util/NumberFormatters.h" +#include "NumberFormatters.h" #include "StatFormatter.h" #include "Stats.h" #include "Stat.h" diff --git a/Minecraft.World/Stats/Stat.h b/Minecraft.World/net/minecraft/stats/Stat.h similarity index 100% rename from Minecraft.World/Stats/Stat.h rename to Minecraft.World/net/minecraft/stats/Stat.h diff --git a/Minecraft.World/Stats/StatFormatter.h b/Minecraft.World/net/minecraft/stats/StatFormatter.h similarity index 100% rename from Minecraft.World/Stats/StatFormatter.h rename to Minecraft.World/net/minecraft/stats/StatFormatter.h diff --git a/Minecraft.World/Stats/Stats.cpp b/Minecraft.World/net/minecraft/stats/Stats.cpp similarity index 98% rename from Minecraft.World/Stats/Stats.cpp rename to Minecraft.World/net/minecraft/stats/Stats.cpp index 00a676fb5..82769b1f1 100644 --- a/Minecraft.World/Stats/Stats.cpp +++ b/Minecraft.World/net/minecraft/stats/Stats.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.locale.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../../../Header Files/stdafx.h" +#include "../locale/net.minecraft.locale.h" +#include "../world/level/tile/net.minecraft.world.level.tile.h" +#include "../world/item/net.minecraft.world.item.h" +#include "../world/entity/item/net.minecraft.world.entity.item.h" +#include "../world/item/crafting/net.minecraft.world.item.crafting.h" #include "Achievements.h" #include "ItemStat.h" #include "GeneralStat.h" #include "Stats.h" -#include "../../Minecraft.Client/GameState/StatsCounter.h" +#include "../../Minecraft.Client/net/minecraft/stats/StatsCounter.h" const int Stats::BLOCKS_MINED_OFFSET = 0x1000000; const int Stats::ITEMS_COLLECTED_OFFSET = 0x1010000; diff --git a/Minecraft.World/Stats/Stats.h b/Minecraft.World/net/minecraft/stats/Stats.h similarity index 100% rename from Minecraft.World/Stats/Stats.h rename to Minecraft.World/net/minecraft/stats/Stats.h diff --git a/Minecraft.World/net/minecraft/stats/net.minecraft.stats.h b/Minecraft.World/net/minecraft/stats/net.minecraft.stats.h new file mode 100644 index 000000000..52cc4afc0 --- /dev/null +++ b/Minecraft.World/net/minecraft/stats/net.minecraft.stats.h @@ -0,0 +1,10 @@ +#pragma once + +#include "Achievement.h" +#include "Achievements.h" +#include "DescFormatter.h" +#include "GeneralStat.h" +#include "ItemStat.h" +#include "Stat.h" +#include "StatFormatter.h" +#include "Stats.h" \ No newline at end of file diff --git a/Minecraft.World/Util/Hasher.cpp b/Minecraft.World/net/minecraft/util/Hasher.cpp similarity index 97% rename from Minecraft.World/Util/Hasher.cpp rename to Minecraft.World/net/minecraft/util/Hasher.cpp index 4a0da53b4..ffc770a33 100644 --- a/Minecraft.World/Util/Hasher.cpp +++ b/Minecraft.World/net/minecraft/util/Hasher.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #if defined(_WIN32) #include #else diff --git a/Minecraft.World/Util/Hasher.h b/Minecraft.World/net/minecraft/util/Hasher.h similarity index 100% rename from Minecraft.World/Util/Hasher.h rename to Minecraft.World/net/minecraft/util/Hasher.h diff --git a/Minecraft.World/Util/HtmlString.cpp b/Minecraft.World/net/minecraft/util/HtmlString.cpp similarity index 96% rename from Minecraft.World/Util/HtmlString.cpp rename to Minecraft.World/net/minecraft/util/HtmlString.cpp index 078f5d2fd..ccff71259 100644 --- a/Minecraft.World/Util/HtmlString.cpp +++ b/Minecraft.World/net/minecraft/util/HtmlString.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "HtmlString.h" #include diff --git a/Minecraft.World/Util/HtmlString.h b/Minecraft.World/net/minecraft/util/HtmlString.h similarity index 100% rename from Minecraft.World/Util/HtmlString.h rename to Minecraft.World/net/minecraft/util/HtmlString.h diff --git a/Minecraft.World/Util/Mth.cpp b/Minecraft.World/net/minecraft/util/Mth.cpp similarity index 97% rename from Minecraft.World/Util/Mth.cpp rename to Minecraft.World/net/minecraft/util/Mth.cpp index 611e53a05..735678197 100644 --- a/Minecraft.World/Util/Mth.cpp +++ b/Minecraft.World/net/minecraft/util/Mth.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "Mth.h" -#include "Random.h" -#include "StringHelpers.h" +#include "../../../ConsoleJavaLibs/Random.h" +#include "../../../ConsoleHelpers/StringHelpers.h" const int Mth::BIG_ENOUGH_INT = 1024; const float Mth::BIG_ENOUGH_FLOAT = BIG_ENOUGH_INT; diff --git a/Minecraft.World/Util/Mth.h b/Minecraft.World/net/minecraft/util/Mth.h similarity index 100% rename from Minecraft.World/Util/Mth.h rename to Minecraft.World/net/minecraft/util/Mth.h diff --git a/Minecraft.World/Util/ProgressListener.h b/Minecraft.World/net/minecraft/util/ProgressListener.h similarity index 100% rename from Minecraft.World/Util/ProgressListener.h rename to Minecraft.World/net/minecraft/util/ProgressListener.h diff --git a/Minecraft.World/Util/SmoothFloat.cpp b/Minecraft.World/net/minecraft/util/SmoothFloat.cpp similarity index 94% rename from Minecraft.World/Util/SmoothFloat.cpp rename to Minecraft.World/net/minecraft/util/SmoothFloat.cpp index dd61b8b3b..e4d68cabc 100644 --- a/Minecraft.World/Util/SmoothFloat.cpp +++ b/Minecraft.World/net/minecraft/util/SmoothFloat.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "SmoothFloat.h" SmoothFloat::SmoothFloat() { diff --git a/Minecraft.World/Util/SmoothFloat.h b/Minecraft.World/net/minecraft/util/SmoothFloat.h similarity index 100% rename from Minecraft.World/Util/SmoothFloat.h rename to Minecraft.World/net/minecraft/util/SmoothFloat.h diff --git a/Minecraft.World/Util/WeighedRandom.cpp b/Minecraft.World/net/minecraft/util/WeighedRandom.cpp similarity index 97% rename from Minecraft.World/Util/WeighedRandom.cpp rename to Minecraft.World/net/minecraft/util/WeighedRandom.cpp index ece44e353..237030d3e 100644 --- a/Minecraft.World/Util/WeighedRandom.cpp +++ b/Minecraft.World/net/minecraft/util/WeighedRandom.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "WeighedRandom.h" int WeighedRandom::getTotalWeight(std::vector* items) { diff --git a/Minecraft.World/Util/WeighedRandom.h b/Minecraft.World/net/minecraft/util/WeighedRandom.h similarity index 100% rename from Minecraft.World/Util/WeighedRandom.h rename to Minecraft.World/net/minecraft/util/WeighedRandom.h diff --git a/Minecraft.World/Util/WeighedTreasure.cpp b/Minecraft.World/net/minecraft/util/WeighedTreasure.cpp similarity index 94% rename from Minecraft.World/Util/WeighedTreasure.cpp rename to Minecraft.World/net/minecraft/util/WeighedTreasure.cpp index 8b1a98b86..0e9a919ae 100644 --- a/Minecraft.World/Util/WeighedTreasure.cpp +++ b/Minecraft.World/net/minecraft/util/WeighedTreasure.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../Header Files/stdafx.h" +#include "../world/level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../world/item/net.minecraft.world.item.h" #include "WeighedRandom.h" #include "WeighedTreasure.h" diff --git a/Minecraft.World/Util/WeighedTreasure.h b/Minecraft.World/net/minecraft/util/WeighedTreasure.h similarity index 100% rename from Minecraft.World/Util/WeighedTreasure.h rename to Minecraft.World/net/minecraft/util/WeighedTreasure.h diff --git a/Minecraft.World/Containers/CompoundContainer.cpp b/Minecraft.World/net/minecraft/world/CompoundContainer.cpp similarity index 94% rename from Minecraft.World/Containers/CompoundContainer.cpp rename to Minecraft.World/net/minecraft/world/CompoundContainer.cpp index 2a5c37f99..67611a993 100644 --- a/Minecraft.World/Containers/CompoundContainer.cpp +++ b/Minecraft.World/net/minecraft/world/CompoundContainer.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Network/Packets/ContainerOpenPacket.h" +#include "../../../Header Files/stdafx.h" +#include "entity/player/net.minecraft.world.entity.player.h" +#include "../network/packet/ContainerOpenPacket.h" #include "CompoundContainer.h" CompoundContainer::CompoundContainer(int name, std::shared_ptr c1, diff --git a/Minecraft.World/Containers/CompoundContainer.h b/Minecraft.World/net/minecraft/world/CompoundContainer.h similarity index 100% rename from Minecraft.World/Containers/CompoundContainer.h rename to Minecraft.World/net/minecraft/world/CompoundContainer.h diff --git a/Minecraft.World/Containers/Container.h b/Minecraft.World/net/minecraft/world/Container.h similarity index 100% rename from Minecraft.World/Containers/Container.h rename to Minecraft.World/net/minecraft/world/Container.h diff --git a/Minecraft.World/Util/Difficulty.h b/Minecraft.World/net/minecraft/world/Difficulty.h similarity index 100% rename from Minecraft.World/Util/Difficulty.h rename to Minecraft.World/net/minecraft/world/Difficulty.h diff --git a/Minecraft.World/Util/FlippedIcon.cpp b/Minecraft.World/net/minecraft/world/FlippedIcon.cpp similarity index 95% rename from Minecraft.World/Util/FlippedIcon.cpp rename to Minecraft.World/net/minecraft/world/FlippedIcon.cpp index 3064189f8..eae05d67b 100644 --- a/Minecraft.World/Util/FlippedIcon.cpp +++ b/Minecraft.World/net/minecraft/world/FlippedIcon.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" #include "FlippedIcon.h" -#include "SharedConstants.h" +#include "../SharedConstants.h" FlippedIcon::FlippedIcon(Icon* base, bool horizontal, bool vertical) : base(base), horizontal(horizontal), vertical(vertical) {} diff --git a/Minecraft.World/Util/FlippedIcon.h b/Minecraft.World/net/minecraft/world/FlippedIcon.h similarity index 100% rename from Minecraft.World/Util/FlippedIcon.h rename to Minecraft.World/net/minecraft/world/FlippedIcon.h diff --git a/Minecraft.World/Util/Icon.h b/Minecraft.World/net/minecraft/world/Icon.h similarity index 100% rename from Minecraft.World/Util/Icon.h rename to Minecraft.World/net/minecraft/world/Icon.h diff --git a/Minecraft.World/Util/IconRegister.h b/Minecraft.World/net/minecraft/world/IconRegister.h similarity index 100% rename from Minecraft.World/Util/IconRegister.h rename to Minecraft.World/net/minecraft/world/IconRegister.h diff --git a/Minecraft.World/Containers/MouseInventoryClickHandler.h b/Minecraft.World/net/minecraft/world/MouseInventoryClickHandler.h similarity index 100% rename from Minecraft.World/Containers/MouseInventoryClickHandler.h rename to Minecraft.World/net/minecraft/world/MouseInventoryClickHandler.h diff --git a/Minecraft.World/Containers/SimpleContainer.cpp b/Minecraft.World/net/minecraft/world/SimpleContainer.cpp similarity index 95% rename from Minecraft.World/Containers/SimpleContainer.cpp rename to Minecraft.World/net/minecraft/world/SimpleContainer.cpp index 59f7a0d39..2e3e9fe59 100644 --- a/Minecraft.World/Containers/SimpleContainer.cpp +++ b/Minecraft.World/net/minecraft/world/SimpleContainer.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../Header Files/stdafx.h" -#include "../Headers/net.minecraft.world.ContainerListener.h" -#include "../Headers/net.minecraft.world.item.h" +#include "net.minecraft.world.ContainerListener.h" +#include "item/net.minecraft.world.item.h" #include "SimpleContainer.h" diff --git a/Minecraft.World/Containers/SimpleContainer.h b/Minecraft.World/net/minecraft/world/SimpleContainer.h similarity index 96% rename from Minecraft.World/Containers/SimpleContainer.h rename to Minecraft.World/net/minecraft/world/SimpleContainer.h index e9164c1eb..fcd91d44c 100644 --- a/Minecraft.World/Containers/SimpleContainer.h +++ b/Minecraft.World/net/minecraft/world/SimpleContainer.h @@ -1,7 +1,7 @@ #pragma once #include "Container.h" -#include "../Headers/net.minecraft.world.ContainerListener.h" +#include "net.minecraft.world.ContainerListener.h" class SimpleContainer : public Container { private: diff --git a/Minecraft.World/Containers/WorldlyContainer.h b/Minecraft.World/net/minecraft/world/WorldlyContainer.h similarity index 100% rename from Minecraft.World/Containers/WorldlyContainer.h rename to Minecraft.World/net/minecraft/world/WorldlyContainer.h diff --git a/Minecraft.World/Util/CombatEntry.cpp b/Minecraft.World/net/minecraft/world/damageSource/CombatEntry.cpp similarity index 91% rename from Minecraft.World/Util/CombatEntry.cpp rename to Minecraft.World/net/minecraft/world/damageSource/CombatEntry.cpp index ddc933b3c..a83934d31 100644 --- a/Minecraft.World/Util/CombatEntry.cpp +++ b/Minecraft.World/net/minecraft/world/damageSource/CombatEntry.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.damagesource.h" +#include "../entity/net.minecraft.world.entity.h" #include "CombatEntry.h" #include diff --git a/Minecraft.World/Util/CombatEntry.h b/Minecraft.World/net/minecraft/world/damageSource/CombatEntry.h similarity index 100% rename from Minecraft.World/Util/CombatEntry.h rename to Minecraft.World/net/minecraft/world/damageSource/CombatEntry.h diff --git a/Minecraft.World/Util/CombatTracker.cpp b/Minecraft.World/net/minecraft/world/damageSource/CombatTracker.cpp similarity index 96% rename from Minecraft.World/Util/CombatTracker.cpp rename to Minecraft.World/net/minecraft/world/damageSource/CombatTracker.cpp index f607a972b..00591cc99 100644 --- a/Minecraft.World/Util/CombatTracker.cpp +++ b/Minecraft.World/net/minecraft/world/damageSource/CombatTracker.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.damagesource.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "net.minecraft.world.damagesource.h" #include "CombatTracker.h" CombatTracker::CombatTracker(LivingEntity* mob) { this->mob = mob; } diff --git a/Minecraft.World/Util/CombatTracker.h b/Minecraft.World/net/minecraft/world/damageSource/CombatTracker.h similarity index 97% rename from Minecraft.World/Util/CombatTracker.h rename to Minecraft.World/net/minecraft/world/damageSource/CombatTracker.h index 9a37ad8b4..3fa4a65fa 100644 --- a/Minecraft.World/Util/CombatTracker.h +++ b/Minecraft.World/net/minecraft/world/damageSource/CombatTracker.h @@ -1,6 +1,6 @@ #pragma once -#include "SharedConstants.h" +#include "../../SharedConstants.h" class CombatEntry; class LivingEntity; diff --git a/Minecraft.World/Util/DamageSource.cpp b/Minecraft.World/net/minecraft/world/damageSource/DamageSource.cpp similarity index 94% rename from Minecraft.World/Util/DamageSource.cpp rename to Minecraft.World/net/minecraft/world/damageSource/DamageSource.cpp index c5c8271f5..9995110a3 100644 --- a/Minecraft.World/Util/DamageSource.cpp +++ b/Minecraft.World/net/minecraft/world/damageSource/DamageSource.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../level/net.minecraft.world.level.h" +#include "net.minecraft.world.damagesource.h" +#include "../food/net.minecraft.world.food.h" +#include "../../network/packet/net.minecraft.network.packet.h" DamageSource* DamageSource::inFire = (new DamageSource(ChatPacket::e_ChatDeathInFire, diff --git a/Minecraft.World/Util/DamageSource.h b/Minecraft.World/net/minecraft/world/damageSource/DamageSource.h similarity index 98% rename from Minecraft.World/Util/DamageSource.h rename to Minecraft.World/net/minecraft/world/damageSource/DamageSource.h index 0c7467372..ea3626ced 100644 --- a/Minecraft.World/Util/DamageSource.h +++ b/Minecraft.World/net/minecraft/world/damageSource/DamageSource.h @@ -7,7 +7,7 @@ class Fireball; class Player; class Explosion; -#include "../Network/Packets/ChatPacket.h" +#include "../../network/packet/ChatPacket.h" class DamageSource { public: diff --git a/Minecraft.World/Entities/EntityDamageSource.cpp b/Minecraft.World/net/minecraft/world/damageSource/EntityDamageSource.cpp similarity index 88% rename from Minecraft.World/Entities/EntityDamageSource.cpp rename to Minecraft.World/net/minecraft/world/damageSource/EntityDamageSource.cpp index ea5f0afd0..ae259ec1f 100644 --- a/Minecraft.World/Entities/EntityDamageSource.cpp +++ b/Minecraft.World/net/minecraft/world/damageSource/EntityDamageSource.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/net.minecraft.world.entity.h" +#include "net.minecraft.world.damagesource.h" +#include "../../network/packet/net.minecraft.network.packet.h" // EntityDamageSource::EntityDamageSource(const wstring &msgId, // shared_ptr entity) : DamageSource(msgId) diff --git a/Minecraft.World/Entities/EntityDamageSource.h b/Minecraft.World/net/minecraft/world/damageSource/EntityDamageSource.h similarity index 96% rename from Minecraft.World/Entities/EntityDamageSource.h rename to Minecraft.World/net/minecraft/world/damageSource/EntityDamageSource.h index 9e4b2cbec..85970ac0a 100644 --- a/Minecraft.World/Entities/EntityDamageSource.h +++ b/Minecraft.World/net/minecraft/world/damageSource/EntityDamageSource.h @@ -1,6 +1,6 @@ #pragma once -#include "../Util/DamageSource.h" +#include "DamageSource.h" class Entity; class Player; diff --git a/Minecraft.World/Entities/IndirectEntityDamageSource.cpp b/Minecraft.World/net/minecraft/world/damageSource/IndirectEntityDamageSource.cpp similarity index 89% rename from Minecraft.World/Entities/IndirectEntityDamageSource.cpp rename to Minecraft.World/net/minecraft/world/damageSource/IndirectEntityDamageSource.cpp index 5b3695493..3e5e2532a 100644 --- a/Minecraft.World/Entities/IndirectEntityDamageSource.cpp +++ b/Minecraft.World/net/minecraft/world/damageSource/IndirectEntityDamageSource.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/net.minecraft.world.entity.h" +#include "net.minecraft.world.damagesource.h" +#include "../../network/packet/net.minecraft.network.packet.h" // IndirectEntityDamageSource::IndirectEntityDamageSource(const wstring &msgId, // shared_ptr entity, shared_ptr owner) : diff --git a/Minecraft.World/Entities/IndirectEntityDamageSource.h b/Minecraft.World/net/minecraft/world/damageSource/IndirectEntityDamageSource.h similarity index 100% rename from Minecraft.World/Entities/IndirectEntityDamageSource.h rename to Minecraft.World/net/minecraft/world/damageSource/IndirectEntityDamageSource.h diff --git a/Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h b/Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h new file mode 100644 index 000000000..df0ccd8f6 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h @@ -0,0 +1,7 @@ +#pragma once + +#include "CombatEntry.h" +#include "CombatTracker.h" +#include "DamageSource.h" +#include "EntityDamageSource.h" +#include "IndirectEntityDamageSource.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/AbsoptionMobEffect.cpp b/Minecraft.World/net/minecraft/world/effect/AbsoptionMobEffect.cpp similarity index 86% rename from Minecraft.World/Entities/AbsoptionMobEffect.cpp rename to Minecraft.World/net/minecraft/world/effect/AbsoptionMobEffect.cpp index 56a1812a6..cfd812332 100644 --- a/Minecraft.World/Entities/AbsoptionMobEffect.cpp +++ b/Minecraft.World/net/minecraft/world/effect/AbsoptionMobEffect.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.effect.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "net.minecraft.world.effect.h" #include "AbsoptionMobEffect.h" AbsoptionMobEffect::AbsoptionMobEffect(int id, bool isHarmful, diff --git a/Minecraft.World/Entities/AbsoptionMobEffect.h b/Minecraft.World/net/minecraft/world/effect/AbsoptionMobEffect.h similarity index 100% rename from Minecraft.World/Entities/AbsoptionMobEffect.h rename to Minecraft.World/net/minecraft/world/effect/AbsoptionMobEffect.h diff --git a/Minecraft.World/Entities/AttackDamageMobEffect.cpp b/Minecraft.World/net/minecraft/world/effect/AttackDamageMobEffect.cpp similarity index 91% rename from Minecraft.World/Entities/AttackDamageMobEffect.cpp rename to Minecraft.World/net/minecraft/world/effect/AttackDamageMobEffect.cpp index d79a5454e..1ffad03d1 100644 --- a/Minecraft.World/Entities/AttackDamageMobEffect.cpp +++ b/Minecraft.World/net/minecraft/world/effect/AttackDamageMobEffect.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "AttackDamageMobEffect.h" diff --git a/Minecraft.World/Entities/AttackDamageMobEffect.h b/Minecraft.World/net/minecraft/world/effect/AttackDamageMobEffect.h similarity index 100% rename from Minecraft.World/Entities/AttackDamageMobEffect.h rename to Minecraft.World/net/minecraft/world/effect/AttackDamageMobEffect.h diff --git a/Minecraft.World/Entities/HealthBoostMobEffect.cpp b/Minecraft.World/net/minecraft/world/effect/HealthBoostMobEffect.cpp similarity index 85% rename from Minecraft.World/Entities/HealthBoostMobEffect.cpp rename to Minecraft.World/net/minecraft/world/effect/HealthBoostMobEffect.cpp index 09c30f8f9..a829fbc63 100644 --- a/Minecraft.World/Entities/HealthBoostMobEffect.cpp +++ b/Minecraft.World/net/minecraft/world/effect/HealthBoostMobEffect.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" #include "HealthBoostMobEffect.h" HealthBoostMobEffect::HealthBoostMobEffect(int id, bool isHarmful, diff --git a/Minecraft.World/Entities/HealthBoostMobEffect.h b/Minecraft.World/net/minecraft/world/effect/HealthBoostMobEffect.h similarity index 100% rename from Minecraft.World/Entities/HealthBoostMobEffect.h rename to Minecraft.World/net/minecraft/world/effect/HealthBoostMobEffect.h diff --git a/Minecraft.World/Entities/InstantaneousMobEffect.cpp b/Minecraft.World/net/minecraft/world/effect/InstantaneousMobEffect.cpp similarity index 83% rename from Minecraft.World/Entities/InstantaneousMobEffect.cpp rename to Minecraft.World/net/minecraft/world/effect/InstantaneousMobEffect.cpp index 6821f59b3..b1161ca72 100644 --- a/Minecraft.World/Entities/InstantaneousMobEffect.cpp +++ b/Minecraft.World/net/minecraft/world/effect/InstantaneousMobEffect.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.effect.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.effect.h" InstantenousMobEffect::InstantenousMobEffect(int id, bool isHarmful, eMinecraftColour color) diff --git a/Minecraft.World/Entities/InstantaneousMobEffect.h b/Minecraft.World/net/minecraft/world/effect/InstantaneousMobEffect.h similarity index 100% rename from Minecraft.World/Entities/InstantaneousMobEffect.h rename to Minecraft.World/net/minecraft/world/effect/InstantaneousMobEffect.h diff --git a/Minecraft.World/Entities/MobEffect.cpp b/Minecraft.World/net/minecraft/world/effect/MobEffect.cpp similarity index 97% rename from Minecraft.World/Entities/MobEffect.cpp rename to Minecraft.World/net/minecraft/world/effect/MobEffect.cpp index 418cbb7bd..73c545122 100644 --- a/Minecraft.World/Entities/MobEffect.cpp +++ b/Minecraft.World/net/minecraft/world/effect/MobEffect.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Util/SharedConstants.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/monster/net.minecraft.world.entity.monster.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../level/net.minecraft.world.level.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../food/net.minecraft.world.food.h" +#include "net.minecraft.world.effect.h" +#include "../../SharedConstants.h" MobEffect* MobEffect::effects[NUM_EFFECTS]; diff --git a/Minecraft.World/Entities/MobEffect.h b/Minecraft.World/net/minecraft/world/effect/MobEffect.h similarity index 98% rename from Minecraft.World/Entities/MobEffect.h rename to Minecraft.World/net/minecraft/world/effect/MobEffect.h index 5576a2b4b..de9794103 100644 --- a/Minecraft.World/Entities/MobEffect.h +++ b/Minecraft.World/net/minecraft/world/effect/MobEffect.h @@ -1,6 +1,6 @@ #pragma once -#include "../AI/Attributes/AttributeModifier.h" +#include "../entity/ai/attributes/AttributeModifier.h" class Mob; class MobEffectInstance; diff --git a/Minecraft.World/Entities/MobEffectInstance.cpp b/Minecraft.World/net/minecraft/world/effect/MobEffectInstance.cpp similarity index 98% rename from Minecraft.World/Entities/MobEffectInstance.cpp rename to Minecraft.World/net/minecraft/world/effect/MobEffectInstance.cpp index f81d97f84..470200ceb 100644 --- a/Minecraft.World/Entities/MobEffectInstance.cpp +++ b/Minecraft.World/net/minecraft/world/effect/MobEffectInstance.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.effect.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.effect.h" void MobEffectInstance::_init(int id, int duration, int amplifier) { this->id = id; diff --git a/Minecraft.World/Entities/MobEffectInstance.h b/Minecraft.World/net/minecraft/world/effect/MobEffectInstance.h similarity index 100% rename from Minecraft.World/Entities/MobEffectInstance.h rename to Minecraft.World/net/minecraft/world/effect/MobEffectInstance.h diff --git a/Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h b/Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h new file mode 100644 index 000000000..5a545cddf --- /dev/null +++ b/Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h @@ -0,0 +1,8 @@ +#pragma once + +#include "AbsoptionMobEffect.h" +#include "AttackDamageMobEffect.h" +#include "HealthBoostMobEffect.h" +#include "MobEffect.h" +#include "InstantaneousMobEffect.h" +#include "MobEffectInstance.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/AgeableMob.cpp b/Minecraft.World/net/minecraft/world/entity/AgeableMob.cpp similarity index 91% rename from Minecraft.World/Entities/Mobs/AgeableMob.cpp rename to Minecraft.World/net/minecraft/world/entity/AgeableMob.cpp index 7069b991e..81f7c36ba 100644 --- a/Minecraft.World/Entities/Mobs/AgeableMob.cpp +++ b/Minecraft.World/net/minecraft/world/entity/AgeableMob.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../SyncedEntityData.h" -#include "../../Stats/GenericStats.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.h" +#include "player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "SyncedEntityData.h" +#include "../../stats/GenericStats.h" #include "AgeableMob.h" AgableMob::AgableMob(Level* level) : PathfinderMob(level) { diff --git a/Minecraft.World/Entities/Mobs/AgeableMob.h b/Minecraft.World/net/minecraft/world/entity/AgeableMob.h similarity index 96% rename from Minecraft.World/Entities/Mobs/AgeableMob.h rename to Minecraft.World/net/minecraft/world/entity/AgeableMob.h index 5815a2347..af10b6c25 100644 --- a/Minecraft.World/Entities/Mobs/AgeableMob.h +++ b/Minecraft.World/net/minecraft/world/entity/AgeableMob.h @@ -1,6 +1,6 @@ #pragma once -#include "../PathfinderMob.h" +#include "PathfinderMob.h" class AgableMob : public PathfinderMob { private: diff --git a/Minecraft.World/net/minecraft/world/entity/Creature.cpp b/Minecraft.World/net/minecraft/world/entity/Creature.cpp new file mode 100644 index 000000000..6aafa8d30 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/Creature.cpp @@ -0,0 +1,2 @@ +#include "../../../../Header Files/stdafx.h" +#include "Creature.h" diff --git a/Minecraft.World/Entities/Mobs/Creature.h b/Minecraft.World/net/minecraft/world/entity/Creature.h similarity index 76% rename from Minecraft.World/Entities/Mobs/Creature.h rename to Minecraft.World/net/minecraft/world/entity/Creature.h index 0e542690c..5f2e14c58 100644 --- a/Minecraft.World/Entities/Mobs/Creature.h +++ b/Minecraft.World/net/minecraft/world/entity/Creature.h @@ -1,5 +1,5 @@ #pragma once -#include "../Entity.h" +#include "Entity.h" class Level; diff --git a/Minecraft.World/Util/DelayedRelease.cpp b/Minecraft.World/net/minecraft/world/entity/DelayedRelease.cpp similarity index 88% rename from Minecraft.World/Util/DelayedRelease.cpp rename to Minecraft.World/net/minecraft/world/entity/DelayedRelease.cpp index 629178e0c..d31deac4c 100644 --- a/Minecraft.World/Util/DelayedRelease.cpp +++ b/Minecraft.World/net/minecraft/world/entity/DelayedRelease.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" #include "DelayedRelease.h" DelayedRelease::DelayedRelease(Level* level, std::shared_ptr toRelease, diff --git a/Minecraft.World/Util/DelayedRelease.h b/Minecraft.World/net/minecraft/world/entity/DelayedRelease.h similarity index 95% rename from Minecraft.World/Util/DelayedRelease.h rename to Minecraft.World/net/minecraft/world/entity/DelayedRelease.h index deef6e8c0..f1614ec4d 100644 --- a/Minecraft.World/Util/DelayedRelease.h +++ b/Minecraft.World/net/minecraft/world/entity/DelayedRelease.h @@ -1,6 +1,6 @@ #pragma once -#include "../Entities/Entity.h" +#include "Entity.h" class DamageSource; diff --git a/Minecraft.World/Entities/Entity.cpp b/Minecraft.World/net/minecraft/world/entity/Entity.cpp similarity index 97% rename from Minecraft.World/Entities/Entity.cpp rename to Minecraft.World/net/minecraft/world/entity/Entity.cpp index a7dbc71e3..d1051baf5 100644 --- a/Minecraft.World/Entities/Entity.cpp +++ b/Minecraft.World/net/minecraft/world/entity/Entity.cpp @@ -1,31 +1,31 @@ -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.damagesource.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/dimension/net.minecraft.world.level.dimension.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "item/net.minecraft.world.entity.item.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../damageSource/net.minecraft.world.damagesource.h" #include "SyncedEntityData.h" -#include "../Level/Storage/EntityIO.h" -#include "../Util/SharedConstants.h" +#include "EntityIO.h" +#include "../../SharedConstants.h" -#include "../Util/ParticleTypes.h" +#include "../../../../Header Files/ParticleTypes.h" #include "EntityPos.h" #include "Entity.h" -#include "../Util/SoundTypes.h" -#include "../../Minecraft.Client/Rendering/Models/HumanoidModel.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" +#include "../../../../Header Files/SoundTypes.h" +#include "../../Minecraft.Client/net/minecraft/client/model/HumanoidModel.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include #include -#include "../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Minecraft.Client/Network/PlayerList.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../Minecraft.Client/net/minecraft/server/PlayerList.h" thread_local bool Entity::m_tlsUseSmallIds = false; diff --git a/Minecraft.World/Entities/Entity.h b/Minecraft.World/net/minecraft/world/entity/Entity.h similarity index 98% rename from Minecraft.World/Entities/Entity.h rename to Minecraft.World/net/minecraft/world/entity/Entity.h index 485a2ae57..7d4d6c768 100644 --- a/Minecraft.World/Entities/Entity.h +++ b/Minecraft.World/net/minecraft/world/entity/Entity.h @@ -1,11 +1,11 @@ #pragma once -#include "../IO/NBT/ListTag.h" -#include "../IO/NBT/DoubleTag.h" -#include "../IO/NBT/FloatTag.h" -#include "../Util/Vec3.h" -#include "../Util/Definitions.h" -#include "../Util/AABB.h" +#include "../../../../com/mojang/nbt/ListTag.h" +#include "../../../../com/mojang/nbt/DoubleTag.h" +#include "../../../../com/mojang/nbt/FloatTag.h" +#include "../phys/Vec3.h" +#include "../../../../ConsoleHelpers/Definitions.h" +#include "../phys/AABB.h" #include #include diff --git a/Minecraft.World/Entities/EntityEvent.h b/Minecraft.World/net/minecraft/world/entity/EntityEvent.h similarity index 100% rename from Minecraft.World/Entities/EntityEvent.h rename to Minecraft.World/net/minecraft/world/entity/EntityEvent.h diff --git a/Minecraft.World/Level/Storage/EntityIO.cpp b/Minecraft.World/net/minecraft/world/entity/EntityIO.cpp similarity index 95% rename from Minecraft.World/Level/Storage/EntityIO.cpp rename to Minecraft.World/net/minecraft/world/entity/EntityIO.cpp index 4023f1f4a..ea4c301cb 100644 --- a/Minecraft.World/Level/Storage/EntityIO.cpp +++ b/Minecraft.World/net/minecraft/world/entity/EntityIO.cpp @@ -1,19 +1,19 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/Class.h" -#include "../../Entities/Mobs/Painting.h" -#include "../../Platform/System.h" -#include "../../Entities/Entity.h" -#include "../../Entities/Mobs/WitherBoss.h" -#include "../../Headers/net.minecraft.world.entity.ambient.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/Class.h" +#include "Painting.h" +#include "../../../../ConsoleJavaLibs/System.h" +#include "Entity.h" +#include "boss/wither/WitherBoss.h" +#include "ambient/net.minecraft.world.entity.ambient.h" +#include "animal/net.minecraft.world.entity.animal.h" +#include "item/net.minecraft.world.entity.item.h" +#include "monster/net.minecraft.world.entity.monster.h" +#include "projectile/net.minecraft.world.entity.projectile.h" +#include "boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "npc/net.minecraft.world.entity.npc.h" +#include "net.minecraft.world.entity.h" +#include "../level/net.minecraft.world.level.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "EntityIO.h" std::unordered_map* EntityIO::idCreateMap = diff --git a/Minecraft.World/Level/Storage/EntityIO.h b/Minecraft.World/net/minecraft/world/entity/EntityIO.h similarity index 97% rename from Minecraft.World/Level/Storage/EntityIO.h rename to Minecraft.World/net/minecraft/world/entity/EntityIO.h index db7737405..93ca1afe0 100644 --- a/Minecraft.World/Level/Storage/EntityIO.h +++ b/Minecraft.World/net/minecraft/world/entity/EntityIO.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Entities/Entity.h" -#include "../../Util/JavaIntHash.h" +#include "Entity.h" +#include "../../../../ConsoleJavaLibs/JavaIntHash.h" class Level; class CompoundTag; diff --git a/Minecraft.World/Entities/EntityPos.cpp b/Minecraft.World/net/minecraft/world/entity/EntityPos.cpp similarity index 96% rename from Minecraft.World/Entities/EntityPos.cpp rename to Minecraft.World/net/minecraft/world/entity/EntityPos.cpp index bd5813f5d..72981740f 100644 --- a/Minecraft.World/Entities/EntityPos.cpp +++ b/Minecraft.World/net/minecraft/world/entity/EntityPos.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "Entity.h" #include "EntityPos.h" diff --git a/Minecraft.World/Entities/EntityPos.h b/Minecraft.World/net/minecraft/world/entity/EntityPos.h similarity index 100% rename from Minecraft.World/Entities/EntityPos.h rename to Minecraft.World/net/minecraft/world/entity/EntityPos.h diff --git a/Minecraft.World/Entities/EntitySelector.cpp b/Minecraft.World/net/minecraft/world/entity/EntitySelector.cpp similarity index 94% rename from Minecraft.World/Entities/EntitySelector.cpp rename to Minecraft.World/net/minecraft/world/entity/EntitySelector.cpp index a4e79f855..413fce4bd 100644 --- a/Minecraft.World/Entities/EntitySelector.cpp +++ b/Minecraft.World/net/minecraft/world/entity/EntitySelector.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Containers/Container.h" +#include "../../../../Header Files/stdafx.h" +#include "../Container.h" #include "EntitySelector.h" const EntitySelector* EntitySelector::ENTITY_STILL_ALIVE = diff --git a/Minecraft.World/Entities/EntitySelector.h b/Minecraft.World/net/minecraft/world/entity/EntitySelector.h similarity index 100% rename from Minecraft.World/Entities/EntitySelector.h rename to Minecraft.World/net/minecraft/world/entity/EntitySelector.h diff --git a/Minecraft.World/Entities/Mobs/ExperienceOrb.cpp b/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp similarity index 92% rename from Minecraft.World/Entities/Mobs/ExperienceOrb.cpp rename to Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp index a187fea38..1309325e7 100644 --- a/Minecraft.World/Entities/Mobs/ExperienceOrb.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Util/JavaMath.h" -#include "../../Util/SharedConstants.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../SharedConstants.h" #include "ExperienceOrb.h" -#include "../../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" const int ExperienceOrb::LIFETIME = 5 * 60 * SharedConstants::TICKS_PER_SECOND; // Five minutes! diff --git a/Minecraft.World/Entities/Mobs/ExperienceOrb.h b/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.h similarity index 98% rename from Minecraft.World/Entities/Mobs/ExperienceOrb.h rename to Minecraft.World/net/minecraft/world/entity/ExperienceOrb.h index 0ecd4de42..4cd328f68 100644 --- a/Minecraft.World/Entities/Mobs/ExperienceOrb.h +++ b/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.h @@ -1,6 +1,6 @@ #pragma once -#include "../Entity.h" +#include "Entity.h" class ExperienceOrb : public Entity { public: diff --git a/Minecraft.World/Entities/FlyingMob.cpp b/Minecraft.World/net/minecraft/world/entity/FlyingMob.cpp similarity index 91% rename from Minecraft.World/Entities/FlyingMob.cpp rename to Minecraft.World/net/minecraft/world/entity/FlyingMob.cpp index 6a38c457d..8d3213217 100644 --- a/Minecraft.World/Entities/FlyingMob.cpp +++ b/Minecraft.World/net/minecraft/world/entity/FlyingMob.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" #include "FlyingMob.h" FlyingMob::FlyingMob(Level* level) : Mob(level) {} diff --git a/Minecraft.World/Entities/FlyingMob.h b/Minecraft.World/net/minecraft/world/entity/FlyingMob.h similarity index 100% rename from Minecraft.World/Entities/FlyingMob.h rename to Minecraft.World/net/minecraft/world/entity/FlyingMob.h diff --git a/Minecraft.World/Entities/HangingEntity.cpp b/Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp similarity index 95% rename from Minecraft.World/Entities/HangingEntity.cpp rename to Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp index 2e4ed9359..04c6ab578 100644 --- a/Minecraft.World/Entities/HangingEntity.cpp +++ b/Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../Header Files/stdafx.h" +#include "../phys/net.minecraft.world.phys.h" +#include "net.minecraft.world.entity.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/net.minecraft.world.level.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "HangingEntity.h" void HangingEntity::_init(Level* level) { diff --git a/Minecraft.World/Entities/HangingEntity.h b/Minecraft.World/net/minecraft/world/entity/HangingEntity.h similarity index 100% rename from Minecraft.World/Entities/HangingEntity.h rename to Minecraft.World/net/minecraft/world/entity/HangingEntity.h diff --git a/Minecraft.World/Entities/Mobs/ItemFrame.cpp b/Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp similarity index 88% rename from Minecraft.World/Entities/Mobs/ItemFrame.cpp rename to Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp index 2485a3ab6..44699ac36 100644 --- a/Minecraft.World/Entities/Mobs/ItemFrame.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.saveddata.h" -#include "../../Headers/com.mojang.nbt.h" +#include "item/net.minecraft.world.entity.item.h" +#include "../item/net.minecraft.world.item.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/net.minecraft.world.level.h" +#include "player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "ItemFrame.h" // 4J - added for common ctor code diff --git a/Minecraft.World/Entities/Mobs/ItemFrame.h b/Minecraft.World/net/minecraft/world/entity/ItemFrame.h similarity index 95% rename from Minecraft.World/Entities/Mobs/ItemFrame.h rename to Minecraft.World/net/minecraft/world/entity/ItemFrame.h index 58a7394d4..b603fb52d 100644 --- a/Minecraft.World/Entities/Mobs/ItemFrame.h +++ b/Minecraft.World/net/minecraft/world/entity/ItemFrame.h @@ -1,7 +1,7 @@ #pragma once -#include "../Entity.h" -#include "../HangingEntity.h" +#include "Entity.h" +#include "HangingEntity.h" class Level; diff --git a/Minecraft.World/Entities/LeashFenceKnotEntity.cpp b/Minecraft.World/net/minecraft/world/entity/LeashFenceKnotEntity.cpp similarity index 95% rename from Minecraft.World/Entities/LeashFenceKnotEntity.cpp rename to Minecraft.World/net/minecraft/world/entity/LeashFenceKnotEntity.cpp index c5be63212..757ba1daf 100644 --- a/Minecraft.World/Entities/LeashFenceKnotEntity.cpp +++ b/Minecraft.World/net/minecraft/world/entity/LeashFenceKnotEntity.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../Header Files/stdafx.h" +#include "player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../phys/net.minecraft.world.phys.h" #include "LeashFenceKnotEntity.h" void LeashFenceKnotEntity::_init() { defineSynchedData(); } diff --git a/Minecraft.World/Entities/LeashFenceKnotEntity.h b/Minecraft.World/net/minecraft/world/entity/LeashFenceKnotEntity.h similarity index 100% rename from Minecraft.World/Entities/LeashFenceKnotEntity.h rename to Minecraft.World/net/minecraft/world/entity/LeashFenceKnotEntity.h diff --git a/Minecraft.World/Entities/LivingEntity.cpp b/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp similarity index 96% rename from Minecraft.World/Entities/LivingEntity.cpp rename to Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp index ef84a0837..b867e4b9c 100644 --- a/Minecraft.World/Entities/LivingEntity.cpp +++ b/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp @@ -1,38 +1,38 @@ -#include "../Platform/stdafx.h" -#include "../Util/JavaMath.h" -#include "../Util/Mth.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.ai.control.h" -#include "../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.chunk.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.item.alchemy.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.scores.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../util/Mth.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "net.minecraft.world.entity.h" +#include "ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "ai/control/net.minecraft.world.entity.ai.control.h" +#include "ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "ai/sensing/net.minecraft.world.entity.ai.sensing.h" +#include "player/net.minecraft.world.entity.player.h" +#include "animal/net.minecraft.world.entity.animal.h" +#include "monster/net.minecraft.world.entity.monster.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/chunk/net.minecraft.world.level.chunk.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../effect/net.minecraft.world.effect.h" +#include "../item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../scores/net.minecraft.world.scores.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "LivingEntity.h" #include -#include "../../Minecraft.Client/Textures/Textures.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Minecraft.Client/Player/EntityTracker.h" -#include "../Util/SoundTypes.h" -#include "../Util/ParticleTypes.h" -#include "../Stats/GenericStats.h" -#include "ItemEntity.h" -#include "Util/Vec3.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../Minecraft.Client/net/minecraft/server/level/EntityTracker.h" +#include "../../../../Header Files/SoundTypes.h" +#include "../../../../Header Files/ParticleTypes.h" +#include "../../stats/GenericStats.h" +#include "item/ItemEntity.h" +#include "../phys/Vec3.h" const double LivingEntity::MIN_MOVEMENT_DISTANCE = 0.005; diff --git a/Minecraft.World/Entities/LivingEntity.h b/Minecraft.World/net/minecraft/world/entity/LivingEntity.h similarity index 99% rename from Minecraft.World/Entities/LivingEntity.h rename to Minecraft.World/net/minecraft/world/entity/LivingEntity.h index ec20a24a9..1fad17157 100644 --- a/Minecraft.World/Entities/LivingEntity.h +++ b/Minecraft.World/net/minecraft/world/entity/LivingEntity.h @@ -3,8 +3,8 @@ #include #include "Entity.h" #include "MobType.h" -#include "../AI/Goals/GoalSelector.h" -#include "../Util/SharedConstants.h" +#include "ai/goal/GoalSelector.h" +#include "../../SharedConstants.h" class CombatTracker; class AttributeInstance; diff --git a/Minecraft.World/Entities/Mob.cpp b/Minecraft.World/net/minecraft/world/entity/Mob.cpp similarity index 94% rename from Minecraft.World/Entities/Mob.cpp rename to Minecraft.World/net/minecraft/world/entity/Mob.cpp index 270b5d112..798e311d9 100644 --- a/Minecraft.World/Entities/Mob.cpp +++ b/Minecraft.World/net/minecraft/world/entity/Mob.cpp @@ -1,33 +1,33 @@ -#include "../Platform/stdafx.h" -#include "../Util/JavaMath.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.ai.control.h" -#include "../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.item.alchemy.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Minecraft.Client/Player/EntityTracker.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "net.minecraft.world.entity.h" +#include "ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "ai/control/net.minecraft.world.entity.ai.control.h" +#include "ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "ai/sensing/net.minecraft.world.entity.ai.sensing.h" +#include "player/net.minecraft.world.entity.player.h" +#include "animal/net.minecraft.world.entity.animal.h" +#include "monster/net.minecraft.world.entity.monster.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../effect/net.minecraft.world.effect.h" +#include "../item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../net.minecraft.world.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../Minecraft.Client/net/minecraft/server/level/EntityTracker.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Mob.h" -#include "../../Minecraft.Client/Textures/Textures.h" -#include "../Util/SoundTypes.h" -#include "../Util/ParticleTypes.h" -#include "../Stats/GenericStats.h" -#include "ItemEntity.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../Header Files/SoundTypes.h" +#include "../../../../Header Files/ParticleTypes.h" +#include "../../stats/GenericStats.h" +#include "item/ItemEntity.h" const float Mob::MAX_WEARING_ARMOR_CHANCE = 0.15f; const float Mob::MAX_PICKUP_LOOT_CHANCE = 0.55f; diff --git a/Minecraft.World/Entities/Mob.h b/Minecraft.World/net/minecraft/world/entity/Mob.h similarity index 99% rename from Minecraft.World/Entities/Mob.h rename to Minecraft.World/net/minecraft/world/entity/Mob.h index 28723d342..bbc157ee7 100644 --- a/Minecraft.World/Entities/Mob.h +++ b/Minecraft.World/net/minecraft/world/entity/Mob.h @@ -2,7 +2,7 @@ #include "LivingEntity.h" #include "MobType.h" -#include "../AI/Goals/GoalSelector.h" +#include "ai/goal/GoalSelector.h" class HitResult; class Level; diff --git a/Minecraft.World/Entities/MobCategory.cpp b/Minecraft.World/net/minecraft/world/entity/MobCategory.cpp similarity index 93% rename from Minecraft.World/Entities/MobCategory.cpp rename to Minecraft.World/net/minecraft/world/entity/MobCategory.cpp index 9f3c15840..b744784f9 100644 --- a/Minecraft.World/Entities/MobCategory.cpp +++ b/Minecraft.World/net/minecraft/world/entity/MobCategory.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "Mobs/Creature.h" -#include "../Blocks/Material.h" +#include "../../../../Header Files/stdafx.h" +#include "animal/net.minecraft.world.entity.animal.h" +#include "monster/net.minecraft.world.entity.monster.h" +#include "Creature.h" +#include "../level/material/Material.h" #include "MobCategory.h" MobCategory* MobCategory::monster = nullptr; diff --git a/Minecraft.World/Entities/MobCategory.h b/Minecraft.World/net/minecraft/world/entity/MobCategory.h similarity index 100% rename from Minecraft.World/Entities/MobCategory.h rename to Minecraft.World/net/minecraft/world/entity/MobCategory.h diff --git a/Minecraft.World/Entities/Mobs/MobGroupData.h b/Minecraft.World/net/minecraft/world/entity/MobGroupData.h similarity index 100% rename from Minecraft.World/Entities/Mobs/MobGroupData.h rename to Minecraft.World/net/minecraft/world/entity/MobGroupData.h diff --git a/Minecraft.World/Entities/MobType.h b/Minecraft.World/net/minecraft/world/entity/MobType.h similarity index 100% rename from Minecraft.World/Entities/MobType.h rename to Minecraft.World/net/minecraft/world/entity/MobType.h diff --git a/Minecraft.World/Entities/OwnableEntity.h b/Minecraft.World/net/minecraft/world/entity/OwnableEntity.h similarity index 100% rename from Minecraft.World/Entities/OwnableEntity.h rename to Minecraft.World/net/minecraft/world/entity/OwnableEntity.h diff --git a/Minecraft.World/Entities/Mobs/Painting.cpp b/Minecraft.World/net/minecraft/world/entity/Painting.cpp similarity index 91% rename from Minecraft.World/Entities/Mobs/Painting.cpp rename to Minecraft.World/net/minecraft/world/entity/Painting.cpp index 534a1169f..ccc916946 100644 --- a/Minecraft.World/Entities/Mobs/Painting.cpp +++ b/Minecraft.World/net/minecraft/world/entity/Painting.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../Header Files/stdafx.h" +#include "../phys/net.minecraft.world.phys.h" +#include "item/net.minecraft.world.entity.item.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Painting.h" -#include "../../Blocks/Material.h" +#include "../level/material/Material.h" typedef Painting::Motive _Motive; const _Motive* Painting::Motive::values[] = { diff --git a/Minecraft.World/Entities/Mobs/Painting.h b/Minecraft.World/net/minecraft/world/entity/Painting.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Painting.h rename to Minecraft.World/net/minecraft/world/entity/Painting.h index bf7b8d2b5..51d8e24b2 100644 --- a/Minecraft.World/Entities/Mobs/Painting.h +++ b/Minecraft.World/net/minecraft/world/entity/Painting.h @@ -1,7 +1,7 @@ #pragma once -#include "../Entity.h" -#include "../HangingEntity.h" +#include "Entity.h" +#include "HangingEntity.h" class Level; class CompoundTag; diff --git a/Minecraft.World/Entities/PathfinderMob.cpp b/Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp similarity index 95% rename from Minecraft.World/Entities/PathfinderMob.cpp rename to Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp index b87662e2b..068d72d27 100644 --- a/Minecraft.World/Entities/PathfinderMob.cpp +++ b/Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.pathfinder.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Util/SharedConstants.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.h" +#include "animal/net.minecraft.world.entity.animal.h" +#include "ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "monster/net.minecraft.world.entity.monster.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../../SharedConstants.h" #include "PathfinderMob.h" AttributeModifier* PathfinderMob::SPEED_MODIFIER_FLEEING = diff --git a/Minecraft.World/Entities/PathfinderMob.h b/Minecraft.World/net/minecraft/world/entity/PathfinderMob.h similarity index 100% rename from Minecraft.World/Entities/PathfinderMob.h rename to Minecraft.World/net/minecraft/world/entity/PathfinderMob.h diff --git a/Minecraft.World/Entities/SyncedEntityData.cpp b/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp similarity index 98% rename from Minecraft.World/Entities/SyncedEntityData.cpp rename to Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp index 74dcc1bdd..d4abc7998 100644 --- a/Minecraft.World/Entities/SyncedEntityData.cpp +++ b/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Util/Class.h" -#include "../IO/Streams/InputOutputStream.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/Class.h" +#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../net.minecraft.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../item/net.minecraft.world.item.h" #include "SyncedEntityData.h" SynchedEntityData::SynchedEntityData() { diff --git a/Minecraft.World/Entities/SyncedEntityData.h b/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.h similarity index 100% rename from Minecraft.World/Entities/SyncedEntityData.h rename to Minecraft.World/net/minecraft/world/entity/SyncedEntityData.h diff --git a/Minecraft.World/Entities/TamableAnimal.cpp b/Minecraft.World/net/minecraft/world/entity/TamableAnimal.cpp similarity index 94% rename from Minecraft.World/Entities/TamableAnimal.cpp rename to Minecraft.World/net/minecraft/world/entity/TamableAnimal.cpp index 858ccf63c..72992b5fc 100644 --- a/Minecraft.World/Entities/TamableAnimal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/TamableAnimal.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "net.minecraft.world.entity.h" +#include "../level/net.minecraft.world.level.h" #include "SyncedEntityData.h" -#include "../Util/ParticleTypes.h" +#include "../../../../Header Files/ParticleTypes.h" #include "TamableAnimal.h" TamableAnimal::TamableAnimal(Level* level) : Animal(level) { diff --git a/Minecraft.World/Entities/TamableAnimal.h b/Minecraft.World/net/minecraft/world/entity/TamableAnimal.h similarity index 97% rename from Minecraft.World/Entities/TamableAnimal.h rename to Minecraft.World/net/minecraft/world/entity/TamableAnimal.h index 9a9aa12d3..952235668 100644 --- a/Minecraft.World/Entities/TamableAnimal.h +++ b/Minecraft.World/net/minecraft/world/entity/TamableAnimal.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Animal.h" +#include "animal/Animal.h" #include "OwnableEntity.h" class SitGoal; diff --git a/Minecraft.World/AI/Attributes/Attribute.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/Attribute.cpp similarity index 90% rename from Minecraft.World/AI/Attributes/Attribute.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/Attribute.cpp index 50fe7d1bf..ad02acdc2 100644 --- a/Minecraft.World/AI/Attributes/Attribute.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/Attribute.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Attribute.h" const int Attribute::AttributeNames[] = { diff --git a/Minecraft.World/AI/Attributes/Attribute.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/Attribute.h similarity index 100% rename from Minecraft.World/AI/Attributes/Attribute.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/Attribute.h diff --git a/Minecraft.World/AI/Attributes/AttributeInstance.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeInstance.h similarity index 100% rename from Minecraft.World/AI/Attributes/AttributeInstance.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeInstance.h diff --git a/Minecraft.World/AI/Attributes/AttributeModifier.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.cpp similarity index 97% rename from Minecraft.World/AI/Attributes/AttributeModifier.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.cpp index 4c505e231..b2c455eeb 100644 --- a/Minecraft.World/AI/Attributes/AttributeModifier.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "AttributeModifier.h" -#include "../../Util/HtmlString.h" +#include "../../../../util/HtmlString.h" void AttributeModifier::_init(eMODIFIER_ID id, const std::wstring name, double amount, int operation) { diff --git a/Minecraft.World/AI/Attributes/AttributeModifier.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.h similarity index 100% rename from Minecraft.World/AI/Attributes/AttributeModifier.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.h diff --git a/Minecraft.World/AI/Attributes/BaseAttribute.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttribute.cpp similarity index 90% rename from Minecraft.World/AI/Attributes/BaseAttribute.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttribute.cpp index 4e80e8054..0ad423ca9 100644 --- a/Minecraft.World/AI/Attributes/BaseAttribute.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttribute.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "BaseAttribute.h" diff --git a/Minecraft.World/AI/Attributes/BaseAttribute.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttribute.h similarity index 100% rename from Minecraft.World/AI/Attributes/BaseAttribute.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttribute.h diff --git a/Minecraft.World/AI/Attributes/BaseAttributeMap.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttributeMap.cpp similarity index 94% rename from Minecraft.World/AI/Attributes/BaseAttributeMap.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttributeMap.cpp index 3cb0e0dc8..768f3ebae 100644 --- a/Minecraft.World/AI/Attributes/BaseAttributeMap.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttributeMap.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.ai.attributes.h" #include "BaseAttributeMap.h" BaseAttributeMap::~BaseAttributeMap() { diff --git a/Minecraft.World/AI/Attributes/BaseAttributeMap.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttributeMap.h similarity index 100% rename from Minecraft.World/AI/Attributes/BaseAttributeMap.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/BaseAttributeMap.h diff --git a/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/ModifiableAttributeInstance.cpp similarity index 97% rename from Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/ModifiableAttributeInstance.cpp index 865a71375..ab44b51b1 100644 --- a/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/ModifiableAttributeInstance.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.ai.attributes.h" #include "ModifiableAttributeInstance.h" ModifiableAttributeInstance::ModifiableAttributeInstance( diff --git a/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/ModifiableAttributeInstance.h similarity index 100% rename from Minecraft.World/AI/Attributes/ModifiableAttributeInstance.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/ModifiableAttributeInstance.h diff --git a/Minecraft.World/AI/Attributes/RangedAttribute.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/RangedAttribute.cpp similarity index 94% rename from Minecraft.World/AI/Attributes/RangedAttribute.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/RangedAttribute.cpp index ccbdaaad6..b4c1556cd 100644 --- a/Minecraft.World/AI/Attributes/RangedAttribute.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/RangedAttribute.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "RangedAttribute.h" diff --git a/Minecraft.World/AI/Attributes/RangedAttribute.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/RangedAttribute.h similarity index 100% rename from Minecraft.World/AI/Attributes/RangedAttribute.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/RangedAttribute.h diff --git a/Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp b/Minecraft.World/net/minecraft/world/entity/ai/attributes/ServersideAttributeMap.cpp similarity index 97% rename from Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/ServersideAttributeMap.cpp index a678ac6d7..901fcc7b2 100644 --- a/Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/ServersideAttributeMap.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Attribute.h" #include "RangedAttribute.h" diff --git a/Minecraft.World/AI/Attributes/ServersideAttributeMap.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/ServersideAttributeMap.h similarity index 100% rename from Minecraft.World/AI/Attributes/ServersideAttributeMap.h rename to Minecraft.World/net/minecraft/world/entity/ai/attributes/ServersideAttributeMap.h diff --git a/Minecraft.World/net/minecraft/world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h b/Minecraft.World/net/minecraft/world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h new file mode 100644 index 000000000..783f48b57 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h @@ -0,0 +1,10 @@ +#pragma once + +#include "Attribute.h" +#include "AttributeInstance.h" +#include "AttributeModifier.h" +#include "BaseAttribute.h" +#include "BaseAttributeMap.h" +#include "ModifiableAttributeInstance.h" +#include "RangedAttribute.h" +#include "ServersideAttributeMap.h" \ No newline at end of file diff --git a/Minecraft.World/AI/Control/BodyControl.cpp b/Minecraft.World/net/minecraft/world/entity/ai/control/BodyControl.cpp similarity index 90% rename from Minecraft.World/AI/Control/BodyControl.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/control/BodyControl.cpp index 787951c75..db6da03a5 100644 --- a/Minecraft.World/AI/Control/BodyControl.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/control/BodyControl.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.ai.control.h" #include "BodyControl.h" const float BodyControl::maxClampAngle = 75.0f; diff --git a/Minecraft.World/AI/Control/BodyControl.h b/Minecraft.World/net/minecraft/world/entity/ai/control/BodyControl.h similarity index 100% rename from Minecraft.World/AI/Control/BodyControl.h rename to Minecraft.World/net/minecraft/world/entity/ai/control/BodyControl.h diff --git a/Minecraft.World/AI/Control/Control.h b/Minecraft.World/net/minecraft/world/entity/ai/control/Control.h similarity index 100% rename from Minecraft.World/AI/Control/Control.h rename to Minecraft.World/net/minecraft/world/entity/ai/control/Control.h diff --git a/Minecraft.World/AI/Control/JumpControl.cpp b/Minecraft.World/net/minecraft/world/entity/ai/control/JumpControl.cpp similarity index 69% rename from Minecraft.World/AI/Control/JumpControl.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/control/JumpControl.cpp index 6cf8d3cc5..fee781cc1 100644 --- a/Minecraft.World/AI/Control/JumpControl.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/control/JumpControl.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" #include "JumpControl.h" JumpControl::JumpControl(Mob* mob) { diff --git a/Minecraft.World/AI/Control/JumpControl.h b/Minecraft.World/net/minecraft/world/entity/ai/control/JumpControl.h similarity index 100% rename from Minecraft.World/AI/Control/JumpControl.h rename to Minecraft.World/net/minecraft/world/entity/ai/control/JumpControl.h diff --git a/Minecraft.World/AI/Control/LookControl.cpp b/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp similarity index 91% rename from Minecraft.World/AI/Control/LookControl.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp index c956da61d..3fc8a02e7 100644 --- a/Minecraft.World/AI/Control/LookControl.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "LookControl.h" LookControl::LookControl(Mob* mob) { diff --git a/Minecraft.World/AI/Control/LookControl.h b/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.h similarity index 100% rename from Minecraft.World/AI/Control/LookControl.h rename to Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.h diff --git a/Minecraft.World/AI/Control/MoveControl.cpp b/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp similarity index 82% rename from Minecraft.World/AI/Control/MoveControl.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp index 684ccd498..483e02fb2 100644 --- a/Minecraft.World/AI/Control/MoveControl.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.ai.control.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "MoveControl.h" const float MoveControl::MIN_SPEED = 0.0005f; diff --git a/Minecraft.World/AI/Control/MoveControl.h b/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.h similarity index 100% rename from Minecraft.World/AI/Control/MoveControl.h rename to Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.h diff --git a/Minecraft.World/net/minecraft/world/entity/ai/control/net.minecraft.world.entity.ai.control.h b/Minecraft.World/net/minecraft/world/entity/ai/control/net.minecraft.world.entity.ai.control.h new file mode 100644 index 000000000..d0a3e7832 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/control/net.minecraft.world.entity.ai.control.h @@ -0,0 +1,7 @@ +#pragma once + +#include "Control.h" +#include "BodyControl.h" +#include "JumpControl.h" +#include "LookControl.h" +#include "MoveControl.h" \ No newline at end of file diff --git a/Minecraft.World/AI/Goals/AvoidPlayerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/AvoidPlayerGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/AvoidPlayerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/AvoidPlayerGoal.cpp index 9288a7d93..39fce93c0 100644 --- a/Minecraft.World/AI/Goals/AvoidPlayerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/AvoidPlayerGoal.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../sensing/net.minecraft.world.entity.ai.sensing.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../../net.minecraft.world.entity.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "AvoidPlayerGoal.h" AvoidPlayerGoalEntitySelector::AvoidPlayerGoalEntitySelector( diff --git a/Minecraft.World/AI/Goals/AvoidPlayerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/AvoidPlayerGoal.h similarity index 96% rename from Minecraft.World/AI/Goals/AvoidPlayerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/AvoidPlayerGoal.h index 9376dd750..238c6f8fe 100644 --- a/Minecraft.World/AI/Goals/AvoidPlayerGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/AvoidPlayerGoal.h @@ -1,7 +1,7 @@ #pragma once #include "Goal.h" -#include "../../Entities/EntitySelector.h" +#include "../../EntitySelector.h" class PathNavigation; class PathfinderMob; diff --git a/Minecraft.World/AI/Goals/BegGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/BegGoal.cpp similarity index 82% rename from Minecraft.World/AI/Goals/BegGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/BegGoal.cpp index 2f31740bb..91d5b295f 100644 --- a/Minecraft.World/AI/Goals/BegGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/BegGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../player/net.minecraft.world.entity.player.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../item/net.minecraft.world.item.h" #include "BegGoal.h" BegGoal::BegGoal(Wolf* wolf, float lookDistance) { diff --git a/Minecraft.World/AI/Goals/BegGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/BegGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/BegGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/BegGoal.h diff --git a/Minecraft.World/AI/Goals/BreakDoorGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreakDoorGoal.cpp similarity index 85% rename from Minecraft.World/AI/Goals/BreakDoorGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/BreakDoorGoal.cpp index 26e210e86..adcb92346 100644 --- a/Minecraft.World/AI/Goals/BreakDoorGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreakDoorGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Util/SharedConstants.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../net.minecraft.world.h" +#include "../../../../SharedConstants.h" #include "BreakDoorGoal.h" BreakDoorGoal::BreakDoorGoal(Mob* mob) : DoorInteractGoal(mob) { diff --git a/Minecraft.World/AI/Goals/BreakDoorGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreakDoorGoal.h similarity index 90% rename from Minecraft.World/AI/Goals/BreakDoorGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/BreakDoorGoal.h index 4912d9121..43ff82536 100644 --- a/Minecraft.World/AI/Goals/BreakDoorGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreakDoorGoal.h @@ -1,7 +1,7 @@ #pragma once #include "DoorInteractGoal.h" -#include "../../Util/SharedConstants.h" +#include "../../../../SharedConstants.h" class BreakDoorGoal : public DoorInteractGoal { private: diff --git a/Minecraft.World/AI/Goals/BreedGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreedGoal.cpp similarity index 90% rename from Minecraft.World/AI/Goals/BreedGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/BreedGoal.cpp index ea219158f..75393f182 100644 --- a/Minecraft.World/AI/Goals/BreedGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreedGoal.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "BreedGoal.h" #include -#include "../../Entities/Mobs/ExperienceOrb.h" +#include "../../ExperienceOrb.h" -#include "../../Stats/GenericStats.h" +#include "../../../../stats/GenericStats.h" BreedGoal::BreedGoal(Animal* animal, double speedModifier) { partner = std::weak_ptr(); diff --git a/Minecraft.World/AI/Goals/BreedGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/BreedGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/BreedGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/BreedGoal.h diff --git a/Minecraft.World/AI/Goals/ControlledByPlayerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp similarity index 91% rename from Minecraft.World/AI/Goals/ControlledByPlayerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp index f32574982..2d4eeb79b 100644 --- a/Minecraft.World/AI/Goals/ControlledByPlayerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../level/pathfinder/net.minecraft.world.level.pathfinder.h" #include "ControlledByPlayerGoal.h" ControlledByPlayerGoal::ControlledByPlayerGoal(Mob* mob, float maxSpeed, diff --git a/Minecraft.World/AI/Goals/ControlledByPlayerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.h similarity index 93% rename from Minecraft.World/AI/Goals/ControlledByPlayerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.h index 06fa210de..bd992ea2a 100644 --- a/Minecraft.World/AI/Goals/ControlledByPlayerGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.h @@ -1,7 +1,7 @@ #pragma once #include "Goal.h" -#include "../Minecraft.World/Util/SharedConstants.h" +#include "../../../../SharedConstants.h" class Mob; diff --git a/Minecraft.World/AI/Goals/DoorInteractGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/DoorInteractGoal.cpp similarity index 83% rename from Minecraft.World/AI/Goals/DoorInteractGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/DoorInteractGoal.cpp index 117c3fb66..c153f1af8 100644 --- a/Minecraft.World/AI/Goals/DoorInteractGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/DoorInteractGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" #include "DoorInteractGoal.h" DoorInteractGoal::DoorInteractGoal(Mob* mob) { diff --git a/Minecraft.World/AI/Goals/DoorInteractGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/DoorInteractGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/DoorInteractGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/DoorInteractGoal.h diff --git a/Minecraft.World/AI/Goals/EatTileGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/EatTileGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/EatTileGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/EatTileGoal.cpp index 3354ee702..6b2782a26 100644 --- a/Minecraft.World/AI/Goals/EatTileGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/EatTileGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" #include "EatTileGoal.h" EatTileGoal::EatTileGoal(Mob* mob) { diff --git a/Minecraft.World/AI/Goals/EatTileGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/EatTileGoal.h similarity index 94% rename from Minecraft.World/AI/Goals/EatTileGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/EatTileGoal.h index 73a8baaa2..b22aa9394 100644 --- a/Minecraft.World/AI/Goals/EatTileGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/EatTileGoal.h @@ -1,7 +1,7 @@ #pragma once #include "Goal.h" -#include "../../Util/SharedConstants.h" +#include "../../../../SharedConstants.h" // note: Mob should implement handleEntityEvent for client state, also ate to // take action upon eating diff --git a/Minecraft.World/AI/Goals/FleeSunGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/FleeSunGoal.cpp similarity index 80% rename from Minecraft.World/AI/Goals/FleeSunGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FleeSunGoal.cpp index 4f35fb567..8c7a442b6 100644 --- a/Minecraft.World/AI/Goals/FleeSunGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/FleeSunGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "FleeSunGoal.h" #include diff --git a/Minecraft.World/AI/Goals/FleeSunGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/FleeSunGoal.h similarity index 94% rename from Minecraft.World/AI/Goals/FleeSunGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FleeSunGoal.h index e9cce5983..b2a7fbb56 100644 --- a/Minecraft.World/AI/Goals/FleeSunGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/FleeSunGoal.h @@ -2,7 +2,7 @@ #include -#include "../../Util/Vec3.h" +#include "../../../phys/Vec3.h" #include "Goal.h" class FleeSunGoal : public Goal { diff --git a/Minecraft.World/AI/Goals/FloatGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/FloatGoal.cpp similarity index 62% rename from Minecraft.World/AI/Goals/FloatGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FloatGoal.cpp index e69794d0e..aceda0d62 100644 --- a/Minecraft.World/AI/Goals/FloatGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/FloatGoal.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" #include "FloatGoal.h" FloatGoal::FloatGoal(Mob* mob) { diff --git a/Minecraft.World/AI/Goals/FloatGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/FloatGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/FloatGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FloatGoal.h diff --git a/Minecraft.World/AI/Goals/FollowOwnerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.cpp similarity index 87% rename from Minecraft.World/AI/Goals/FollowOwnerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.cpp index 627823b09..dfcc91b39 100644 --- a/Minecraft.World/AI/Goals/FollowOwnerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "FollowOwnerGoal.h" FollowOwnerGoal::FollowOwnerGoal(TamableAnimal* tamable, double speedModifier, diff --git a/Minecraft.World/AI/Goals/FollowOwnerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/FollowOwnerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.h diff --git a/Minecraft.World/AI/Goals/FollowParentGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/FollowParentGoal.cpp similarity index 85% rename from Minecraft.World/AI/Goals/FollowParentGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FollowParentGoal.cpp index ae6ff0b70..1a8dfc4fa 100644 --- a/Minecraft.World/AI/Goals/FollowParentGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/FollowParentGoal.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "FollowParentGoal.h" #include diff --git a/Minecraft.World/AI/Goals/FollowParentGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/FollowParentGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/FollowParentGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/FollowParentGoal.h diff --git a/Minecraft.World/AI/Goals/Goal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/Goal.cpp similarity index 88% rename from Minecraft.World/AI/Goals/Goal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/Goal.cpp index e4ea68fb4..3e47f4251 100644 --- a/Minecraft.World/AI/Goals/Goal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/Goal.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Goal.h" Goal::Goal() { _requiredControlFlags = 0; } diff --git a/Minecraft.World/AI/Goals/Goal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/Goal.h similarity index 100% rename from Minecraft.World/AI/Goals/Goal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/Goal.h diff --git a/Minecraft.World/AI/Goals/GoalSelector.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/GoalSelector.cpp similarity index 98% rename from Minecraft.World/AI/Goals/GoalSelector.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/GoalSelector.cpp index 22facd8fd..62432d92e 100644 --- a/Minecraft.World/AI/Goals/GoalSelector.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/GoalSelector.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Goal.h" #include "GoalSelector.h" diff --git a/Minecraft.World/AI/Goals/GoalSelector.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/GoalSelector.h similarity index 100% rename from Minecraft.World/AI/Goals/GoalSelector.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/GoalSelector.h diff --git a/Minecraft.World/AI/Goals/InteractGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/InteractGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/InteractGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/InteractGoal.cpp index bb70da2d3..4a66753f8 100644 --- a/Minecraft.World/AI/Goals/InteractGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/InteractGoal.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" #include "InteractGoal.h" InteractGoal::InteractGoal(Mob* mob, const std::type_info& lookAtType, diff --git a/Minecraft.World/AI/Goals/InteractGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/InteractGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/InteractGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/InteractGoal.h diff --git a/Minecraft.World/AI/Goals/LeapAtTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/LeapAtTargetGoal.cpp similarity index 87% rename from Minecraft.World/AI/Goals/LeapAtTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/LeapAtTargetGoal.cpp index deeabe955..a00e3cddb 100644 --- a/Minecraft.World/AI/Goals/LeapAtTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/LeapAtTargetGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../net.minecraft.world.entity.h" #include "LeapAtTargetGoal.h" LeapAtTargetGoal::LeapAtTargetGoal(Mob* mob, float yd) { diff --git a/Minecraft.World/AI/Goals/LeapAtTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/LeapAtTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/LeapAtTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/LeapAtTargetGoal.h diff --git a/Minecraft.World/AI/Goals/LookAtPlayerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.cpp similarity index 87% rename from Minecraft.World/AI/Goals/LookAtPlayerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.cpp index 6f81859ff..e89bd5529 100644 --- a/Minecraft.World/AI/Goals/LookAtPlayerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "LookAtPlayerGoal.h" LookAtPlayerGoal::LookAtPlayerGoal(Mob* mob, const std::type_info& lookAtType, diff --git a/Minecraft.World/AI/Goals/LookAtPlayerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/LookAtPlayerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.h diff --git a/Minecraft.World/AI/Goals/LookAtTradingPlayerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtTradingPlayerGoal.cpp similarity index 72% rename from Minecraft.World/AI/Goals/LookAtTradingPlayerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtTradingPlayerGoal.cpp index 00c733695..78c7e6f1a 100644 --- a/Minecraft.World/AI/Goals/LookAtTradingPlayerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtTradingPlayerGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../player/net.minecraft.world.entity.player.h" +#include "../../npc/net.minecraft.world.entity.npc.h" #include "LookAtTradingPlayerGoal.h" LookAtTradingPlayerGoal::LookAtTradingPlayerGoal(Villager* villager) diff --git a/Minecraft.World/AI/Goals/LookAtTradingPlayerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtTradingPlayerGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/LookAtTradingPlayerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/LookAtTradingPlayerGoal.h diff --git a/Minecraft.World/AI/Goals/MakeLoveGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/MakeLoveGoal.cpp similarity index 88% rename from Minecraft.World/AI/Goals/MakeLoveGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MakeLoveGoal.cpp index 4aa24c0db..8b541e5bd 100644 --- a/Minecraft.World/AI/Goals/MakeLoveGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/MakeLoveGoal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../village/net.minecraft.world.entity.ai.village.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../npc/net.minecraft.world.entity.npc.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "MakeLoveGoal.h" MakeLoveGoal::MakeLoveGoal(Villager* villager) { diff --git a/Minecraft.World/AI/Goals/MakeLoveGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/MakeLoveGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/MakeLoveGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MakeLoveGoal.h diff --git a/Minecraft.World/AI/Goals/MeleeAttackGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/MeleeAttackGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/MeleeAttackGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MeleeAttackGoal.cpp index 989a355b6..4aa25fadf 100644 --- a/Minecraft.World/AI/Goals/MeleeAttackGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/MeleeAttackGoal.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../Navigation/Path.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../../level/pathfinder/Path.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../sensing/net.minecraft.world.entity.ai.sensing.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "MeleeAttackGoal.h" void MeleeAttackGoal::_init(PathfinderMob* mob, double speedModifier, diff --git a/Minecraft.World/AI/Goals/MeleeAttackGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/MeleeAttackGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/MeleeAttackGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MeleeAttackGoal.h diff --git a/Minecraft.World/AI/Goals/MoveIndoorsGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveIndoorsGoal.cpp similarity index 82% rename from Minecraft.World/AI/Goals/MoveIndoorsGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveIndoorsGoal.cpp index d9eddea58..64967527c 100644 --- a/Minecraft.World/AI/Goals/MoveIndoorsGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveIndoorsGoal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../village/net.minecraft.world.entity.ai.village.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/dimension/net.minecraft.world.level.dimension.h" #include "MoveIndoorsGoal.h" MoveIndoorsGoal::MoveIndoorsGoal(PathfinderMob* mob) { diff --git a/Minecraft.World/AI/Goals/MoveIndoorsGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveIndoorsGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/MoveIndoorsGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveIndoorsGoal.h diff --git a/Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveThroughVillageGoal.cpp similarity index 90% rename from Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveThroughVillageGoal.cpp index 7b4b56a14..3a4be0632 100644 --- a/Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveThroughVillageGoal.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../village/net.minecraft.world.entity.ai.village.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" #include "MoveThroughVillageGoal.h" #include -#include "../Navigation/Path.h" +#include "../../../level/pathfinder/Path.h" MoveThroughVillageGoal::MoveThroughVillageGoal(PathfinderMob* mob, double speedModifier, diff --git a/Minecraft.World/AI/Goals/MoveThroughVillageGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveThroughVillageGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/MoveThroughVillageGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveThroughVillageGoal.h diff --git a/Minecraft.World/AI/Goals/MoveTowardsRestrictionGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsRestrictionGoal.cpp similarity index 75% rename from Minecraft.World/AI/Goals/MoveTowardsRestrictionGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsRestrictionGoal.cpp index cb52d4c3b..54401a934 100644 --- a/Minecraft.World/AI/Goals/MoveTowardsRestrictionGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsRestrictionGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" #include "MoveTowardsRestrictionGoal.h" MoveTowardsRestrictionGoal::MoveTowardsRestrictionGoal(PathfinderMob* mob, diff --git a/Minecraft.World/AI/Goals/MoveTowardsRestrictionGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsRestrictionGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/MoveTowardsRestrictionGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsRestrictionGoal.h diff --git a/Minecraft.World/AI/Goals/MoveTowardsTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsTargetGoal.cpp similarity index 81% rename from Minecraft.World/AI/Goals/MoveTowardsTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsTargetGoal.cpp index 613cbfd3f..eeb56fa66 100644 --- a/Minecraft.World/AI/Goals/MoveTowardsTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsTargetGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "MoveTowardsTargetGoal.h" MoveTowardsTargetGoal::MoveTowardsTargetGoal(PathfinderMob* mob, diff --git a/Minecraft.World/AI/Goals/MoveTowardsTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/MoveTowardsTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/MoveTowardsTargetGoal.h diff --git a/Minecraft.World/AI/Goals/OcelotAttackGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotAttackGoal.cpp similarity index 83% rename from Minecraft.World/AI/Goals/OcelotAttackGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotAttackGoal.cpp index 5169093d3..7b6152575 100644 --- a/Minecraft.World/AI/Goals/OcelotAttackGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotAttackGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "OcelotAttackGoal.h" OcelotAttackGoal::OcelotAttackGoal(Mob* mob) { diff --git a/Minecraft.World/AI/Goals/OcelotAttackGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotAttackGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/OcelotAttackGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotAttackGoal.h diff --git a/Minecraft.World/AI/Goals/OcelotSitOnTileGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp similarity index 86% rename from Minecraft.World/AI/Goals/OcelotSitOnTileGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp index 058565138..98eade3cd 100644 --- a/Minecraft.World/AI/Goals/OcelotSitOnTileGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Util/Arrays.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "net.minecraft.world.entity.ai.goal.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../ConsoleJavaLibs/Arrays.h" #include "OcelotSitOnTileGoal.h" #include diff --git a/Minecraft.World/AI/Goals/OcelotSitOnTileGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/OcelotSitOnTileGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.h diff --git a/Minecraft.World/AI/Goals/OfferFlowerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/OfferFlowerGoal.cpp similarity index 76% rename from Minecraft.World/AI/Goals/OfferFlowerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OfferFlowerGoal.cpp index 7d6b64a37..49c367559 100644 --- a/Minecraft.World/AI/Goals/OfferFlowerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/OfferFlowerGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../npc/net.minecraft.world.entity.npc.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "OfferFlowerGoal.h" OfferFlowerGoal::OfferFlowerGoal(VillagerGolem* golem) { diff --git a/Minecraft.World/AI/Goals/OfferFlowerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/OfferFlowerGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/OfferFlowerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OfferFlowerGoal.h diff --git a/Minecraft.World/AI/Goals/OpenDoorGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/OpenDoorGoal.cpp similarity index 79% rename from Minecraft.World/AI/Goals/OpenDoorGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OpenDoorGoal.cpp index e13f88c00..6c607fee9 100644 --- a/Minecraft.World/AI/Goals/OpenDoorGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/OpenDoorGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" #include "OpenDoorGoal.h" OpenDoorGoal::OpenDoorGoal(Mob* mob, bool closeDoorAfter) diff --git a/Minecraft.World/AI/Goals/OpenDoorGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/OpenDoorGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/OpenDoorGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/OpenDoorGoal.h diff --git a/Minecraft.World/AI/Goals/PanicGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/PanicGoal.cpp similarity index 76% rename from Minecraft.World/AI/Goals/PanicGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/PanicGoal.cpp index 23f3e7213..ea57ecdd6 100644 --- a/Minecraft.World/AI/Goals/PanicGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/PanicGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "PanicGoal.h" PanicGoal::PanicGoal(PathfinderMob* mob, double speedModifier) { diff --git a/Minecraft.World/AI/Goals/PanicGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/PanicGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/PanicGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/PanicGoal.h diff --git a/Minecraft.World/AI/Goals/PlayGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/PlayGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/PlayGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/PlayGoal.cpp index 95d97e835..98b2f1ba2 100644 --- a/Minecraft.World/AI/Goals/PlayGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/PlayGoal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../npc/net.minecraft.world.entity.npc.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "PlayGoal.h" #include diff --git a/Minecraft.World/AI/Goals/PlayGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/PlayGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/PlayGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/PlayGoal.h diff --git a/Minecraft.World/AI/Goals/RandomLookAroundGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/RandomLookAroundGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp index 570735bcd..88f12608b 100644 --- a/Minecraft.World/AI/Goals/RandomLookAroundGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../control/net.minecraft.world.entity.ai.control.h" #include "RandomLookAroundGoal.h" RandomLookAroundGoal::RandomLookAroundGoal(Mob* mob) { diff --git a/Minecraft.World/AI/Goals/RandomLookAroundGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/RandomLookAroundGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.h diff --git a/Minecraft.World/AI/Goals/RandomStrollGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomStrollGoal.cpp similarity index 85% rename from Minecraft.World/AI/Goals/RandomStrollGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RandomStrollGoal.cpp index 2e95918bd..f1f4de473 100644 --- a/Minecraft.World/AI/Goals/RandomStrollGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomStrollGoal.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.util.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Util/SharedConstants.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../util/net.minecraft.world.entity.ai.util.h" +#include "../../../phys/net.minecraft.world.phys.h" +#include "../../../../SharedConstants.h" #include "RandomStrollGoal.h" RandomStrollGoal::RandomStrollGoal(PathfinderMob* mob, double speedModifier) { diff --git a/Minecraft.World/AI/Goals/RandomStrollGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomStrollGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/RandomStrollGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RandomStrollGoal.h diff --git a/Minecraft.World/AI/Goals/RangedAttackGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/RangedAttackGoal.cpp similarity index 89% rename from Minecraft.World/AI/Goals/RangedAttackGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RangedAttackGoal.cpp index f0d3e109a..96e196c83 100644 --- a/Minecraft.World/AI/Goals/RangedAttackGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/RangedAttackGoal.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../sensing/net.minecraft.world.entity.ai.sensing.h" +#include "../../net.minecraft.world.entity.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "RangedAttackGoal.h" void RangedAttackGoal::_init(RangedAttackMob* rangedMob, Mob* mob, diff --git a/Minecraft.World/AI/Goals/RangedAttackGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/RangedAttackGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/RangedAttackGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RangedAttackGoal.h diff --git a/Minecraft.World/AI/Goals/RestrictOpenDoorGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictOpenDoorGoal.cpp similarity index 85% rename from Minecraft.World/AI/Goals/RestrictOpenDoorGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictOpenDoorGoal.cpp index d8b5d0241..939cb14e5 100644 --- a/Minecraft.World/AI/Goals/RestrictOpenDoorGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictOpenDoorGoal.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../village/net.minecraft.world.entity.ai.village.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" #include "RestrictOpenDoorGoal.h" RestrictOpenDoorGoal::RestrictOpenDoorGoal(PathfinderMob* mob) { diff --git a/Minecraft.World/AI/Goals/RestrictOpenDoorGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictOpenDoorGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/RestrictOpenDoorGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictOpenDoorGoal.h diff --git a/Minecraft.World/AI/Goals/RestrictSunGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictSunGoal.cpp similarity index 60% rename from Minecraft.World/AI/Goals/RestrictSunGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictSunGoal.cpp index 647e15383..6bfffa2e3 100644 --- a/Minecraft.World/AI/Goals/RestrictSunGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictSunGoal.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" #include "RestrictSunGoal.h" RestrictSunGoal::RestrictSunGoal(PathfinderMob* mob) { this->mob = mob; } diff --git a/Minecraft.World/AI/Goals/RestrictSunGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictSunGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/RestrictSunGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RestrictSunGoal.h diff --git a/Minecraft.World/AI/Goals/RunAroundLikeCrazyGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.cpp similarity index 81% rename from Minecraft.World/AI/Goals/RunAroundLikeCrazyGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.cpp index a8d7a2623..871d41ccf 100644 --- a/Minecraft.World/AI/Goals/RunAroundLikeCrazyGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../Navigation/RandomPos.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../player/net.minecraft.world.entity.player.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../util/RandomPos.h" #include "RunAroundLikeCrazyGoal.h" RunAroundLikeCrazyGoal::RunAroundLikeCrazyGoal(EntityHorse* mob, diff --git a/Minecraft.World/AI/Goals/RunAroundLikeCrazyGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/RunAroundLikeCrazyGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.h diff --git a/Minecraft.World/AI/Goals/SitGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/SitGoal.cpp similarity index 74% rename from Minecraft.World/AI/Goals/SitGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/SitGoal.cpp index 16c31c420..240a90941 100644 --- a/Minecraft.World/AI/Goals/SitGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/SitGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "net.minecraft.world.entity.ai.goal.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../net.minecraft.world.entity.h" +#include "../../animal/net.minecraft.world.entity.animal.h" #include "SitGoal.h" SitGoal::SitGoal(TamableAnimal* mob) { diff --git a/Minecraft.World/AI/Goals/SitGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/SitGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/SitGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/SitGoal.h diff --git a/Minecraft.World/AI/Goals/SwellGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/SwellGoal.cpp similarity index 76% rename from Minecraft.World/AI/Goals/SwellGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/SwellGoal.cpp index 37b0b3011..63edc3a94 100644 --- a/Minecraft.World/AI/Goals/SwellGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/SwellGoal.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../sensing/net.minecraft.world.entity.ai.sensing.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../monster/net.minecraft.world.entity.monster.h" #include "SwellGoal.h" SwellGoal::SwellGoal(Creeper* creeper) { diff --git a/Minecraft.World/AI/Goals/SwellGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/SwellGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/SwellGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/SwellGoal.h diff --git a/Minecraft.World/AI/Goals/TakeFlowerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/TakeFlowerGoal.cpp similarity index 81% rename from Minecraft.World/AI/Goals/TakeFlowerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/TakeFlowerGoal.cpp index 8d9b547aa..f7690651a 100644 --- a/Minecraft.World/AI/Goals/TakeFlowerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/TakeFlowerGoal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "net.minecraft.world.entity.ai.goal.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../npc/net.minecraft.world.entity.npc.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "TakeFlowerGoal.h" TakeFlowerGoal::TakeFlowerGoal(Villager* villager) { diff --git a/Minecraft.World/AI/Goals/TakeFlowerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/TakeFlowerGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/TakeFlowerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/TakeFlowerGoal.h diff --git a/Minecraft.World/AI/Goals/TemptGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/TemptGoal.cpp similarity index 88% rename from Minecraft.World/AI/Goals/TemptGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/TemptGoal.cpp index 679924d6b..0a0cd5bc5 100644 --- a/Minecraft.World/AI/Goals/TemptGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/TemptGoal.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../player/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../level/net.minecraft.world.level.h" #include "TemptGoal.h" TemptGoal::TemptGoal(PathfinderMob* mob, double speedModifier, int itemId, diff --git a/Minecraft.World/AI/Goals/TemptGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/TemptGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/TemptGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/TemptGoal.h diff --git a/Minecraft.World/AI/Goals/TradeWithPlayerGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/TradeWithPlayerGoal.cpp similarity index 76% rename from Minecraft.World/AI/Goals/TradeWithPlayerGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/TradeWithPlayerGoal.cpp index 7de227116..a0b44fd5a 100644 --- a/Minecraft.World/AI/Goals/TradeWithPlayerGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/TradeWithPlayerGoal.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.inventory.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../npc/net.minecraft.world.entity.npc.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../../inventory/net.minecraft.world.inventory.h" #include "TradeWithPlayerGoal.h" TradeWithPlayerGoal::TradeWithPlayerGoal(Villager* mob) { diff --git a/Minecraft.World/AI/Goals/TradeWithPlayerGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/TradeWithPlayerGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/TradeWithPlayerGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/TradeWithPlayerGoal.h diff --git a/Minecraft.World/net/minecraft/world/entity/ai/goal/net.minecraft.world.entity.ai.goal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/net.minecraft.world.entity.ai.goal.h new file mode 100644 index 000000000..73273e13b --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/net.minecraft.world.entity.ai.goal.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Goal.h" +#include "AvoidPlayerGoal.h" +#include "BegGoal.h" +#include "BreakDoorGoal.h" +#include "BreedGoal.h" +#include "ControlledByPlayerGoal.h" +#include "DoorInteractGoal.h" +#include "EatTileGoal.h" +#include "FleeSunGoal.h" +#include "FollowOwnerGoal.h" +#include "FollowParentGoal.h" +#include "FloatGoal.h" +#include "GoalSelector.h" +#include "InteractGoal.h" +#include "LeapAtTargetGoal.h" +#include "LookAtPlayerGoal.h" +#include "LookAtTradingPlayerGoal.h" +#include "MakeLoveGoal.h" +#include "MeleeAttackGoal.h" +#include "MoveIndoorsGoal.h" +#include "MoveThroughVillageGoal.h" +#include "MoveTowardsRestrictionGoal.h" +#include "MoveTowardsTargetGoal.h" +#include "OcelotSitOnTileGoal.h" +#include "OfferFlowerGoal.h" +#include "OpenDoorGoal.h" +#include "OcelotAttackGoal.h" +#include "PanicGoal.h" +#include "PlayGoal.h" +#include "RandomLookAroundGoal.h" +#include "RandomStrollGoal.h" +#include "RangedAttackGoal.h" +#include "RestrictOpenDoorGoal.h" +#include "RestrictSunGoal.h" +#include "RunAroundLikeCrazyGoal.h" +#include "SitGoal.h" +#include "SwellGoal.h" +#include "TakeFlowerGoal.h" +#include "TemptGoal.h" +#include "TradeWithPlayerGoal.h" \ No newline at end of file diff --git a/Minecraft.World/AI/Goals/DefendVillageTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.cpp similarity index 86% rename from Minecraft.World/AI/Goals/DefendVillageTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.cpp index 09de68a5a..33de3fa47 100644 --- a/Minecraft.World/AI/Goals/DefendVillageTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../village/net.minecraft.world.entity.ai.village.h" +#include "../../../animal/net.minecraft.world.entity.animal.h" #include "DefendVillageTargetGoal.h" DefendVillageTargetGoal::DefendVillageTargetGoal(VillagerGolem* golem) diff --git a/Minecraft.World/AI/Goals/DefendVillageTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/DefendVillageTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.h diff --git a/Minecraft.World/AI/Goals/HurtByTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.cpp similarity index 86% rename from Minecraft.World/AI/Goals/HurtByTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.cpp index ec922cd28..c192c6e8e 100644 --- a/Minecraft.World/AI/Goals/HurtByTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.world.entity.h" +#include "../../../../phys/net.minecraft.world.phys.h" +#include "../../../../level/net.minecraft.world.level.h" #include "HurtByTargetGoal.h" HurtByTargetGoal::HurtByTargetGoal(PathfinderMob* mob, bool alertSameType) diff --git a/Minecraft.World/AI/Goals/HurtByTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/HurtByTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.h diff --git a/Minecraft.World/AI/Goals/NearestAttackableTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.cpp similarity index 92% rename from Minecraft.World/AI/Goals/NearestAttackableTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.cpp index 975ec5c46..f65903466 100644 --- a/Minecraft.World/AI/Goals/NearestAttackableTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.world.entity.h" +#include "../../../../level/net.minecraft.world.level.h" +#include "../../../../phys/net.minecraft.world.phys.h" #include "NearestAttackableTargetGoal.h" SubselectEntitySelector::SubselectEntitySelector( diff --git a/Minecraft.World/AI/Goals/NearestAttackableTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.h similarity index 96% rename from Minecraft.World/AI/Goals/NearestAttackableTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.h index cb023afcb..be6b1b0ee 100644 --- a/Minecraft.World/AI/Goals/NearestAttackableTargetGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.h @@ -1,7 +1,7 @@ #pragma once #include "TargetGoal.h" -#include "../../Entities/EntitySelector.h" +#include "../../../EntitySelector.h" class NearestAttackableTargetGoal; diff --git a/Minecraft.World/AI/Goals/NonTameRandomTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.cpp similarity index 77% rename from Minecraft.World/AI/Goals/NonTameRandomTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.cpp index 7e65d559c..7571df9ee 100644 --- a/Minecraft.World/AI/Goals/NonTameRandomTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../../animal/net.minecraft.world.entity.animal.h" #include "NonTameRandomTargetGoal.h" NonTameRandomTargetGoal::NonTameRandomTargetGoal( diff --git a/Minecraft.World/AI/Goals/NonTameRandomTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/NonTameRandomTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.h diff --git a/Minecraft.World/AI/Goals/OwnerHurtByTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.cpp similarity index 87% rename from Minecraft.World/AI/Goals/OwnerHurtByTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.cpp index d23375fb2..9ed01290a 100644 --- a/Minecraft.World/AI/Goals/OwnerHurtByTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.world.entity.h" +#include "../../../animal/net.minecraft.world.entity.animal.h" #include "OwnerHurtByTargetGoal.h" OwnerHurtByTargetGoal::OwnerHurtByTargetGoal(TamableAnimal* tameAnimal) diff --git a/Minecraft.World/AI/Goals/OwnerHurtByTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/OwnerHurtByTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.h diff --git a/Minecraft.World/AI/Goals/OwnerHurtTargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.cpp similarity index 86% rename from Minecraft.World/AI/Goals/OwnerHurtTargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.cpp index 10b0a040f..4cff6e933 100644 --- a/Minecraft.World/AI/Goals/OwnerHurtTargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.world.entity.h" +#include "../../../animal/net.minecraft.world.entity.animal.h" #include "OwnerHurtTargetGoal.h" OwnerHurtTargetGoal::OwnerHurtTargetGoal(TamableAnimal* tameAnimal) diff --git a/Minecraft.World/AI/Goals/OwnerHurtTargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.h similarity index 100% rename from Minecraft.World/AI/Goals/OwnerHurtTargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.h diff --git a/Minecraft.World/AI/Goals/TargetGoal.cpp b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/TargetGoal.cpp similarity index 84% rename from Minecraft.World/AI/Goals/TargetGoal.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/TargetGoal.cpp index 1c37f6050..7b98248fd 100644 --- a/Minecraft.World/AI/Goals/TargetGoal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/TargetGoal.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.sensing.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.world.entity.h" +#include "../../attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../../navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../sensing/net.minecraft.world.entity.ai.sensing.h" +#include "../../../animal/net.minecraft.world.entity.animal.h" +#include "../../../monster/net.minecraft.world.entity.monster.h" +#include "../../../player/net.minecraft.world.entity.player.h" +#include "../../../../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../../../../phys/net.minecraft.world.phys.h" #include "TargetGoal.h" void TargetGoal::_init(PathfinderMob* mob, bool mustSee, bool mustReach) { diff --git a/Minecraft.World/AI/Goals/TargetGoal.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/TargetGoal.h similarity index 98% rename from Minecraft.World/AI/Goals/TargetGoal.h rename to Minecraft.World/net/minecraft/world/entity/ai/goal/target/TargetGoal.h index 3039172d7..d4957909b 100644 --- a/Minecraft.World/AI/Goals/TargetGoal.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/TargetGoal.h @@ -1,6 +1,6 @@ #pragma once -#include "Goal.h" +#include "../Goal.h" class PathfinderMob; diff --git a/Minecraft.World/net/minecraft/world/entity/ai/goal/target/net.minecraft.world.entity.ai.goal.target.h b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/net.minecraft.world.entity.ai.goal.target.h new file mode 100644 index 000000000..98b96a16a --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/goal/target/net.minecraft.world.entity.ai.goal.target.h @@ -0,0 +1,9 @@ +#pragma once + +#include "TargetGoal.h" +#include "DefendVillageTargetGoal.h" +#include "HurtByTargetGoal.h" +#include "NearestAttackableTargetGoal.h" +#include "NonTameRandomTargetGoal.h" +#include "OwnerHurtByTargetGoal.h" +#include "OwnerHurtTargetGoal.h" \ No newline at end of file diff --git a/Minecraft.World/AI/Navigation/PathNavigation.cpp b/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp similarity index 94% rename from Minecraft.World/AI/Navigation/PathNavigation.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp index 35da31448..392b04618 100644 --- a/Minecraft.World/AI/Navigation/PathNavigation.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../../net.minecraft.world.entity.h" +#include "../attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../control/net.minecraft.world.entity.ai.control.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "PathNavigation.h" PathNavigation::PathNavigation(Mob* mob, Level* level) { diff --git a/Minecraft.World/AI/Navigation/PathNavigation.h b/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.h similarity index 100% rename from Minecraft.World/AI/Navigation/PathNavigation.h rename to Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.h diff --git a/Minecraft.World/net/minecraft/world/entity/ai/navigation/net.minecraft.world.entity.ai.navigation.h b/Minecraft.World/net/minecraft/world/entity/ai/navigation/net.minecraft.world.entity.ai.navigation.h new file mode 100644 index 000000000..ca7e39ff7 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/navigation/net.minecraft.world.entity.ai.navigation.h @@ -0,0 +1,3 @@ +#pragma once + +#include "PathNavigation.h" \ No newline at end of file diff --git a/Minecraft.World/AI/Control/Sensing.cpp b/Minecraft.World/net/minecraft/world/entity/ai/sensing/Sensing.cpp similarity index 89% rename from Minecraft.World/AI/Control/Sensing.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/sensing/Sensing.cpp index 6802f15e6..b81f73fc9 100644 --- a/Minecraft.World/AI/Control/Sensing.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/sensing/Sensing.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" #include "Sensing.h" Sensing::Sensing(Mob* mob) { this->mob = mob; } diff --git a/Minecraft.World/AI/Control/Sensing.h b/Minecraft.World/net/minecraft/world/entity/ai/sensing/Sensing.h similarity index 100% rename from Minecraft.World/AI/Control/Sensing.h rename to Minecraft.World/net/minecraft/world/entity/ai/sensing/Sensing.h diff --git a/Minecraft.World/net/minecraft/world/entity/ai/sensing/net.minecraft.world.entity.ai.sensing.h b/Minecraft.World/net/minecraft/world/entity/ai/sensing/net.minecraft.world.entity.ai.sensing.h new file mode 100644 index 000000000..20410c95b --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/sensing/net.minecraft.world.entity.ai.sensing.h @@ -0,0 +1,3 @@ +#pragma once + +#include "Sensing.h" \ No newline at end of file diff --git a/Minecraft.World/AI/Navigation/RandomPos.cpp b/Minecraft.World/net/minecraft/world/entity/ai/util/RandomPos.cpp similarity index 95% rename from Minecraft.World/AI/Navigation/RandomPos.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/util/RandomPos.cpp index 3b9528e17..a6476c848 100644 --- a/Minecraft.World/AI/Navigation/RandomPos.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/util/RandomPos.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "RandomPos.h" #include diff --git a/Minecraft.World/AI/Navigation/RandomPos.h b/Minecraft.World/net/minecraft/world/entity/ai/util/RandomPos.h similarity index 100% rename from Minecraft.World/AI/Navigation/RandomPos.h rename to Minecraft.World/net/minecraft/world/entity/ai/util/RandomPos.h diff --git a/Minecraft.World/net/minecraft/world/entity/ai/util/net.minecraft.world.entity.ai.util.h b/Minecraft.World/net/minecraft/world/entity/ai/util/net.minecraft.world.entity.ai.util.h new file mode 100644 index 000000000..de67b5be9 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/util/net.minecraft.world.entity.ai.util.h @@ -0,0 +1,3 @@ +#pragma once + +#include "RandomPos.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/DoorInfo.cpp b/Minecraft.World/net/minecraft/world/entity/ai/village/DoorInfo.cpp similarity index 95% rename from Minecraft.World/Entities/DoorInfo.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/village/DoorInfo.cpp index f1c06debf..26d74bf42 100644 --- a/Minecraft.World/Entities/DoorInfo.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/village/DoorInfo.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "DoorInfo.h" diff --git a/Minecraft.World/Entities/DoorInfo.h b/Minecraft.World/net/minecraft/world/entity/ai/village/DoorInfo.h similarity index 100% rename from Minecraft.World/Entities/DoorInfo.h rename to Minecraft.World/net/minecraft/world/entity/ai/village/DoorInfo.h diff --git a/Minecraft.World/WorldGen/Structures/Village.cpp b/Minecraft.World/net/minecraft/world/entity/ai/village/Village.cpp similarity index 97% rename from Minecraft.World/WorldGen/Structures/Village.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/village/Village.cpp index aa6ae7c19..b76565684 100644 --- a/Minecraft.World/WorldGen/Structures/Village.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/village/Village.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.ai.village.h" +#include "../../npc/net.minecraft.world.entity.npc.h" +#include "../../animal/net.minecraft.world.entity.animal.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "Village.h" #include #include diff --git a/Minecraft.World/WorldGen/Structures/Village.h b/Minecraft.World/net/minecraft/world/entity/ai/village/Village.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/Village.h rename to Minecraft.World/net/minecraft/world/entity/ai/village/Village.h diff --git a/Minecraft.World/Level/Events/VillageSiege.cpp b/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp similarity index 94% rename from Minecraft.World/Level/Events/VillageSiege.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp index 509cc306a..6c97d2d40 100644 --- a/Minecraft.World/Level/Events/VillageSiege.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.ai.village.h" +#include "../../net.minecraft.world.entity.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../../level/net.minecraft.world.level.h" #include "VillageSiege.h" #include diff --git a/Minecraft.World/Level/Events/VillageSiege.h b/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.h similarity index 100% rename from Minecraft.World/Level/Events/VillageSiege.h rename to Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.h diff --git a/Minecraft.World/WorldGen/Structures/Villages.cpp b/Minecraft.World/net/minecraft/world/entity/ai/village/Villages.cpp similarity index 96% rename from Minecraft.World/WorldGen/Structures/Villages.cpp rename to Minecraft.World/net/minecraft/world/entity/ai/village/Villages.cpp index dc964b5b8..06a7a4fd6 100644 --- a/Minecraft.World/WorldGen/Structures/Villages.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ai/village/Villages.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.ai.village.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "Villages.h" #include diff --git a/Minecraft.World/WorldGen/Structures/Villages.h b/Minecraft.World/net/minecraft/world/entity/ai/village/Villages.h similarity index 95% rename from Minecraft.World/WorldGen/Structures/Villages.h rename to Minecraft.World/net/minecraft/world/entity/ai/village/Villages.h index 9c8cd5590..44197ea0e 100644 --- a/Minecraft.World/WorldGen/Structures/Villages.h +++ b/Minecraft.World/net/minecraft/world/entity/ai/village/Villages.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Level/Storage/SavedData.h" +#include "../../../level/saveddata/SavedData.h" class Villages : public SavedData { public: diff --git a/Minecraft.World/net/minecraft/world/entity/ai/village/net.minecraft.world.entity.ai.village.h b/Minecraft.World/net/minecraft/world/entity/ai/village/net.minecraft.world.entity.ai.village.h new file mode 100644 index 000000000..7aeb2d82e --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ai/village/net.minecraft.world.entity.ai.village.h @@ -0,0 +1,6 @@ +#pragma once + +#include "DoorInfo.h" +#include "Village.h" +#include "Villages.h" +#include "VillageSiege.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/AmbientCreature.cpp b/Minecraft.World/net/minecraft/world/entity/ambient/AmbientCreature.cpp similarity index 83% rename from Minecraft.World/Entities/Mobs/AmbientCreature.cpp rename to Minecraft.World/net/minecraft/world/entity/ambient/AmbientCreature.cpp index 6022dd7db..58867f25a 100644 --- a/Minecraft.World/Entities/Mobs/AmbientCreature.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ambient/AmbientCreature.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "AmbientCreature.h" diff --git a/Minecraft.World/Entities/Mobs/AmbientCreature.h b/Minecraft.World/net/minecraft/world/entity/ambient/AmbientCreature.h similarity index 90% rename from Minecraft.World/Entities/Mobs/AmbientCreature.h rename to Minecraft.World/net/minecraft/world/entity/ambient/AmbientCreature.h index 59e059841..05e2b6a22 100644 --- a/Minecraft.World/Entities/Mobs/AmbientCreature.h +++ b/Minecraft.World/net/minecraft/world/entity/ambient/AmbientCreature.h @@ -1,7 +1,7 @@ #pragma once #include "../Mob.h" -#include "Creature.h" +#include "../Creature.h" class AmbientCreature : public Mob, public Creature { public: diff --git a/Minecraft.World/Entities/Mobs/Bat.cpp b/Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp similarity index 93% rename from Minecraft.World/Entities/Mobs/Bat.cpp rename to Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp index 3a9e61d42..eb7380a65 100644 --- a/Minecraft.World/Entities/Mobs/Bat.cpp +++ b/Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" #include "Bat.h" Bat::Bat(Level* level) : AmbientCreature(level) { diff --git a/Minecraft.World/Entities/Mobs/Bat.h b/Minecraft.World/net/minecraft/world/entity/ambient/Bat.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Bat.h rename to Minecraft.World/net/minecraft/world/entity/ambient/Bat.h diff --git a/Minecraft.World/net/minecraft/world/entity/ambient/net.minecraft.world.entity.ambient.h b/Minecraft.World/net/minecraft/world/entity/ambient/net.minecraft.world.entity.ambient.h new file mode 100644 index 000000000..924d413a6 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/ambient/net.minecraft.world.entity.ambient.h @@ -0,0 +1,4 @@ +#pragma once + +#include "AmbientCreature.h" +#include "Bat.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/Animal.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp similarity index 95% rename from Minecraft.World/Entities/Mobs/Animal.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp index 7fbc4b9c2..f231891d5 100644 --- a/Minecraft.World/Entities/Mobs/Animal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Util/Random.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/storage/net.minecraft.world.level.storage.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.entity.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../../../../../ConsoleJavaLibs/Random.h" #include "Animal.h" Animal::Animal(Level* level) : AgableMob(level) { diff --git a/Minecraft.World/Entities/Mobs/Animal.h b/Minecraft.World/net/minecraft/world/entity/animal/Animal.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Animal.h rename to Minecraft.World/net/minecraft/world/entity/animal/Animal.h index f7882212e..05fa94eea 100644 --- a/Minecraft.World/Entities/Mobs/Animal.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/Animal.h @@ -1,6 +1,6 @@ #pragma once -#include "AgeableMob.h" -#include "Creature.h" +#include "../AgeableMob.h" +#include "../Creature.h" class Level; class CompoundTag; diff --git a/Minecraft.World/Entities/Mobs/Chicken.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp similarity index 85% rename from Minecraft.World/Entities/Mobs/Chicken.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp index dc8449eb7..b712fdffe 100644 --- a/Minecraft.World/Entities/Mobs/Chicken.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp @@ -1,15 +1,15 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" #include "Chicken.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" #include "../MobCategory.h" void Chicken::_init() { diff --git a/Minecraft.World/Entities/Mobs/Chicken.h b/Minecraft.World/net/minecraft/world/entity/animal/Chicken.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Chicken.h rename to Minecraft.World/net/minecraft/world/entity/animal/Chicken.h diff --git a/Minecraft.World/Entities/Mobs/Cow.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp similarity index 81% rename from Minecraft.World/Entities/Mobs/Cow.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp index add30a92f..6d9cd75d3 100644 --- a/Minecraft.World/Entities/Mobs/Cow.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.stats.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../../../stats/net.minecraft.stats.h" #include "Cow.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../MobCategory.h" Cow::Cow(Level* level) : Animal(level) { diff --git a/Minecraft.World/Entities/Mobs/Cow.h b/Minecraft.World/net/minecraft/world/entity/animal/Cow.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Cow.h rename to Minecraft.World/net/minecraft/world/entity/animal/Cow.h diff --git a/Minecraft.World/Entities/Mobs/EntityHorse.cpp b/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp similarity index 97% rename from Minecraft.World/Entities/Mobs/EntityHorse.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp index 98e01f758..cfb047163 100644 --- a/Minecraft.World/Entities/Mobs/EntityHorse.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.inventory.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../../Minecraft.Client/Minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" #include "EntityHorse.h" #include diff --git a/Minecraft.World/Entities/Mobs/EntityHorse.h b/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h similarity index 98% rename from Minecraft.World/Entities/Mobs/EntityHorse.h rename to Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h index ccca686a5..1c8466184 100644 --- a/Minecraft.World/Entities/Mobs/EntityHorse.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h @@ -1,8 +1,8 @@ #pragma once #include "Animal.h" -#include "../../Headers/net.minecraft.world.ContainerListener.h" -#include "MobGroupData.h" +#include "../../net.minecraft.world.ContainerListener.h" +#include "../MobGroupData.h" #include "../EntitySelector.h" class Attribute; diff --git a/Minecraft.World/Entities/Mobs/Golem.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Golem.cpp similarity index 88% rename from Minecraft.World/Entities/Mobs/Golem.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Golem.cpp index 92588af4b..78cc50122 100644 --- a/Minecraft.World/Entities/Mobs/Golem.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Golem.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "Golem.h" diff --git a/Minecraft.World/Entities/Mobs/Golem.h b/Minecraft.World/net/minecraft/world/entity/animal/Golem.h similarity index 94% rename from Minecraft.World/Entities/Mobs/Golem.h rename to Minecraft.World/net/minecraft/world/entity/animal/Golem.h index 2ce7eaf77..8ab7d22cf 100644 --- a/Minecraft.World/Entities/Mobs/Golem.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/Golem.h @@ -1,7 +1,7 @@ #pragma once #include "../PathfinderMob.h" -#include "Creature.h" +#include "../Creature.h" class Level; class CompoundTag; diff --git a/Minecraft.World/Entities/Mobs/MushroomCow.cpp b/Minecraft.World/net/minecraft/world/entity/animal/MushroomCow.cpp similarity index 87% rename from Minecraft.World/Entities/Mobs/MushroomCow.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/MushroomCow.cpp index d4b2ab30d..df95a0d0b 100644 --- a/Minecraft.World/Entities/Mobs/MushroomCow.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/MushroomCow.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "MushroomCow.h" #include "../MobCategory.h" -#include "../../Util/AABB.h" +#include "../../phys/AABB.h" MushroomCow::MushroomCow(Level* level) : Cow(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/MushroomCow.h b/Minecraft.World/net/minecraft/world/entity/animal/MushroomCow.h similarity index 100% rename from Minecraft.World/Entities/Mobs/MushroomCow.h rename to Minecraft.World/net/minecraft/world/entity/animal/MushroomCow.h diff --git a/Minecraft.World/Entities/Mobs/Ocelot.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Ocelot.cpp similarity index 89% rename from Minecraft.World/Entities/Mobs/Ocelot.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Ocelot.cpp index 53dfbd5a8..9952b8c20 100644 --- a/Minecraft.World/Entities/Mobs/Ocelot.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Ocelot.cpp @@ -1,23 +1,23 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/control/net.minecraft.world.entity.ai.control.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "net.minecraft.world.entity.animal.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../net.minecraft.world.entity.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../phys/net.minecraft.world.phys.h" #include "../SyncedEntityData.h" -#include "../../Util/StringHelpers.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../../Stats/GenericStats.h" +#include "../../../../../ConsoleHelpers/StringHelpers.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../../../stats/GenericStats.h" #include "Ocelot.h" const double Ocelot::SNEAK_SPEED_MOD = 0.6; diff --git a/Minecraft.World/Entities/Mobs/Ocelot.h b/Minecraft.World/net/minecraft/world/entity/animal/Ocelot.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Ocelot.h rename to Minecraft.World/net/minecraft/world/entity/animal/Ocelot.h diff --git a/Minecraft.World/Entities/Mobs/Pig.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp similarity index 83% rename from Minecraft.World/Entities/Mobs/Pig.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp index 5300ff040..9ba7734b0 100644 --- a/Minecraft.World/Entities/Mobs/Pig.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.stats.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.global.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../global/net.minecraft.world.entity.global.h" #include "Pig.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../MobCategory.h" Pig::Pig(Level* level) : Animal(level) { diff --git a/Minecraft.World/Entities/Mobs/Pig.h b/Minecraft.World/net/minecraft/world/entity/animal/Pig.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Pig.h rename to Minecraft.World/net/minecraft/world/entity/animal/Pig.h diff --git a/Minecraft.World/Entities/Mobs/Sheep.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp similarity index 89% rename from Minecraft.World/Entities/Mobs/Sheep.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp index 75c3216bc..65dd996a7 100644 --- a/Minecraft.World/Entities/Mobs/Sheep.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp @@ -1,24 +1,24 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.crafting.h" -#include "../../Headers/net.minecraft.world.inventory.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.global.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/crafting/net.minecraft.world.item.crafting.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../net.minecraft.world.entity.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../global/net.minecraft.world.entity.global.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../monster/net.minecraft.world.entity.monster.h" #include "Sheep.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../MobCategory.h" -#include "../../Stats/GenericStats.h" +#include "../../../stats/GenericStats.h" const float Sheep::COLOR[Sheep::COLOR_LENGTH][3] = { {1.0f, 1.0f, 1.0f}, // white diff --git a/Minecraft.World/Entities/Mobs/Sheep.h b/Minecraft.World/net/minecraft/world/entity/animal/Sheep.h similarity index 95% rename from Minecraft.World/Entities/Mobs/Sheep.h rename to Minecraft.World/net/minecraft/world/entity/animal/Sheep.h index a20b50b4a..65a0c325a 100644 --- a/Minecraft.World/Entities/Mobs/Sheep.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/Sheep.h @@ -5,8 +5,8 @@ class EatTileGoal; class CraftingContainer; #include "Animal.h" -#include "../../Util/SharedConstants.h" -#include "../../Containers/AbstractContainerMenu.h" +#include "../../../SharedConstants.h" +#include "../../inventory/AbstractContainerMenu.h" class Sheep : public Animal { private: diff --git a/Minecraft.World/Entities/Mobs/SnowMan.cpp b/Minecraft.World/net/minecraft/world/entity/animal/SnowMan.cpp similarity index 75% rename from Minecraft.World/Entities/Mobs/SnowMan.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/SnowMan.cpp index 3f44296a3..a9a0883b6 100644 --- a/Minecraft.World/Entities/Mobs/SnowMan.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/SnowMan.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Util/SharedConstants.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/biome/net.minecraft.world.level.biome.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../SharedConstants.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "SnowMan.h" -#include "../../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" SnowMan::SnowMan(Level* level) : Golem(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/SnowMan.h b/Minecraft.World/net/minecraft/world/entity/animal/SnowMan.h similarity index 94% rename from Minecraft.World/Entities/Mobs/SnowMan.h rename to Minecraft.World/net/minecraft/world/entity/animal/SnowMan.h index e582307de..8e8a9b83c 100644 --- a/Minecraft.World/Entities/Mobs/SnowMan.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/SnowMan.h @@ -1,7 +1,7 @@ #pragma once #include "Golem.h" -#include "RangedAttackMob.h" +#include "../monster/RangedAttackMob.h" class SnowMan : public Golem, public RangedAttackMob { public: diff --git a/Minecraft.World/Entities/Mobs/Squid.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp similarity index 87% rename from Minecraft.World/Entities/Mobs/Squid.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp index c04bba6eb..7c9feee8d 100644 --- a/Minecraft.World/Entities/Mobs/Squid.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp @@ -1,15 +1,15 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Util/SharedConstants.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../../../SharedConstants.h" #include "Squid.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" void Squid::_init() { xBodyRot = xBodyRotO = 0.0f; diff --git a/Minecraft.World/Entities/Mobs/Squid.h b/Minecraft.World/net/minecraft/world/entity/animal/Squid.h similarity index 97% rename from Minecraft.World/Entities/Mobs/Squid.h rename to Minecraft.World/net/minecraft/world/entity/animal/Squid.h index 84a078e15..cde993ba3 100644 --- a/Minecraft.World/Entities/Mobs/Squid.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/Squid.h @@ -1,6 +1,6 @@ #pragma once -#include "../WaterAnimal.h" +#include "WaterAnimal.h" class Player; diff --git a/Minecraft.World/Entities/Mobs/VillagerGolem.cpp b/Minecraft.World/net/minecraft/world/entity/animal/VillagerGolem.cpp similarity index 87% rename from Minecraft.World/Entities/Mobs/VillagerGolem.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/VillagerGolem.cpp index 9cb942151..2e51fd9a2 100644 --- a/Minecraft.World/Entities/Mobs/VillagerGolem.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/VillagerGolem.cpp @@ -1,23 +1,23 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.control.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/control/net.minecraft.world.entity.ai.control.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../ai/village/net.minecraft.world.entity.ai.village.h" +#include "net.minecraft.world.entity.animal.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../net.minecraft.world.entity.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../SyncedEntityData.h" #include "VillagerGolem.h" -#include "../../Util/ParticleTypes.h" +#include "../../../../../Header Files/ParticleTypes.h" VillagerGolem::VillagerGolem(Level* level) : Golem(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/VillagerGolem.h b/Minecraft.World/net/minecraft/world/entity/animal/VillagerGolem.h similarity index 100% rename from Minecraft.World/Entities/Mobs/VillagerGolem.h rename to Minecraft.World/net/minecraft/world/entity/animal/VillagerGolem.h diff --git a/Minecraft.World/Entities/WaterAnimal.cpp b/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp similarity index 76% rename from Minecraft.World/Entities/WaterAnimal.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp index 71470f35b..44432db4b 100644 --- a/Minecraft.World/Entities/WaterAnimal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.damagesource.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" #include "WaterAnimal.h" WaterAnimal::WaterAnimal(Level* level) : PathfinderMob(level) { diff --git a/Minecraft.World/Entities/WaterAnimal.h b/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.h similarity index 87% rename from Minecraft.World/Entities/WaterAnimal.h rename to Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.h index 953966c81..ecf7ba529 100644 --- a/Minecraft.World/Entities/WaterAnimal.h +++ b/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.h @@ -1,6 +1,6 @@ #pragma once -#include "PathfinderMob.h" -#include "Mobs/Creature.h" +#include "../PathfinderMob.h" +#include "../Creature.h" class Player; diff --git a/Minecraft.World/Entities/Mobs/Wolf.cpp b/Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp similarity index 93% rename from Minecraft.World/Entities/Mobs/Wolf.cpp rename to Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp index 21ff4e4fc..1dbe8eafa 100644 --- a/Minecraft.World/Entities/Mobs/Wolf.cpp +++ b/Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp @@ -1,25 +1,25 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.stats.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.animal.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../stats/net.minecraft.stats.h" #include "Sheep.h" #include "Wolf.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" Wolf::Wolf(Level* level) : TamableAnimal(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/Wolf.h b/Minecraft.World/net/minecraft/world/entity/animal/Wolf.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Wolf.h rename to Minecraft.World/net/minecraft/world/entity/animal/Wolf.h diff --git a/Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h b/Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h new file mode 100644 index 000000000..2bcb81f15 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h @@ -0,0 +1,22 @@ +#pragma once + +#include "Animal.h" +#include "Chicken.h" +#include "Cow.h" +#include "Pig.h" +#include "Sheep.h" +#include "Squid.h" +#include "WaterAnimal.h" +#include "Wolf.h" + +// 1.0.1 +#include "Golem.h" +#include "MushroomCow.h" +#include "SnowMan.h" + +// 1.2.3 +#include "Ocelot.h" +#include "VillagerGolem.h" + +// 1.6.4 +#include "EntityHorse.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/BossMob.h b/Minecraft.World/net/minecraft/world/entity/boss/BossMob.h similarity index 100% rename from Minecraft.World/Entities/Mobs/BossMob.h rename to Minecraft.World/net/minecraft/world/entity/boss/BossMob.h diff --git a/Minecraft.World/Entities/Mobs/MultiEntityMob.h b/Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMob.h similarity index 100% rename from Minecraft.World/Entities/Mobs/MultiEntityMob.h rename to Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMob.h diff --git a/Minecraft.World/Entities/Mobs/MultiEntityMobPart.cpp b/Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMobPart.cpp similarity index 95% rename from Minecraft.World/Entities/Mobs/MultiEntityMobPart.cpp rename to Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMobPart.cpp index 66597d950..d8d7b4b30 100644 --- a/Minecraft.World/Entities/Mobs/MultiEntityMobPart.cpp +++ b/Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMobPart.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "BossMob.h" #include "MultiEntityMob.h" #include "MultiEntityMobPart.h" diff --git a/Minecraft.World/Entities/Mobs/MultiEntityMobPart.h b/Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMobPart.h similarity index 100% rename from Minecraft.World/Entities/Mobs/MultiEntityMobPart.h rename to Minecraft.World/net/minecraft/world/entity/boss/MultiEntityMobPart.h diff --git a/Minecraft.World/Entities/Mobs/EnderCrystal.cpp b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderCrystal.cpp similarity index 90% rename from Minecraft.World/Entities/Mobs/EnderCrystal.cpp rename to Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderCrystal.cpp index 8c7c94c78..133520cf7 100644 --- a/Minecraft.World/Entities/Mobs/EnderCrystal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderCrystal.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.boss.enderdragon.h" #include "EnderCrystal.h" -#include "../../Util/DamageSource.h" +#include "../../../damageSource/DamageSource.h" void EnderCrystal::_init(Level* level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/EnderCrystal.h b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderCrystal.h similarity index 97% rename from Minecraft.World/Entities/Mobs/EnderCrystal.h rename to Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderCrystal.h index 844b08706..fa53aead2 100644 --- a/Minecraft.World/Entities/Mobs/EnderCrystal.h +++ b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderCrystal.h @@ -1,6 +1,6 @@ #pragma once -#include "../Entity.h" +#include "../../Entity.h" class EnderCrystal : public Entity { public: diff --git a/Minecraft.World/Entities/Mobs/EnderDragon.cpp b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp similarity index 98% rename from Minecraft.World/Entities/Mobs/EnderDragon.cpp rename to Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp index 2db34b8fc..775306b96 100644 --- a/Minecraft.World/Entities/Mobs/EnderDragon.cpp +++ b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.boss.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" -#include "../../Util/SharedConstants.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.entity.h" +#include "../../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../net.minecraft.world.entity.boss.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../projectile/net.minecraft.world.entity.projectile.h" +#include "../../../phys/net.minecraft.world.phys.h" +#include "../../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "net.minecraft.world.entity.boss.enderdragon.h" +#include "../../../level/pathfinder/net.minecraft.world.level.pathfinder.h" +#include "../../../../SharedConstants.h" #include "EnderDragon.h" #include #include diff --git a/Minecraft.World/Entities/Mobs/EnderDragon.h b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.h similarity index 98% rename from Minecraft.World/Entities/Mobs/EnderDragon.h rename to Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.h index 907ffe3fe..62f680cfb 100644 --- a/Minecraft.World/Entities/Mobs/EnderDragon.h +++ b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.h @@ -1,7 +1,7 @@ #pragma once -#include "BossMob.h" -#include "MultiEntityMob.h" -#include "../Enemy.h" +#include "../BossMob.h" +#include "../MultiEntityMob.h" +#include "../../monster/Enemy.h" class MultiEntityMobPart; class EnderCrystal; diff --git a/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h new file mode 100644 index 000000000..defde300e --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h @@ -0,0 +1,5 @@ +#pragma once + +#include "EnderCrystal.h" +#include "EnderDragon.h" +#include "../../../level/levelgen/feature/NetherSphereFeature.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/world/entity/boss/net.minecraft.world.entity.boss.h b/Minecraft.World/net/minecraft/world/entity/boss/net.minecraft.world.entity.boss.h new file mode 100644 index 000000000..764092017 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/boss/net.minecraft.world.entity.boss.h @@ -0,0 +1,5 @@ +#pragma once + +#include "BossMob.h" +#include "MultiEntityMob.h" +#include "MultiEntityMobPart.h" diff --git a/Minecraft.World/Entities/Mobs/WitherBoss.cpp b/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp similarity index 94% rename from Minecraft.World/Entities/Mobs/WitherBoss.cpp rename to Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp index 01822a75a..0760d39f6 100644 --- a/Minecraft.World/Entities/Mobs/WitherBoss.cpp +++ b/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Util/Mth.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.world.h" +#include "../../../damageSource/net.minecraft.world.damagesource.h" +#include "../../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../../monster/net.minecraft.world.entity.monster.h" +#include "../../projectile/net.minecraft.world.entity.projectile.h" +#include "../../net.minecraft.world.entity.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../level/net.minecraft.world.level.h" +#include "../../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../phys/net.minecraft.world.phys.h" +#include "../../../../util/Mth.h" -#include "../../Util/SoundTypes.h" +#include "../../../../../../Header Files/SoundTypes.h" #include "WitherBoss.h" diff --git a/Minecraft.World/Entities/Mobs/WitherBoss.h b/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.h similarity index 96% rename from Minecraft.World/Entities/Mobs/WitherBoss.h rename to Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.h index 6fbe7a5ab..d3d45cc8f 100644 --- a/Minecraft.World/Entities/Mobs/WitherBoss.h +++ b/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.h @@ -1,8 +1,8 @@ #pragma once -#include "../Monster.h" -#include "RangedAttackMob.h" -#include "BossMob.h" +#include "../../monster/Monster.h" +#include "../../monster/RangedAttackMob.h" +#include "../BossMob.h" class LivingEntitySelector : public EntitySelector { public: diff --git a/Minecraft.World/net/minecraft/world/entity/global/GlobalEntity.cpp b/Minecraft.World/net/minecraft/world/entity/global/GlobalEntity.cpp new file mode 100644 index 000000000..66f0556f6 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/global/GlobalEntity.cpp @@ -0,0 +1,2 @@ +#include "../../../../../Header Files/stdafx.h" +#include "GlobalEntity.h" diff --git a/Minecraft.World/Entities/GlobalEntity.h b/Minecraft.World/net/minecraft/world/entity/global/GlobalEntity.h similarity index 87% rename from Minecraft.World/Entities/GlobalEntity.h rename to Minecraft.World/net/minecraft/world/entity/global/GlobalEntity.h index ff9cf7a33..2d9381c00 100644 --- a/Minecraft.World/Entities/GlobalEntity.h +++ b/Minecraft.World/net/minecraft/world/entity/global/GlobalEntity.h @@ -1,5 +1,5 @@ #pragma once -#include "Entity.h" +#include "../Entity.h" class Level; diff --git a/Minecraft.World/Entities/Mobs/LightningBolt.cpp b/Minecraft.World/net/minecraft/world/entity/global/LightningBolt.cpp similarity index 90% rename from Minecraft.World/Entities/Mobs/LightningBolt.cpp rename to Minecraft.World/net/minecraft/world/entity/global/LightningBolt.cpp index 6aa5a5f79..614cf39a2 100644 --- a/Minecraft.World/Entities/Mobs/LightningBolt.cpp +++ b/Minecraft.World/net/minecraft/world/entity/global/LightningBolt.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" #include "LightningBolt.h" -#include "../../Util/SoundTypes.h" -#include "../../../Minecraft.Client/MinecraftServer.h" -#include "../../../Minecraft.Client/Network/PlayerList.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "../../../../../Header Files/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../../Minecraft.Client/net/minecraft/server/PlayerList.h" +#include "../../level/dimension/net.minecraft.world.level.dimension.h" LightningBolt::LightningBolt(Level* level, double x, double y, double z) : life(0), seed(0), flashes(0), GlobalEntity(level) { diff --git a/Minecraft.World/Entities/Mobs/LightningBolt.h b/Minecraft.World/net/minecraft/world/entity/global/LightningBolt.h similarity index 87% rename from Minecraft.World/Entities/Mobs/LightningBolt.h rename to Minecraft.World/net/minecraft/world/entity/global/LightningBolt.h index fabd93144..47b29be24 100644 --- a/Minecraft.World/Entities/Mobs/LightningBolt.h +++ b/Minecraft.World/net/minecraft/world/entity/global/LightningBolt.h @@ -1,7 +1,7 @@ #pragma once -#include "../GlobalEntity.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "GlobalEntity.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" // class LightningBolt : public GlobalEntity class LightningBolt : public GlobalEntity { diff --git a/Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h b/Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h new file mode 100644 index 000000000..51123d90e --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/global/net.minecraft.world.entity.global.h @@ -0,0 +1,4 @@ +#pragma once + +#include "GlobalEntity.h" +#include "LightningBolt.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/Boat.cpp b/Minecraft.World/net/minecraft/world/entity/item/Boat.cpp similarity index 95% rename from Minecraft.World/Entities/Mobs/Boat.cpp rename to Minecraft.World/net/minecraft/world/entity/item/Boat.cpp index 7d151c603..260547e33 100644 --- a/Minecraft.World/Entities/Mobs/Boat.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/Boat.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../net.minecraft.world.entity.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/material/net.minecraft.world.level.material.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" #include "Boat.h" const double Boat::MAX_SPEED = 0.35; diff --git a/Minecraft.World/Entities/Mobs/Boat.h b/Minecraft.World/net/minecraft/world/entity/item/Boat.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Boat.h rename to Minecraft.World/net/minecraft/world/entity/item/Boat.h diff --git a/Minecraft.World/Blocks/FallingTile.cpp b/Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp similarity index 96% rename from Minecraft.World/Blocks/FallingTile.cpp rename to Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp index 53d664c58..50f893d53 100644 --- a/Minecraft.World/Blocks/FallingTile.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "FallingTile.h" // 4J - added for common ctor code diff --git a/Minecraft.World/Blocks/FallingTile.h b/Minecraft.World/net/minecraft/world/entity/item/FallingTile.h similarity index 97% rename from Minecraft.World/Blocks/FallingTile.h rename to Minecraft.World/net/minecraft/world/entity/item/FallingTile.h index d5528412c..3447d93d0 100644 --- a/Minecraft.World/Blocks/FallingTile.h +++ b/Minecraft.World/net/minecraft/world/entity/item/FallingTile.h @@ -1,5 +1,5 @@ #pragma once -#include "../Entities/Entity.h" +#include "../Entity.h" class Level; diff --git a/Minecraft.World/Entities/ItemEntity.cpp b/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp similarity index 92% rename from Minecraft.World/Entities/ItemEntity.cpp rename to Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp index a6627c6cc..2d2faae57 100644 --- a/Minecraft.World/Entities/ItemEntity.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" -#include "../Util/JavaMath.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../net.minecraft.world.entity.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../item/net.minecraft.world.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../level/material/net.minecraft.world.level.material.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "ItemEntity.h" -#include "../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" void ItemEntity::_init() { age = 0; diff --git a/Minecraft.World/Entities/ItemEntity.h b/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.h similarity index 96% rename from Minecraft.World/Entities/ItemEntity.h rename to Minecraft.World/net/minecraft/world/entity/item/ItemEntity.h index c5e8a3ae4..2ac4c80ea 100644 --- a/Minecraft.World/Entities/ItemEntity.h +++ b/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.h @@ -1,6 +1,6 @@ #pragma once -#include "Entity.h" -#include "../Util/SharedConstants.h" +#include "../Entity.h" +#include "../../../SharedConstants.h" class Player; diff --git a/Minecraft.World/Entities/Mobs/Minecart.cpp b/Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp similarity index 96% rename from Minecraft.World/Entities/Mobs/Minecart.cpp rename to Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp index d66e830e2..2a7684c6f 100644 --- a/Minecraft.World/Entities/Mobs/Minecart.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp @@ -1,21 +1,21 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../../Minecraft.Client/MinecraftServer.h" -#include "../../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/dimension/net.minecraft.world.level.dimension.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../animal/net.minecraft.world.entity.animal.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Minecart.h" #include #include -#include "../../Util/SharedConstants.h" +#include "../../../SharedConstants.h" const int Minecart::EXITS[][2][3] = { // diff --git a/Minecraft.World/Entities/Mobs/Minecart.h b/Minecraft.World/net/minecraft/world/entity/item/Minecart.h similarity index 100% rename from Minecraft.World/Entities/Mobs/Minecart.h rename to Minecraft.World/net/minecraft/world/entity/item/Minecart.h diff --git a/Minecraft.World/Entities/MinecartChest.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartChest.cpp similarity index 85% rename from Minecraft.World/Entities/MinecartChest.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartChest.cpp index 8efbf811b..b56e8bad1 100644 --- a/Minecraft.World/Entities/MinecartChest.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartChest.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../network/packet/net.minecraft.network.packet.h" #include "MinecartChest.h" MinecartChest::MinecartChest(Level* level) : MinecartContainer(level) { diff --git a/Minecraft.World/Entities/MinecartChest.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartChest.h similarity index 100% rename from Minecraft.World/Entities/MinecartChest.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartChest.h diff --git a/Minecraft.World/Entities/MinecartContainer.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp similarity index 95% rename from Minecraft.World/Entities/MinecartContainer.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp index 0a1a5f0ab..e38f93e01 100644 --- a/Minecraft.World/Entities/MinecartContainer.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/redstone/net.minecraft.world.level.redstone.h" #include "MinecartContainer.h" void MinecartContainer::_init() { diff --git a/Minecraft.World/Entities/MinecartContainer.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h similarity index 95% rename from Minecraft.World/Entities/MinecartContainer.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h index 7831cb4c4..88f900304 100644 --- a/Minecraft.World/Entities/MinecartContainer.h +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h @@ -1,7 +1,7 @@ #pragma once -#include "Mobs/Minecart.h" -#include "../Containers/Container.h" +#include "Minecart.h" +#include "../../Container.h" class MinecartContainer : public Minecart, public virtual Container { private: diff --git a/Minecraft.World/Entities/MinecartFurnace.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartFurnace.cpp similarity index 90% rename from Minecraft.World/Entities/MinecartFurnace.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartFurnace.cpp index b075af545..fff44c184 100644 --- a/Minecraft.World/Entities/MinecartFurnace.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartFurnace.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.network.packet.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../net.minecraft.world.entity.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../network/packet/net.minecraft.network.packet.h" #include "MinecartFurnace.h" MinecartFurnace::MinecartFurnace(Level* level) : Minecart(level) { diff --git a/Minecraft.World/Entities/MinecartFurnace.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartFurnace.h similarity index 97% rename from Minecraft.World/Entities/MinecartFurnace.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartFurnace.h index 25e359bbd..a0d3f2742 100644 --- a/Minecraft.World/Entities/MinecartFurnace.h +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartFurnace.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Minecart.h" +#include "Minecart.h" class MinecartFurnace : public Minecart { public: diff --git a/Minecraft.World/Entities/MinecartHopper.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.cpp similarity index 87% rename from Minecraft.World/Entities/MinecartHopper.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.cpp index 58ad09612..d642f28e6 100644 --- a/Minecraft.World/Entities/MinecartHopper.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "net.minecraft.world.entity.item.h" +#include "../../phys/net.minecraft.world.phys.h" #include "MinecartHopper.h" const int MinecartHopper::MOVE_ITEM_SPEED = diff --git a/Minecraft.World/Entities/MinecartHopper.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.h similarity index 98% rename from Minecraft.World/Entities/MinecartHopper.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.h index 102bb77c8..641672f33 100644 --- a/Minecraft.World/Entities/MinecartHopper.h +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartHopper.h @@ -1,7 +1,7 @@ #pragma once #include "MinecartContainer.h" -#include "../Blocks/TileEntities/Hopper.h" +#include "../../level/tile/entity/Hopper.h" class MinecartHopper : public MinecartContainer, public Hopper { public: diff --git a/Minecraft.World/Entities/MinecartRideable.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartRideable.cpp similarity index 83% rename from Minecraft.World/Entities/MinecartRideable.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartRideable.cpp index 1e04c5f94..273caf3e3 100644 --- a/Minecraft.World/Entities/MinecartRideable.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartRideable.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../level/net.minecraft.world.level.h" #include "MinecartRideable.h" MinecartRideable::MinecartRideable(Level* level) : Minecart(level) { diff --git a/Minecraft.World/Entities/MinecartRideable.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartRideable.h similarity index 93% rename from Minecraft.World/Entities/MinecartRideable.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartRideable.h index 7f2f78a42..2a88df22e 100644 --- a/Minecraft.World/Entities/MinecartRideable.h +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartRideable.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Minecart.h" +#include "Minecart.h" class MinecartRideable : public Minecart { public: diff --git a/Minecraft.World/Entities/MinecartSpawner.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartSpawner.cpp similarity index 92% rename from Minecraft.World/Entities/MinecartSpawner.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartSpawner.cpp index 7b8f4b188..96f040ca4 100644 --- a/Minecraft.World/Entities/MinecartSpawner.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartSpawner.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" #include "MinecartSpawner.h" MinecartSpawner::MinecartMobSpawner::MinecartMobSpawner( diff --git a/Minecraft.World/Entities/MinecartSpawner.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartSpawner.h similarity index 94% rename from Minecraft.World/Entities/MinecartSpawner.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartSpawner.h index 34f9a5573..74ffbf86c 100644 --- a/Minecraft.World/Entities/MinecartSpawner.h +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartSpawner.h @@ -1,7 +1,7 @@ #pragma once -#include "Mobs/Minecart.h" -#include "../Level/BaseMobSpawner.h" +#include "Minecart.h" +#include "../../level/BaseMobSpawner.h" class MinecartSpawner : public Minecart { public: diff --git a/Minecraft.World/Entities/MinecartTNT.cpp b/Minecraft.World/net/minecraft/world/entity/item/MinecartTNT.cpp similarity index 94% rename from Minecraft.World/Entities/MinecartTNT.cpp rename to Minecraft.World/net/minecraft/world/entity/item/MinecartTNT.cpp index 32239b129..97ee6a9b4 100644 --- a/Minecraft.World/Entities/MinecartTNT.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartTNT.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" #include "MinecartTNT.h" void MinecartTNT::_init() { diff --git a/Minecraft.World/Entities/MinecartTNT.h b/Minecraft.World/net/minecraft/world/entity/item/MinecartTNT.h similarity index 97% rename from Minecraft.World/Entities/MinecartTNT.h rename to Minecraft.World/net/minecraft/world/entity/item/MinecartTNT.h index 80a51ccbc..4b9d8f507 100644 --- a/Minecraft.World/Entities/MinecartTNT.h +++ b/Minecraft.World/net/minecraft/world/entity/item/MinecartTNT.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Minecart.h" +#include "Minecart.h" class MinecartTNT : public Minecart { public: diff --git a/Minecraft.World/Entities/Mobs/PrimedTnt.cpp b/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp similarity index 90% rename from Minecraft.World/Entities/Mobs/PrimedTnt.cpp rename to Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp index 8fd49dce9..97d337b41 100644 --- a/Minecraft.World/Entities/Mobs/PrimedTnt.cpp +++ b/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/JavaMath.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../level/net.minecraft.world.level.h" #include "PrimedTnt.h" void PrimedTnt::_init() { diff --git a/Minecraft.World/Entities/Mobs/PrimedTnt.h b/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.h similarity index 100% rename from Minecraft.World/Entities/Mobs/PrimedTnt.h rename to Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.h diff --git a/Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h b/Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h new file mode 100644 index 000000000..575f18b52 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h @@ -0,0 +1,14 @@ +#pragma once + +#include "Boat.h" +#include "FallingTile.h" +#include "ItemEntity.h" +#include "Minecart.h" +#include "MinecartChest.h" +#include "MinecartContainer.h" +#include "MinecartHopper.h" +#include "MinecartFurnace.h" +#include "MinecartRideable.h" +#include "MinecartSpawner.h" +#include "MinecartTNT.h" +#include "PrimedTnt.h" diff --git a/Minecraft.World/Entities/Mobs/Blaze.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp similarity index 88% rename from Minecraft.World/Entities/Mobs/Blaze.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp index dc1306dee..7a79dbb7a 100644 --- a/Minecraft.World/Entities/Mobs/Blaze.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Util/SharedConstants.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.monster.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../../../SharedConstants.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "Blaze.h" -#include "../../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" Blaze::Blaze(Level* level) : Monster(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/Blaze.h b/Minecraft.World/net/minecraft/world/entity/monster/Blaze.h similarity index 97% rename from Minecraft.World/Entities/Mobs/Blaze.h rename to Minecraft.World/net/minecraft/world/entity/monster/Blaze.h index 54c6b11cf..30424f3ab 100644 --- a/Minecraft.World/Entities/Mobs/Blaze.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Blaze.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" class Blaze : public Monster { public: diff --git a/Minecraft.World/Entities/Mobs/CaveSpider.cpp b/Minecraft.World/net/minecraft/world/entity/monster/CaveSpider.cpp similarity index 77% rename from Minecraft.World/Entities/Mobs/CaveSpider.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/CaveSpider.cpp index 3e3a9ebfa..3f425df9e 100644 --- a/Minecraft.World/Entities/Mobs/CaveSpider.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/CaveSpider.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/SharedConstants.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../SharedConstants.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "CaveSpider.h" CaveSpider::CaveSpider(Level* level) : Spider(level) { diff --git a/Minecraft.World/Entities/Mobs/CaveSpider.h b/Minecraft.World/net/minecraft/world/entity/monster/CaveSpider.h similarity index 100% rename from Minecraft.World/Entities/Mobs/CaveSpider.h rename to Minecraft.World/net/minecraft/world/entity/monster/CaveSpider.h diff --git a/Minecraft.World/Entities/Mobs/Creeper.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Creeper.cpp similarity index 83% rename from Minecraft.World/Entities/Mobs/Creeper.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Creeper.cpp index a89674da1..a1eeb74ca 100644 --- a/Minecraft.World/Entities/Mobs/Creeper.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Creeper.cpp @@ -1,22 +1,22 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Stats/GeneralStat.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../animal/net.minecraft.world.entity.animal.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../stats/GeneralStat.h" #include "Skeleton.h" #include "Creeper.h" -#include "Arrow.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../projectile/Arrow.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" void Creeper::_init() { swell = 0; diff --git a/Minecraft.World/Entities/Mobs/Creeper.h b/Minecraft.World/net/minecraft/world/entity/monster/Creeper.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Creeper.h rename to Minecraft.World/net/minecraft/world/entity/monster/Creeper.h index d071431c3..3936e5b86 100644 --- a/Minecraft.World/Entities/Mobs/Creeper.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Creeper.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" class Level; class DamageSource; diff --git a/Minecraft.World/Entities/Mobs/EnderMan.cpp b/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp similarity index 94% rename from Minecraft.World/Entities/Mobs/EnderMan.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp index d87427e23..ec17138b8 100644 --- a/Minecraft.World/Entities/Mobs/EnderMan.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp @@ -1,15 +1,15 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "EnderMan.h" AttributeModifier* EnderMan::SPEED_MODIFIER_ATTACKING = diff --git a/Minecraft.World/Entities/Mobs/EnderMan.h b/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.h similarity index 98% rename from Minecraft.World/Entities/Mobs/EnderMan.h rename to Minecraft.World/net/minecraft/world/entity/monster/EnderMan.h index 5acd6ab9b..cea60740a 100644 --- a/Minecraft.World/Entities/Mobs/EnderMan.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" class EnderMan : public Monster { public: diff --git a/Minecraft.World/Entities/Enemy.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Enemy.cpp similarity index 83% rename from Minecraft.World/Entities/Enemy.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Enemy.cpp index 3ca407447..759055226 100644 --- a/Minecraft.World/Entities/Enemy.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Enemy.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "Enemy.h" EntitySelector* Enemy::ENEMY_SELECTOR = new Enemy::EnemyEntitySelector(); diff --git a/Minecraft.World/Entities/Enemy.h b/Minecraft.World/net/minecraft/world/entity/monster/Enemy.h similarity index 89% rename from Minecraft.World/Entities/Enemy.h rename to Minecraft.World/net/minecraft/world/entity/monster/Enemy.h index 87d72edf2..86079fbf1 100644 --- a/Minecraft.World/Entities/Enemy.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Enemy.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Creature.h" -#include "EntitySelector.h" +#include "../Creature.h" +#include "../EntitySelector.h" class Enemy : public Creature { public: diff --git a/Minecraft.World/Entities/Mobs/Ghast.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp similarity index 88% rename from Minecraft.World/Entities/Mobs/Ghast.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp index eed316638..7d7b69ac5 100644 --- a/Minecraft.World/Entities/Mobs/Ghast.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp @@ -1,19 +1,19 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.stats.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../stats/net.minecraft.stats.h" #include "Ghast.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Level/Events/LevelEvent.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../level/tile/LevelEvent.h" +#include "../../../../../Header Files/SoundTypes.h" void Ghast::_init() { explosionPower = 1; diff --git a/Minecraft.World/Entities/Mobs/Ghast.h b/Minecraft.World/net/minecraft/world/entity/monster/Ghast.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Ghast.h rename to Minecraft.World/net/minecraft/world/entity/monster/Ghast.h index 828cf8df2..2a73c42b2 100644 --- a/Minecraft.World/Entities/Mobs/Ghast.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Ghast.h @@ -1,7 +1,7 @@ #pragma once #include "../FlyingMob.h" -#include "../Enemy.h" +#include "Enemy.h" class GhastClass; class Level; diff --git a/Minecraft.World/Entities/Mobs/Giant.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Giant.cpp similarity index 71% rename from Minecraft.World/Entities/Mobs/Giant.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Giant.cpp index 29748a797..9da20c686 100644 --- a/Minecraft.World/Entities/Mobs/Giant.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Giant.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.monster.h" #include "Giant.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" Giant::Giant(Level* level) : Monster(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/Giant.h b/Minecraft.World/net/minecraft/world/entity/monster/Giant.h similarity index 93% rename from Minecraft.World/Entities/Mobs/Giant.h rename to Minecraft.World/net/minecraft/world/entity/monster/Giant.h index a9663eee5..5512a9fd0 100644 --- a/Minecraft.World/Entities/Mobs/Giant.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Giant.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" class Level; diff --git a/Minecraft.World/Entities/Mobs/LavaSlime.cpp b/Minecraft.World/net/minecraft/world/entity/monster/LavaSlime.cpp similarity index 86% rename from Minecraft.World/Entities/Mobs/LavaSlime.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/LavaSlime.cpp index bcf420571..23b96de1b 100644 --- a/Minecraft.World/Entities/Mobs/LavaSlime.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/LavaSlime.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "LavaSlime.h" -#include "../../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" LavaSlime::LavaSlime(Level* level) : Slime(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/LavaSlime.h b/Minecraft.World/net/minecraft/world/entity/monster/LavaSlime.h similarity index 100% rename from Minecraft.World/Entities/Mobs/LavaSlime.h rename to Minecraft.World/net/minecraft/world/entity/monster/LavaSlime.h diff --git a/Minecraft.World/Entities/Monster.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp similarity index 87% rename from Minecraft.World/Entities/Monster.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp index 976ed393d..5b676f715 100644 --- a/Minecraft.World/Entities/Monster.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp @@ -1,16 +1,16 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" #include "Monster.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" Monster::Monster(Level* level) : PathfinderMob(level) { xpReward = Enemy::XP_REWARD_MEDIUM; diff --git a/Minecraft.World/Entities/Monster.h b/Minecraft.World/net/minecraft/world/entity/monster/Monster.h similarity index 96% rename from Minecraft.World/Entities/Monster.h rename to Minecraft.World/net/minecraft/world/entity/monster/Monster.h index 8b83b2c59..fafe5b016 100644 --- a/Minecraft.World/Entities/Monster.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Monster.h @@ -1,6 +1,6 @@ #pragma once -#include "PathfinderMob.h" +#include "../PathfinderMob.h" #include "Enemy.h" class Level; diff --git a/Minecraft.World/Entities/Mobs/PigZombie.cpp b/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp similarity index 85% rename from Minecraft.World/Entities/Mobs/PigZombie.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp index 826d1e928..aad74a52b 100644 --- a/Minecraft.World/Entities/Mobs/PigZombie.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.enchantment.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.damagesource.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../net.minecraft.world.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" #include "PigZombie.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" AttributeModifier* PigZombie::SPEED_MODIFIER_ATTACKING = (new AttributeModifier(eModifierId_MOB_PIG_ATTACKSPEED, 0.45, diff --git a/Minecraft.World/Entities/Mobs/PigZombie.h b/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.h similarity index 100% rename from Minecraft.World/Entities/Mobs/PigZombie.h rename to Minecraft.World/net/minecraft/world/entity/monster/PigZombie.h diff --git a/Minecraft.World/Entities/Mobs/RangedAttackMob.h b/Minecraft.World/net/minecraft/world/entity/monster/RangedAttackMob.h similarity index 100% rename from Minecraft.World/Entities/Mobs/RangedAttackMob.h rename to Minecraft.World/net/minecraft/world/entity/monster/RangedAttackMob.h diff --git a/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp b/Minecraft.World/net/minecraft/world/entity/monster/SharedMonsterAttributes.cpp similarity index 97% rename from Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/SharedMonsterAttributes.cpp index 51e69bd54..cb22aaa11 100644 --- a/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/SharedMonsterAttributes.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" +#include "../../../../../Header Files/stdafx.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" #include "SharedMonsterAttributes.h" #include diff --git a/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.h b/Minecraft.World/net/minecraft/world/entity/monster/SharedMonsterAttributes.h similarity index 100% rename from Minecraft.World/Entities/Mobs/SharedMonsterAttributes.h rename to Minecraft.World/net/minecraft/world/entity/monster/SharedMonsterAttributes.h diff --git a/Minecraft.World/Entities/Mobs/Silverfish.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Silverfish.cpp similarity index 92% rename from Minecraft.World/Entities/Mobs/Silverfish.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Silverfish.cpp index b99fa8c5e..edd04c118 100644 --- a/Minecraft.World/Entities/Mobs/Silverfish.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Silverfish.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../../net.minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "Silverfish.h" -#include "../../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" Silverfish::Silverfish(Level* level) : Monster(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/Silverfish.h b/Minecraft.World/net/minecraft/world/entity/monster/Silverfish.h similarity index 97% rename from Minecraft.World/Entities/Mobs/Silverfish.h rename to Minecraft.World/net/minecraft/world/entity/monster/Silverfish.h index f27d8b6f8..417cc69d8 100644 --- a/Minecraft.World/Entities/Mobs/Silverfish.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Silverfish.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" class Silverfish : public Monster { public: diff --git a/Minecraft.World/Entities/Mobs/Skeleton.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Skeleton.cpp similarity index 88% rename from Minecraft.World/Entities/Mobs/Skeleton.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Skeleton.cpp index ac8cb3b03..4a9e9123c 100644 --- a/Minecraft.World/Entities/Mobs/Skeleton.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Skeleton.cpp @@ -1,26 +1,26 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.enchantment.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.stats.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Util/SharedConstants.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/dimension/net.minecraft.world.level.dimension.h" +#include "../../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../SharedConstants.h" #include "Skeleton.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" Skeleton::Skeleton(Level* level) : Monster(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/Skeleton.h b/Minecraft.World/net/minecraft/world/entity/monster/Skeleton.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Skeleton.h rename to Minecraft.World/net/minecraft/world/entity/monster/Skeleton.h index 714700696..e54779b40 100644 --- a/Minecraft.World/Entities/Mobs/Skeleton.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Skeleton.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" #include "RangedAttackMob.h" class RangedAttackGoal; diff --git a/Minecraft.World/Entities/Mobs/Slime.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp similarity index 89% rename from Minecraft.World/Entities/Mobs/Slime.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp index 35d8d96cd..d62d23533 100644 --- a/Minecraft.World/Entities/Mobs/Slime.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/storage/net.minecraft.world.level.storage.h" +#include "../../level/chunk/net.minecraft.world.level.chunk.h" +#include "../net.minecraft.world.entity.h" +#include "../../item/net.minecraft.world.item.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Slime.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" void Slime::_init() { jumpDelay = 0; diff --git a/Minecraft.World/Entities/Mobs/Slime.h b/Minecraft.World/net/minecraft/world/entity/monster/Slime.h similarity index 95% rename from Minecraft.World/Entities/Mobs/Slime.h rename to Minecraft.World/net/minecraft/world/entity/monster/Slime.h index 51483983a..908182f86 100644 --- a/Minecraft.World/Entities/Mobs/Slime.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Slime.h @@ -1,8 +1,8 @@ #pragma once #include "../Mob.h" -#include "../Enemy.h" -#include "../../Util/ParticleTypes.h" +#include "Enemy.h" +#include "../../../../../Header Files/ParticleTypes.h" class Slime : public Mob, public Enemy { public: diff --git a/Minecraft.World/Entities/Mobs/Spider.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp similarity index 88% rename from Minecraft.World/Entities/Mobs/Spider.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp index 8cef7de42..ab1d13291 100644 --- a/Minecraft.World/Entities/Mobs/Spider.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.monster.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Spider.h" #include -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Util/SoundTypes.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../../../../Header Files/SoundTypes.h" Spider::Spider(Level* level) : Monster(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/Spider.h b/Minecraft.World/net/minecraft/world/entity/monster/Spider.h similarity index 96% rename from Minecraft.World/Entities/Mobs/Spider.h rename to Minecraft.World/net/minecraft/world/entity/monster/Spider.h index 30d7a9509..514b61225 100644 --- a/Minecraft.World/Entities/Mobs/Spider.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Spider.h @@ -1,7 +1,7 @@ #pragma once -#include "../Monster.h" -#include "MobGroupData.h" +#include "Monster.h" +#include "../MobGroupData.h" class Spider : public Monster { public: diff --git a/Minecraft.World/Entities/Mobs/Witch.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Witch.cpp similarity index 91% rename from Minecraft.World/Entities/Mobs/Witch.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Witch.cpp index 40e40e77f..acec86850 100644 --- a/Minecraft.World/Entities/Mobs/Witch.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Witch.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.projectile.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.alchemy.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "net.minecraft.world.entity.monster.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" #include "Witch.h" AttributeModifier* Witch::SPEED_MODIFIER_DRINKING = diff --git a/Minecraft.World/Entities/Mobs/Witch.h b/Minecraft.World/net/minecraft/world/entity/monster/Witch.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Witch.h rename to Minecraft.World/net/minecraft/world/entity/monster/Witch.h index 07277ba8a..6c192e85d 100644 --- a/Minecraft.World/Entities/Mobs/Witch.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Witch.h @@ -1,6 +1,6 @@ #pragma once -#include "../Monster.h" +#include "Monster.h" #include "RangedAttackMob.h" class Witch : public Monster, public RangedAttackMob { diff --git a/Minecraft.World/Entities/Mobs/Zombie.cpp b/Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp similarity index 94% rename from Minecraft.World/Entities/Mobs/Zombie.cpp rename to Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp index 3fbd91058..1e2f16257 100644 --- a/Minecraft.World/Entities/Mobs/Zombie.cpp +++ b/Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp @@ -1,23 +1,23 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.target.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Headers/net.minecraft.world.entity.player.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/goal/target/net.minecraft.world.entity.ai.goal.target.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "net.minecraft.world.entity.monster.h" +#include "../npc/net.minecraft.world.entity.npc.h" +#include "../player/net.minecraft.world.entity.player.h" #include "Zombie.h" -#include "../../Stats/GenericStats.h" -#include "../../../Minecraft.Client/Textures/Textures.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Util/JavaMath.h" -#include "../../Util/SoundTypes.h" +#include "../../../stats/GenericStats.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../net.minecraft.world.entity.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../../../Header Files/SoundTypes.h" Attribute* Zombie::SPAWN_REINFORCEMENTS_CHANCE = (new RangedAttribute(eAttributeId_ZOMBIE_SPAWNREINFORCEMENTS, 0, 0, 1)); diff --git a/Minecraft.World/Entities/Mobs/Zombie.h b/Minecraft.World/net/minecraft/world/entity/monster/Zombie.h similarity index 96% rename from Minecraft.World/Entities/Mobs/Zombie.h rename to Minecraft.World/net/minecraft/world/entity/monster/Zombie.h index 0e766ee1c..4e88fdf4a 100644 --- a/Minecraft.World/Entities/Mobs/Zombie.h +++ b/Minecraft.World/net/minecraft/world/entity/monster/Zombie.h @@ -1,8 +1,8 @@ #pragma once -#include "../Monster.h" -#include "../../Util/SharedConstants.h" -#include "MobGroupData.h" +#include "Monster.h" +#include "../../../SharedConstants.h" +#include "../MobGroupData.h" class Zombie : public Monster { private: diff --git a/Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h b/Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h new file mode 100644 index 000000000..edeaf9259 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/monster/net.minecraft.world.entity.monster.h @@ -0,0 +1,26 @@ +#pragma once + +#include "Enemy.h" +#include "Monster.h" +#include "Creeper.h" +#include "Ghast.h" +#include "Giant.h" +#include "Zombie.h" +#include "PigZombie.h" +#include "Skeleton.h" +#include "Slime.h" +#include "Spider.h" + +// 1.8.2 +#include "CaveSpider.h" +#include "EnderMan.h" +#include "Silverfish.h" + +// 1.0.1 +#include "Blaze.h" +#include "LavaSlime.h" + +// 1.6.4 +#include "RangedAttackMob.h" +#include "SharedMonsterAttributes.h" +#include "Witch.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h b/Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h new file mode 100644 index 000000000..8b6a7e0dd --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h @@ -0,0 +1,34 @@ +#pragma once + +#include "Creature.h" +#include "SyncedEntityData.h" +#include "Entity.h" +#include "EntityEvent.h" +#include "EntityIO.h" +#include "EntityPos.h" +#include "FlyingMob.h" +#include "Mob.h" +#include "MobCategory.h" +#include "Painting.h" +#include "PathfinderMob.h" + +// 1.8.2 +#include "DelayedRelease.h" +#include "ExperienceOrb.h" + +// 1.0.1 +#include "MobType.h" + +// TU9 +#include "ItemFrame.h" + +// 1.2.3 +#include "AgeableMob.h" +#include "TamableAnimal.h" + +// 1.6.4 +#include "LeashFenceKnotEntity.h" +#include "MobGroupData.h" +#include "OwnableEntity.h" +#include "EntitySelector.h" +#include "LivingEntity.h" \ No newline at end of file diff --git a/Minecraft.World/Containers/ClientSideMerchant.cpp b/Minecraft.World/net/minecraft/world/entity/npc/ClientSideMerchant.cpp similarity index 88% rename from Minecraft.World/Containers/ClientSideMerchant.cpp rename to Minecraft.World/net/minecraft/world/entity/npc/ClientSideMerchant.cpp index f8763ca0b..6587f7f1d 100644 --- a/Minecraft.World/Containers/ClientSideMerchant.cpp +++ b/Minecraft.World/net/minecraft/world/entity/npc/ClientSideMerchant.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.trading.h" -#include "../Headers/net.minecraft.world.inventory.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/trading/net.minecraft.world.item.trading.h" +#include "../../inventory/net.minecraft.world.inventory.h" #include "ClientSideMerchant.h" ClientSideMerchant::ClientSideMerchant(std::shared_ptr source, diff --git a/Minecraft.World/Containers/ClientSideMerchant.h b/Minecraft.World/net/minecraft/world/entity/npc/ClientSideMerchant.h similarity index 95% rename from Minecraft.World/Containers/ClientSideMerchant.h rename to Minecraft.World/net/minecraft/world/entity/npc/ClientSideMerchant.h index 30d41e60b..873f32401 100644 --- a/Minecraft.World/Containers/ClientSideMerchant.h +++ b/Minecraft.World/net/minecraft/world/entity/npc/ClientSideMerchant.h @@ -1,6 +1,6 @@ #pragma once -#include "Merchant.h" +#include "../../item/trading/Merchant.h" class MerchantContainer; class MerchantRecipeList; diff --git a/Minecraft.World/net/minecraft/world/entity/npc/Npc.cpp b/Minecraft.World/net/minecraft/world/entity/npc/Npc.cpp new file mode 100644 index 000000000..4b72857e6 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/npc/Npc.cpp @@ -0,0 +1,3 @@ +#include "../../../../../Header Files/stdafx.h" + +#include "Npc.h" diff --git a/Minecraft.World/Entities/Mobs/Npc.h b/Minecraft.World/net/minecraft/world/entity/npc/Npc.h similarity index 76% rename from Minecraft.World/Entities/Mobs/Npc.h rename to Minecraft.World/net/minecraft/world/entity/npc/Npc.h index 545daa1da..49073c92e 100644 --- a/Minecraft.World/Entities/Mobs/Npc.h +++ b/Minecraft.World/net/minecraft/world/entity/npc/Npc.h @@ -1,6 +1,6 @@ #pragma once -#include "Creature.h" +#include "../Creature.h" class Level; diff --git a/Minecraft.World/Entities/Mobs/Villager.cpp b/Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp similarity index 96% rename from Minecraft.World/Entities/Mobs/Villager.cpp rename to Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp index e0b19a30f..732c2fd42 100644 --- a/Minecraft.World/Entities/Mobs/Villager.cpp +++ b/Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp @@ -1,20 +1,20 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../../Headers/net.minecraft.world.entity.ai.navigation.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.enchantment.h" -#include "../../Headers/net.minecraft.world.item.trading.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.Client/Textures/Textures.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" +#include "../ai/village/net.minecraft.world.entity.ai.village.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../net.minecraft.world.entity.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../item/trading/net.minecraft.world.item.trading.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "Villager.h" namespace { diff --git a/Minecraft.World/Entities/Mobs/Villager.h b/Minecraft.World/net/minecraft/world/entity/npc/Villager.h similarity index 97% rename from Minecraft.World/Entities/Mobs/Villager.h rename to Minecraft.World/net/minecraft/world/entity/npc/Villager.h index e4be4d88b..2544d2706 100644 --- a/Minecraft.World/Entities/Mobs/Villager.h +++ b/Minecraft.World/net/minecraft/world/entity/npc/Villager.h @@ -1,9 +1,9 @@ #pragma once -#include "AgeableMob.h" +#include "../AgeableMob.h" #include "Npc.h" -#include "../../Containers/Merchant.h" -#include "../../Util/ParticleTypes.h" +#include "../../item/trading/Merchant.h" +#include "../../../../../Header Files/ParticleTypes.h" class Level; class Village; diff --git a/Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h b/Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h new file mode 100644 index 000000000..2874bcd7f --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/npc/net.minecraft.world.entity.npc.h @@ -0,0 +1,5 @@ +#pragma once + +#include "Npc.h" +#include "Villager.h" +#include "ClientSideMerchant.h" \ No newline at end of file diff --git a/Minecraft.World/Player/Abilities.cpp b/Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp similarity index 93% rename from Minecraft.World/Player/Abilities.cpp rename to Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp index d5e1b913f..bccbdcf08 100644 --- a/Minecraft.World/Player/Abilities.cpp +++ b/Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Abilities.h" Abilities::Abilities() { diff --git a/Minecraft.World/Player/Abilities.h b/Minecraft.World/net/minecraft/world/entity/player/Abilities.h similarity index 100% rename from Minecraft.World/Player/Abilities.h rename to Minecraft.World/net/minecraft/world/entity/player/Abilities.h diff --git a/Minecraft.World/Containers/Inventory.cpp b/Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp similarity index 98% rename from Minecraft.World/Containers/Inventory.cpp rename to Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp index ea30b2cee..8b682b0c8 100644 --- a/Minecraft.World/Containers/Inventory.cpp +++ b/Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Blocks/Material.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../level/material/Material.h" #include "Inventory.h" const int Inventory::POP_TIME_DURATION = 5; diff --git a/Minecraft.World/Containers/Inventory.h b/Minecraft.World/net/minecraft/world/entity/player/Inventory.h similarity index 96% rename from Minecraft.World/Containers/Inventory.h rename to Minecraft.World/net/minecraft/world/entity/player/Inventory.h index 82b8db031..9af2a7d83 100644 --- a/Minecraft.World/Containers/Inventory.h +++ b/Minecraft.World/net/minecraft/world/entity/player/Inventory.h @@ -1,7 +1,7 @@ #pragma once -#include "Container.h" -#include "../IO/NBT/ListTag.h" -#include "../Items/ItemInstance.h" +#include "../../Container.h" +#include "../../../../../com/mojang/nbt/ListTag.h" +#include "../../item/ItemInstance.h" class Player; class CompoundTag; diff --git a/Minecraft.World/Player/Player.cpp b/Minecraft.World/net/minecraft/world/entity/player/Player.cpp similarity index 97% rename from Minecraft.World/Player/Player.cpp rename to Minecraft.World/net/minecraft/world/entity/player/Player.cpp index a89270574..82272c440 100644 --- a/Minecraft.World/Player/Player.cpp +++ b/Minecraft.World/net/minecraft/world/entity/player/Player.cpp @@ -7,43 +7,43 @@ // derives from, and not to find the derived class itself (which should own the // virtual GetType function) -#include "../Platform/stdafx.h" -#include "../Util/JavaMath.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.chunk.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.boss.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.scores.h" -#include "../Headers/net.minecraft.world.scores.criteria.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Containers/Inventory.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/chunk/net.minecraft.world.level.chunk.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.entity.h" +#include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../animal/net.minecraft.world.entity.animal.h" +#include "../boss/net.minecraft.world.entity.boss.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../level/dimension/net.minecraft.world.level.dimension.h" +#include "../../level/material/net.minecraft.world.level.material.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../scores/net.minecraft.world.scores.h" +#include "../../scores/criteria/net.minecraft.world.scores.criteria.h" +#include "../projectile/net.minecraft.world.entity.projectile.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../food/net.minecraft.world.food.h" +#include "Inventory.h" #include "Player.h" -#include "../Util/ParticleTypes.h" +#include "../../../../../Header Files/ParticleTypes.h" #include #include -#include "../../Minecraft.Client/Textures/Textures.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.Client/Rendering/Models/HumanoidModel.h" -#include "../Util/SoundTypes.h" +#include "../../Minecraft.Client/net/minecraft/client/player/LocalPlayer.h" +#include "../../Minecraft.Client/net/minecraft/client/model/HumanoidModel.h" +#include "../../../../../Header Files/SoundTypes.h" void Player::_init() { registerAttributes(); diff --git a/Minecraft.World/Player/Player.h b/Minecraft.World/net/minecraft/world/entity/player/Player.h similarity index 98% rename from Minecraft.World/Player/Player.h rename to Minecraft.World/net/minecraft/world/entity/player/Player.h index 563aa6c17..4fbe69218 100644 --- a/Minecraft.World/Player/Player.h +++ b/Minecraft.World/net/minecraft/world/entity/player/Player.h @@ -2,13 +2,13 @@ #include -#include "../Entities/LivingEntity.h" -#include "../Util/Definitions.h" +#include "../LivingEntity.h" +#include "../../../../../ConsoleHelpers/Definitions.h" #include "Abilities.h" -#include "FoodData.h" -#include "PlayerEnderChestContainer.h" -#include "../Commands/CommandSender.h" -#include "../Scores/ScoreHolder.h" +#include "../../food/FoodData.h" +#include "../../inventory/PlayerEnderChestContainer.h" +#include "../../../commands/CommandSender.h" +#include "../../scores/ScoreHolder.h" class AbstractContainerMenu; class Stats; diff --git a/Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h b/Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h new file mode 100644 index 000000000..9394b89bd --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h @@ -0,0 +1,5 @@ +#pragma once + +#include "Inventory.h" +#include "Player.h" +#include "Abilities.h" \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/Arrow.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp similarity index 94% rename from Minecraft.World/Entities/Mobs/Arrow.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp index 26da380fd..a83e6773b 100644 --- a/Minecraft.World/Entities/Mobs/Arrow.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp @@ -1,22 +1,22 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.item.enchantment.h" -#include "../../Headers/net.minecraft.network.packet.h" -#include "../../../Minecraft.Client/Player/ServerPlayer.h" -#include "../../../Minecraft.Client/Network/PlayerConnection.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.entity.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../../network/packet/net.minecraft.network.packet.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" +#include "../../../Minecraft.Client/net/minecraft/server/network/PlayerConnection.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Arrow.h" // 4J : WESTY : Added for other award, kill creeper with arrow. -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.stats.h" -#include "../../Util/SoundTypes.h" +#include "../monster/net.minecraft.world.entity.monster.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../../../../Header Files/SoundTypes.h" // base damage, multiplied with velocity const double Arrow::ARROW_BASE_DAMAGE = 2.0f; diff --git a/Minecraft.World/Entities/Mobs/Arrow.h b/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.h similarity index 98% rename from Minecraft.World/Entities/Mobs/Arrow.h rename to Minecraft.World/net/minecraft/world/entity/projectile/Arrow.h index 919df0c04..629fb19f7 100644 --- a/Minecraft.World/Entities/Mobs/Arrow.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.h @@ -1,7 +1,7 @@ #pragma once #include "../Entity.h" -#include "../Projectile.h" +#include "Projectile.h" class Level; class CompoundTag; diff --git a/Minecraft.World/Entities/Mobs/DragonFireball.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp similarity index 86% rename from Minecraft.World/Entities/Mobs/DragonFireball.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp index 2ccac22f1..c68dfc4d0 100644 --- a/Minecraft.World/Entities/Mobs/DragonFireball.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Util/JavaMath.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" #include "DragonFireball.h" const double DragonFireball::SPLASH_RANGE = 4.0; diff --git a/Minecraft.World/Entities/Mobs/DragonFireball.h b/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.h similarity index 100% rename from Minecraft.World/Entities/Mobs/DragonFireball.h rename to Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.h diff --git a/Minecraft.World/Entities/Mobs/EyeOfEnderSignal.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp similarity index 91% rename from Minecraft.World/Entities/Mobs/EyeOfEnderSignal.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp index ed3311a2c..ac3e384ef 100644 --- a/Minecraft.World/Entities/Mobs/EyeOfEnderSignal.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Util/SharedConstants.h" -#include "../../Util/JavaMath.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../../../SharedConstants.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" #include "EyeOfEnderSignal.h" void EyeOfEnderSignal::_init() { diff --git a/Minecraft.World/Entities/Mobs/EyeOfEnderSignal.h b/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.h similarity index 100% rename from Minecraft.World/Entities/Mobs/EyeOfEnderSignal.h rename to Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.h diff --git a/Minecraft.World/Entities/Mobs/Fireball.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp similarity index 94% rename from Minecraft.World/Entities/Mobs/Fireball.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp index 5128b6877..0797e0d8f 100644 --- a/Minecraft.World/Entities/Mobs/Fireball.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Fireball.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Util/SharedConstants.h" +#include "../../level/dimension/net.minecraft.world.level.dimension.h" +#include "../../../SharedConstants.h" // 4J - added common ctor code. void Fireball::_init() { diff --git a/Minecraft.World/Entities/Mobs/Fireball.h b/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.h similarity index 96% rename from Minecraft.World/Entities/Mobs/Fireball.h rename to Minecraft.World/net/minecraft/world/entity/projectile/Fireball.h index 27e8aecdc..70d034598 100644 --- a/Minecraft.World/Entities/Mobs/Fireball.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.h @@ -1,7 +1,7 @@ #pragma once #include "../Entity.h" -#include "../../Util/ParticleTypes.h" +#include "../../../../../Header Files/ParticleTypes.h" class HitResult; diff --git a/Minecraft.World/Entities/FireworksRocketEntity.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp similarity index 96% rename from Minecraft.World/Entities/FireworksRocketEntity.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp index ee8ed0a72..f0df394b1 100644 --- a/Minecraft.World/Entities/FireworksRocketEntity.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../level/net.minecraft.world.level.h" #include "FireworksRocketEntity.h" FireworksRocketEntity::FireworksRocketEntity(Level* level) : Entity(level) { diff --git a/Minecraft.World/Entities/FireworksRocketEntity.h b/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.h similarity index 97% rename from Minecraft.World/Entities/FireworksRocketEntity.h rename to Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.h index 21dc74a17..b44dca524 100644 --- a/Minecraft.World/Entities/FireworksRocketEntity.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.h @@ -1,6 +1,6 @@ #pragma once -#include "Entity.h" +#include "../Entity.h" class FireworksRocketEntity : public Entity { public: diff --git a/Minecraft.World/Entities/Mobs/FishingHook.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp similarity index 94% rename from Minecraft.World/Entities/Mobs/FishingHook.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp index 57c01e41c..e9923c3b9 100644 --- a/Minecraft.World/Entities/Mobs/FishingHook.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.stats.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../item/net.minecraft.world.entity.item.h" +#include "../net.minecraft.world.entity.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "FishingHook.h" -#include "../../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" // 4J - added common ctor code. void FishingHook::_init() { diff --git a/Minecraft.World/Entities/Mobs/FishingHook.h b/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.h similarity index 100% rename from Minecraft.World/Entities/Mobs/FishingHook.h rename to Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.h diff --git a/Minecraft.World/Entities/LargeFireball.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/LargeFireball.cpp similarity index 87% rename from Minecraft.World/Entities/LargeFireball.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/LargeFireball.cpp index e99c7c0a1..361e22b13 100644 --- a/Minecraft.World/Entities/LargeFireball.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/LargeFireball.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" #include "LargeFireball.h" LargeFireball::LargeFireball(Level* level) : Fireball(level) { diff --git a/Minecraft.World/Entities/LargeFireball.h b/Minecraft.World/net/minecraft/world/entity/projectile/LargeFireball.h similarity index 96% rename from Minecraft.World/Entities/LargeFireball.h rename to Minecraft.World/net/minecraft/world/entity/projectile/LargeFireball.h index 6c525e8e1..54a53577c 100644 --- a/Minecraft.World/Entities/LargeFireball.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/LargeFireball.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Fireball.h" +#include "Fireball.h" class LargeFireball : public Fireball { public: diff --git a/Minecraft.World/Entities/Projectile.h b/Minecraft.World/net/minecraft/world/entity/projectile/Projectile.h similarity index 100% rename from Minecraft.World/Entities/Projectile.h rename to Minecraft.World/net/minecraft/world/entity/projectile/Projectile.h diff --git a/Minecraft.World/Entities/Mobs/SmallFireball.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/SmallFireball.cpp similarity index 86% rename from Minecraft.World/Entities/Mobs/SmallFireball.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/SmallFireball.cpp index e20063a8f..95418faa8 100644 --- a/Minecraft.World/Entities/Mobs/SmallFireball.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/SmallFireball.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../level/net.minecraft.world.level.h" #include "SmallFireball.h" SmallFireball::SmallFireball(Level* level) : Fireball(level) { diff --git a/Minecraft.World/Entities/Mobs/SmallFireball.h b/Minecraft.World/net/minecraft/world/entity/projectile/SmallFireball.h similarity index 100% rename from Minecraft.World/Entities/Mobs/SmallFireball.h rename to Minecraft.World/net/minecraft/world/entity/projectile/SmallFireball.h diff --git a/Minecraft.World/Entities/Mobs/Snowball.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/Snowball.cpp similarity index 79% rename from Minecraft.World/Entities/Mobs/Snowball.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/Snowball.cpp index 81df4ebdc..3521e0d2f 100644 --- a/Minecraft.World/Entities/Mobs/Snowball.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Snowball.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../monster/net.minecraft.world.entity.monster.h" #include "Snowball.h" void Snowball::_init() { diff --git a/Minecraft.World/Entities/Mobs/Snowball.h b/Minecraft.World/net/minecraft/world/entity/projectile/Snowball.h similarity index 94% rename from Minecraft.World/Entities/Mobs/Snowball.h rename to Minecraft.World/net/minecraft/world/entity/projectile/Snowball.h index 9300d0e59..d89f266e9 100644 --- a/Minecraft.World/Entities/Mobs/Snowball.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Snowball.h @@ -1,6 +1,6 @@ #pragma once -#include "../Throwable.h" +#include "Throwable.h" class HitResult; diff --git a/Minecraft.World/Entities/Throwable.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp similarity index 95% rename from Minecraft.World/Entities/Throwable.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp index 922104799..dd297c91f 100644 --- a/Minecraft.World/Entities/Throwable.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.entity.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "Throwable.h" void Throwable::_throwableInit() { diff --git a/Minecraft.World/Entities/Throwable.h b/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.h similarity index 98% rename from Minecraft.World/Entities/Throwable.h rename to Minecraft.World/net/minecraft/world/entity/projectile/Throwable.h index fa8c65746..893112fab 100644 --- a/Minecraft.World/Entities/Throwable.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.h @@ -1,6 +1,6 @@ #pragma once -#include "Entity.h" +#include "../Entity.h" #include "Projectile.h" class Mob; diff --git a/Minecraft.World/Entities/Mobs/ThrownEgg.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp similarity index 84% rename from Minecraft.World/Entities/Mobs/ThrownEgg.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp index a85425169..99f7596f1 100644 --- a/Minecraft.World/Entities/Mobs/ThrownEgg.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../animal/net.minecraft.world.entity.animal.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "ThrownEgg.h" #include "../MobCategory.h" diff --git a/Minecraft.World/Entities/Mobs/ThrownEgg.h b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.h similarity index 93% rename from Minecraft.World/Entities/Mobs/ThrownEgg.h rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.h index 4215eec8f..f97b1c6b0 100644 --- a/Minecraft.World/Entities/Mobs/ThrownEgg.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.h @@ -1,6 +1,6 @@ #pragma once -#include "../Throwable.h" +#include "Throwable.h" class HitResult; diff --git a/Minecraft.World/Entities/Mobs/ThrownEnderPearl.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEnderpearl.cpp similarity index 84% rename from Minecraft.World/Entities/Mobs/ThrownEnderPearl.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownEnderpearl.cpp index e7cfe2adf..a9d89c38e 100644 --- a/Minecraft.World/Entities/Mobs/ThrownEnderPearl.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEnderpearl.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.damagesource.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../../Minecraft.Client/Player/ServerPlayer.h" -#include "../../../Minecraft.Client/Network/PlayerConnection.h" -#include "ThrownEnderPearl.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../net.minecraft.world.entity.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" +#include "../../../Minecraft.Client/net/minecraft/server/network/PlayerConnection.h" +#include "ThrownEnderpearl.h" ThrownEnderpearl::ThrownEnderpearl(Level* level) : Throwable(level) { // 4J Stu - This function call had to be moved here from the Entity ctor to diff --git a/Minecraft.World/Entities/Mobs/ThrownEnderPearl.h b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEnderpearl.h similarity index 94% rename from Minecraft.World/Entities/Mobs/ThrownEnderPearl.h rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownEnderpearl.h index 29504b949..7dd19bd60 100644 --- a/Minecraft.World/Entities/Mobs/ThrownEnderPearl.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEnderpearl.h @@ -1,6 +1,6 @@ #pragma once -#include "../Throwable.h" +#include "Throwable.h" class HitResult; diff --git a/Minecraft.World/Entities/Mobs/ThrownExpBottle.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp similarity index 82% rename from Minecraft.World/Entities/Mobs/ThrownExpBottle.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp index df143c4e0..2d1d57240 100644 --- a/Minecraft.World/Entities/Mobs/ThrownExpBottle.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Util/JavaMath.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.entity.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" #include "ThrownExpBottle.h" ThrownExpBottle::ThrownExpBottle(Level* level) : Throwable(level) {} diff --git a/Minecraft.World/Entities/Mobs/ThrownExpBottle.h b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.h similarity index 95% rename from Minecraft.World/Entities/Mobs/ThrownExpBottle.h rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.h index 38740e12d..d3b83502b 100644 --- a/Minecraft.World/Entities/Mobs/ThrownExpBottle.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.h @@ -1,6 +1,6 @@ #pragma once -#include "../Throwable.h" +#include "Throwable.h" class HitResult; diff --git a/Minecraft.World/Entities/Mobs/ThrownPotion.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp similarity index 92% rename from Minecraft.World/Entities/Mobs/ThrownPotion.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp index cdf8df7d4..ad6826707 100644 --- a/Minecraft.World/Entities/Mobs/ThrownPotion.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Util/SharedConstants.h" -#include "../../Util/JavaMath.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../../SharedConstants.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" #include "ThrownPotion.h" const double ThrownPotion::SPLASH_RANGE = 4.0; diff --git a/Minecraft.World/Entities/Mobs/ThrownPotion.h b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.h similarity index 97% rename from Minecraft.World/Entities/Mobs/ThrownPotion.h rename to Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.h index 2890f1c19..e7773ddf5 100644 --- a/Minecraft.World/Entities/Mobs/ThrownPotion.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.h @@ -1,6 +1,6 @@ #pragma once -#include "../Throwable.h" +#include "Throwable.h" class HitResult; diff --git a/Minecraft.World/Entities/WitherSkull.cpp b/Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.cpp similarity index 88% rename from Minecraft.World/Entities/WitherSkull.cpp rename to Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.cpp index 2291341db..89ef57fab 100644 --- a/Minecraft.World/Entities/WitherSkull.cpp +++ b/Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../net.minecraft.world.entity.h" +#include "../../level/net.minecraft.world.level.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" #include "WitherSkull.h" WitherSkull::WitherSkull(Level* level) : Fireball(level) { diff --git a/Minecraft.World/Entities/WitherSkull.h b/Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.h similarity index 97% rename from Minecraft.World/Entities/WitherSkull.h rename to Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.h index 3ab4d7846..d8f9fca8b 100644 --- a/Minecraft.World/Entities/WitherSkull.h +++ b/Minecraft.World/net/minecraft/world/entity/projectile/WitherSkull.h @@ -1,6 +1,6 @@ #pragma once -#include "Mobs/Fireball.h" +#include "Fireball.h" class WitherSkull : public Fireball { public: diff --git a/Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h b/Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h new file mode 100644 index 000000000..aa10571e0 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h @@ -0,0 +1,24 @@ +#pragma once + +#include "Arrow.h" +#include "Fireball.h" +#include "FishingHook.h" +#include "Snowball.h" +#include "ThrownEgg.h" + +// 1.0.1 +#include "EyeOfEnderSignal.h" +#include "SmallFireball.h" +#include "Throwable.h" +#include "ThrownEnderpearl.h" +#include "ThrownPotion.h" +#include "ThrownExpBottle.h" // Brought forward from 1.2 + +// Added TU 9 +#include "DragonFireball.h" + +// 1.6.4 +#include "FireworksRocketEntity.h" +#include "LargeFireball.h" +#include "Projectile.h" +#include "WitherSkull.h" \ No newline at end of file diff --git a/Minecraft.World/Util/FoodConstants.cpp b/Minecraft.World/net/minecraft/world/food/FoodConstants.cpp similarity index 97% rename from Minecraft.World/Util/FoodConstants.cpp rename to Minecraft.World/net/minecraft/world/food/FoodConstants.cpp index 0b011df5a..8a894636c 100644 --- a/Minecraft.World/Util/FoodConstants.cpp +++ b/Minecraft.World/net/minecraft/world/food/FoodConstants.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "FoodConstants.h" diff --git a/Minecraft.World/Util/FoodConstants.h b/Minecraft.World/net/minecraft/world/food/FoodConstants.h similarity index 100% rename from Minecraft.World/Util/FoodConstants.h rename to Minecraft.World/net/minecraft/world/food/FoodConstants.h diff --git a/Minecraft.World/Player/FoodData.cpp b/Minecraft.World/net/minecraft/world/food/FoodData.cpp similarity index 91% rename from Minecraft.World/Player/FoodData.cpp rename to Minecraft.World/net/minecraft/world/food/FoodData.cpp index cdbc25d93..0138bbdd6 100644 --- a/Minecraft.World/Player/FoodData.cpp +++ b/Minecraft.World/net/minecraft/world/food/FoodData.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Util/FoodConstants.h" +#include "../../../../Header Files/stdafx.h" +#include "../item/net.minecraft.world.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../net.minecraft.world.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "FoodConstants.h" #include "FoodData.h" FoodData::FoodData() { diff --git a/Minecraft.World/Player/FoodData.h b/Minecraft.World/net/minecraft/world/food/FoodData.h similarity index 100% rename from Minecraft.World/Player/FoodData.h rename to Minecraft.World/net/minecraft/world/food/FoodData.h diff --git a/Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h b/Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h new file mode 100644 index 000000000..91b1916a8 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h @@ -0,0 +1,4 @@ +#pragma once + +#include "FoodConstants.h" +#include "FoodData.h" \ No newline at end of file diff --git a/Minecraft.World/Containers/AbstractContainerMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp similarity index 99% rename from Minecraft.World/Containers/AbstractContainerMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp index 2a8a89929..bfac470be 100644 --- a/Minecraft.World/Containers/AbstractContainerMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/redstone/net.minecraft.world.level.redstone.h" #include "Slot.h" #include "AbstractContainerMenu.h" diff --git a/Minecraft.World/Containers/AbstractContainerMenu.h b/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h similarity index 97% rename from Minecraft.World/Containers/AbstractContainerMenu.h rename to Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h index 9b24bf03b..4bfb690c5 100644 --- a/Minecraft.World/Containers/AbstractContainerMenu.h +++ b/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h @@ -1,7 +1,7 @@ #pragma once -#include "../Player/Player.h" -#include "../Headers/net.minecraft.world.inventory.ContainerListener.h" +#include "../entity/player/Player.h" +#include "net.minecraft.world.inventory.ContainerListener.h" using net_minecraft_world_inventory::ContainerListener; class Inventory; diff --git a/Minecraft.World/Containers/AnimalChest.cpp b/Minecraft.World/net/minecraft/world/inventory/AnimalChest.cpp similarity index 88% rename from Minecraft.World/Containers/AnimalChest.cpp rename to Minecraft.World/net/minecraft/world/inventory/AnimalChest.cpp index 5014152f7..483784c4c 100644 --- a/Minecraft.World/Containers/AnimalChest.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/AnimalChest.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "AnimalChest.h" diff --git a/Minecraft.World/Containers/AnimalChest.h b/Minecraft.World/net/minecraft/world/inventory/AnimalChest.h similarity index 88% rename from Minecraft.World/Containers/AnimalChest.h rename to Minecraft.World/net/minecraft/world/inventory/AnimalChest.h index 122757c6d..7d4fdbe69 100644 --- a/Minecraft.World/Containers/AnimalChest.h +++ b/Minecraft.World/net/minecraft/world/inventory/AnimalChest.h @@ -1,6 +1,6 @@ #pragma once -#include "SimpleContainer.h" +#include "../SimpleContainer.h" class AnimalChest : public SimpleContainer { public: diff --git a/Minecraft.World/Containers/AnvilMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/AnvilMenu.cpp similarity index 97% rename from Minecraft.World/Containers/AnvilMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/AnvilMenu.cpp index 03bf9509b..9f27460cb 100644 --- a/Minecraft.World/Containers/AnvilMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/AnvilMenu.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.inventory.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/enchantment/net.minecraft.world.item.enchantment.h" #include "AnvilMenu.h" AnvilMenu::AnvilMenu(std::shared_ptr inventory, Level* level, int xt, diff --git a/Minecraft.World/Containers/AnvilMenu.h b/Minecraft.World/net/minecraft/world/inventory/AnvilMenu.h similarity index 100% rename from Minecraft.World/Containers/AnvilMenu.h rename to Minecraft.World/net/minecraft/world/inventory/AnvilMenu.h diff --git a/Minecraft.World/Containers/ArmorSlot.cpp b/Minecraft.World/net/minecraft/world/inventory/ArmorSlot.cpp similarity index 85% rename from Minecraft.World/Containers/ArmorSlot.cpp rename to Minecraft.World/net/minecraft/world/inventory/ArmorSlot.cpp index d2d182c4f..722905f37 100644 --- a/Minecraft.World/Containers/ArmorSlot.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/ArmorSlot.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.inventory.h" +#include "../item/crafting/net.minecraft.world.item.crafting.h" #include "ArmorSlot.h" ArmorSlot::ArmorSlot(int slotNum, std::shared_ptr container, int id, diff --git a/Minecraft.World/Containers/ArmorSlot.h b/Minecraft.World/net/minecraft/world/inventory/ArmorSlot.h similarity index 100% rename from Minecraft.World/Containers/ArmorSlot.h rename to Minecraft.World/net/minecraft/world/inventory/ArmorSlot.h diff --git a/Minecraft.World/Containers/BeaconMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/BeaconMenu.cpp similarity index 95% rename from Minecraft.World/Containers/BeaconMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/BeaconMenu.cpp index b27776e83..805d77393 100644 --- a/Minecraft.World/Containers/BeaconMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/BeaconMenu.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "BeaconMenu.h" BeaconMenu::BeaconMenu(std::shared_ptr inventory, diff --git a/Minecraft.World/Containers/BeaconMenu.h b/Minecraft.World/net/minecraft/world/inventory/BeaconMenu.h similarity index 100% rename from Minecraft.World/Containers/BeaconMenu.h rename to Minecraft.World/net/minecraft/world/inventory/BeaconMenu.h diff --git a/Minecraft.World/Containers/BrewingStandMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.cpp similarity index 96% rename from Minecraft.World/Containers/BrewingStandMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.cpp index 78e152661..6b2707111 100644 --- a/Minecraft.World/Containers/BrewingStandMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.alchemy.h" -#include "../Headers/net.minecraft.stats.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/alchemy/net.minecraft.world.item.alchemy.h" +#include "../../stats/net.minecraft.stats.h" #include "BrewingStandMenu.h" BrewingStandMenu::BrewingStandMenu( diff --git a/Minecraft.World/Containers/BrewingStandMenu.h b/Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.h similarity index 100% rename from Minecraft.World/Containers/BrewingStandMenu.h rename to Minecraft.World/net/minecraft/world/inventory/BrewingStandMenu.h diff --git a/Minecraft.World/Containers/ContainerMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/ContainerMenu.cpp similarity index 90% rename from Minecraft.World/Containers/ContainerMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/ContainerMenu.cpp index 6a5b71bdd..9e3a6aced 100644 --- a/Minecraft.World/Containers/ContainerMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/ContainerMenu.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "Container.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../Container.h" +#include "../item/net.minecraft.world.item.h" #include "Slot.h" -#include "../Stats/GenericStats.h" -#include "../../Minecraft.Client/GameState/StatsCounter.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" +#include "../../stats/GenericStats.h" +#include "../../Minecraft.Client/net/minecraft/stats/StatsCounter.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../Minecraft.Client/net/minecraft/client/player/LocalPlayer.h" #include "ContainerMenu.h" ContainerMenu::ContainerMenu(std::shared_ptr inventory, diff --git a/Minecraft.World/Containers/ContainerMenu.h b/Minecraft.World/net/minecraft/world/inventory/ContainerMenu.h similarity index 100% rename from Minecraft.World/Containers/ContainerMenu.h rename to Minecraft.World/net/minecraft/world/inventory/ContainerMenu.h diff --git a/Minecraft.World/Containers/CraftingContainer.cpp b/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp similarity index 94% rename from Minecraft.World/Containers/CraftingContainer.cpp rename to Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp index 8b0ef17ec..8420a20ac 100644 --- a/Minecraft.World/Containers/CraftingContainer.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.item.h" #include "AbstractContainerMenu.h" #include "CraftingContainer.h" diff --git a/Minecraft.World/Containers/CraftingContainer.h b/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h similarity index 97% rename from Minecraft.World/Containers/CraftingContainer.h rename to Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h index 71e7eb524..cf5f04238 100644 --- a/Minecraft.World/Containers/CraftingContainer.h +++ b/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h @@ -1,6 +1,6 @@ #pragma once -#include "Container.h" +#include "../Container.h" class AbstractContainerMenu; diff --git a/Minecraft.World/Containers/CraftingMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/CraftingMenu.cpp similarity index 93% rename from Minecraft.World/Containers/CraftingMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/CraftingMenu.cpp index e433bcaa3..38fd6772b 100644 --- a/Minecraft.World/Containers/CraftingMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/CraftingMenu.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/crafting/net.minecraft.world.item.crafting.h" #include "CraftingContainer.h" #include "ResultContainer.h" #include "ResultSlot.h" diff --git a/Minecraft.World/Containers/CraftingMenu.h b/Minecraft.World/net/minecraft/world/inventory/CraftingMenu.h similarity index 100% rename from Minecraft.World/Containers/CraftingMenu.h rename to Minecraft.World/net/minecraft/world/inventory/CraftingMenu.h diff --git a/Minecraft.World/Containers/EnchantmentContainer.cpp b/Minecraft.World/net/minecraft/world/inventory/EnchantmentContainer.cpp similarity index 85% rename from Minecraft.World/Containers/EnchantmentContainer.cpp rename to Minecraft.World/net/minecraft/world/inventory/EnchantmentContainer.cpp index 1cf3e214f..385680ae5 100644 --- a/Minecraft.World/Containers/EnchantmentContainer.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/EnchantmentContainer.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.inventory.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.inventory.h" #include "EnchantmentContainer.h" EnchantmentContainer::EnchantmentContainer(EnchantmentMenu* menu) diff --git a/Minecraft.World/Containers/EnchantmentContainer.h b/Minecraft.World/net/minecraft/world/inventory/EnchantmentContainer.h similarity index 93% rename from Minecraft.World/Containers/EnchantmentContainer.h rename to Minecraft.World/net/minecraft/world/inventory/EnchantmentContainer.h index a8717f0fd..2c58bdd7f 100644 --- a/Minecraft.World/Containers/EnchantmentContainer.h +++ b/Minecraft.World/net/minecraft/world/inventory/EnchantmentContainer.h @@ -3,7 +3,7 @@ // In EnchantmentMenu.java they create an anoymous class while creating the // container. I have moved the content of that anonymous class to here -#include "SimpleContainer.h" +#include "../SimpleContainer.h" class EnchantmentMenu; diff --git a/Minecraft.World/Containers/EnchantmentMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.cpp similarity index 95% rename from Minecraft.World/Containers/EnchantmentMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.cpp index c60469ea2..ff4b8946a 100644 --- a/Minecraft.World/Containers/EnchantmentMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.inventory.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/enchantment/net.minecraft.world.item.enchantment.h" #include "EnchantmentMenu.h" EnchantmentMenu::EnchantmentMenu(std::shared_ptr inventory, diff --git a/Minecraft.World/Containers/EnchantmentMenu.h b/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h similarity index 96% rename from Minecraft.World/Containers/EnchantmentMenu.h rename to Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h index 0d189607a..6f95b6467 100644 --- a/Minecraft.World/Containers/EnchantmentMenu.h +++ b/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h @@ -1,6 +1,6 @@ #pragma once #include "AbstractContainerMenu.h" -#include "../Util/Random.h" +#include "../../../../ConsoleJavaLibs/Random.h" class EnchantmentMenu : public AbstractContainerMenu { // 4J Stu Made these public for UI menus, perhaps should make friend class? diff --git a/Minecraft.World/Containers/EnchantmentSlot.h b/Minecraft.World/net/minecraft/world/inventory/EnchantmentSlot.h similarity index 100% rename from Minecraft.World/Containers/EnchantmentSlot.h rename to Minecraft.World/net/minecraft/world/inventory/EnchantmentSlot.h diff --git a/Minecraft.World/Containers/FireworksMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/FireworksMenu.cpp similarity index 93% rename from Minecraft.World/Containers/FireworksMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/FireworksMenu.cpp index 3a47b2c8a..c6d0d267b 100644 --- a/Minecraft.World/Containers/FireworksMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/FireworksMenu.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/crafting/net.minecraft.world.item.crafting.h" #include "CraftingContainer.h" #include "ResultContainer.h" #include "ResultSlot.h" diff --git a/Minecraft.World/Containers/FireworksMenu.h b/Minecraft.World/net/minecraft/world/inventory/FireworksMenu.h similarity index 100% rename from Minecraft.World/Containers/FireworksMenu.h rename to Minecraft.World/net/minecraft/world/inventory/FireworksMenu.h diff --git a/Minecraft.World/Containers/FurnaceMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/FurnaceMenu.cpp similarity index 94% rename from Minecraft.World/Containers/FurnaceMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/FurnaceMenu.cpp index f6077079f..69fe5d1ad 100644 --- a/Minecraft.World/Containers/FurnaceMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/FurnaceMenu.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "FurnaceResultSlot.h" #include "Slot.h" -#include "../Stats/GenericStats.h" +#include "../../stats/GenericStats.h" #include "FurnaceMenu.h" -#include "../Recipes/FurnaceRecipes.h" +#include "../item/crafting/FurnaceRecipes.h" FurnaceMenu::FurnaceMenu(std::shared_ptr inventory, std::shared_ptr furnace) diff --git a/Minecraft.World/Containers/FurnaceMenu.h b/Minecraft.World/net/minecraft/world/inventory/FurnaceMenu.h similarity index 100% rename from Minecraft.World/Containers/FurnaceMenu.h rename to Minecraft.World/net/minecraft/world/inventory/FurnaceMenu.h diff --git a/Minecraft.World/Containers/FurnaceResultSlot.cpp b/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp similarity index 85% rename from Minecraft.World/Containers/FurnaceResultSlot.cpp rename to Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp index f53bb2fd3..359fbfdd7 100644 --- a/Minecraft.World/Containers/FurnaceResultSlot.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.item.crafting.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Util/JavaMath.h" +#include "../../../../Header Files/stdafx.h" +#include "../../stats/net.minecraft.stats.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../item/crafting/net.minecraft.world.item.crafting.h" +#include "../level/net.minecraft.world.level.h" +#include "../item/net.minecraft.world.item.h" +#include "../../../../ConsoleJavaLibs/JavaMath.h" #include "FurnaceResultSlot.h" FurnaceResultSlot::FurnaceResultSlot(std::shared_ptr player, diff --git a/Minecraft.World/Containers/FurnaceResultSlot.h b/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.h similarity index 100% rename from Minecraft.World/Containers/FurnaceResultSlot.h rename to Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.h diff --git a/Minecraft.World/Containers/HopperMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/HopperMenu.cpp similarity index 95% rename from Minecraft.World/Containers/HopperMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/HopperMenu.cpp index 6f7d24f5a..e0ba80eca 100644 --- a/Minecraft.World/Containers/HopperMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/HopperMenu.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.inventory.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.inventory.h" #include "HopperMenu.h" HopperMenu::HopperMenu(std::shared_ptr inventory, diff --git a/Minecraft.World/Containers/HopperMenu.h b/Minecraft.World/net/minecraft/world/inventory/HopperMenu.h similarity index 100% rename from Minecraft.World/Containers/HopperMenu.h rename to Minecraft.World/net/minecraft/world/inventory/HopperMenu.h diff --git a/Minecraft.World/Containers/HorseInventoryMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/HorseInventoryMenu.cpp similarity index 96% rename from Minecraft.World/Containers/HorseInventoryMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/HorseInventoryMenu.cpp index 084b11807..2beea1759 100644 --- a/Minecraft.World/Containers/HorseInventoryMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/HorseInventoryMenu.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../Header Files/stdafx.h" +#include "../item/net.minecraft.world.item.h" +#include "../entity/animal/net.minecraft.world.entity.animal.h" #include "HorseInventoryMenu.h" HorseSaddleSlot::HorseSaddleSlot(std::shared_ptr horseInventory) diff --git a/Minecraft.World/Containers/HorseInventoryMenu.h b/Minecraft.World/net/minecraft/world/inventory/HorseInventoryMenu.h similarity index 100% rename from Minecraft.World/Containers/HorseInventoryMenu.h rename to Minecraft.World/net/minecraft/world/inventory/HorseInventoryMenu.h diff --git a/Minecraft.World/Containers/InventoryMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp similarity index 97% rename from Minecraft.World/Containers/InventoryMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp index 07b9e29cf..b2542d2ac 100644 --- a/Minecraft.World/Containers/InventoryMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.crafting.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/crafting/net.minecraft.world.item.crafting.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "ResultSlot.h" #include "ArmorSlot.h" #include "CraftingContainer.h" #include "ResultContainer.h" #include "InventoryMenu.h" -#include "../Blocks/Tile.h" -#include "../Stats/GenericStats.h" +#include "../level/tile/Tile.h" +#include "../../stats/GenericStats.h" const int InventoryMenu::RESULT_SLOT = 0; const int InventoryMenu::CRAFT_SLOT_START = 1; diff --git a/Minecraft.World/Containers/InventoryMenu.h b/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.h similarity index 100% rename from Minecraft.World/Containers/InventoryMenu.h rename to Minecraft.World/net/minecraft/world/inventory/InventoryMenu.h diff --git a/Minecraft.World/Containers/MenuBackup.cpp b/Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp similarity index 89% rename from Minecraft.World/Containers/MenuBackup.cpp rename to Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp index 4e4c98d31..da4739832 100644 --- a/Minecraft.World/Containers/MenuBackup.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../item/net.minecraft.world.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "AbstractContainerMenu.h" #include "Slot.h" #include "MenuBackup.h" diff --git a/Minecraft.World/Containers/MenuBackup.h b/Minecraft.World/net/minecraft/world/inventory/MenuBackup.h similarity index 100% rename from Minecraft.World/Containers/MenuBackup.h rename to Minecraft.World/net/minecraft/world/inventory/MenuBackup.h diff --git a/Minecraft.World/Containers/MerchantContainer.cpp b/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp similarity index 97% rename from Minecraft.World/Containers/MerchantContainer.cpp rename to Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp index 09636249d..813ef8309 100644 --- a/Minecraft.World/Containers/MerchantContainer.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.trading.h" +#include "../../../../Header Files/stdafx.h" +#include "../item/trading/net.minecraft.world.item.trading.h" #include "MerchantMenu.h" #include "MerchantContainer.h" diff --git a/Minecraft.World/Containers/MerchantContainer.h b/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h similarity index 93% rename from Minecraft.World/Containers/MerchantContainer.h rename to Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h index 76c676a9c..48088e32c 100644 --- a/Minecraft.World/Containers/MerchantContainer.h +++ b/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h @@ -1,7 +1,7 @@ #pragma once -#include "Container.h" -#include "../Util/ArrayWithLength.h" +#include "../Container.h" +#include "../../../../ConsoleHelpers/ArrayWithLength.h" class Merchant; class Player; diff --git a/Minecraft.World/Containers/MerchantMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/MerchantMenu.cpp similarity index 93% rename from Minecraft.World/Containers/MerchantMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/MerchantMenu.cpp index 807b26a7a..1e0a3ce3f 100644 --- a/Minecraft.World/Containers/MerchantMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/MerchantMenu.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.item.trading.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.inventory.h" +#include "../item/trading/net.minecraft.world.item.trading.h" +#include "../level/net.minecraft.world.level.h" #include "MerchantMenu.h" MerchantMenu::MerchantMenu(std::shared_ptr inventory, diff --git a/Minecraft.World/Containers/MerchantMenu.h b/Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h similarity index 100% rename from Minecraft.World/Containers/MerchantMenu.h rename to Minecraft.World/net/minecraft/world/inventory/MerchantMenu.h diff --git a/Minecraft.World/Containers/MerchantResultSlot.cpp b/Minecraft.World/net/minecraft/world/inventory/MerchantResultSlot.cpp similarity index 95% rename from Minecraft.World/Containers/MerchantResultSlot.cpp rename to Minecraft.World/net/minecraft/world/inventory/MerchantResultSlot.cpp index 289f90788..6e9b44332 100644 --- a/Minecraft.World/Containers/MerchantResultSlot.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/MerchantResultSlot.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.item.trading.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.inventory.h" +#include "../item/trading/net.minecraft.world.item.trading.h" #include "MerchantResultSlot.h" MerchantResultSlot::MerchantResultSlot(Player* player, diff --git a/Minecraft.World/Containers/MerchantResultSlot.h b/Minecraft.World/net/minecraft/world/inventory/MerchantResultSlot.h similarity index 100% rename from Minecraft.World/Containers/MerchantResultSlot.h rename to Minecraft.World/net/minecraft/world/inventory/MerchantResultSlot.h diff --git a/Minecraft.World/Player/PlayerEnderChestContainer.cpp b/Minecraft.World/net/minecraft/world/inventory/PlayerEnderChestContainer.cpp similarity index 92% rename from Minecraft.World/Player/PlayerEnderChestContainer.cpp rename to Minecraft.World/net/minecraft/world/inventory/PlayerEnderChestContainer.cpp index eaae3ba2c..7e1bcaa28 100644 --- a/Minecraft.World/Player/PlayerEnderChestContainer.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/PlayerEnderChestContainer.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Network/Packets/ContainerOpenPacket.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../network/packet/ContainerOpenPacket.h" #include "PlayerEnderChestContainer.h" PlayerEnderChestContainer::PlayerEnderChestContainer() diff --git a/Minecraft.World/Player/PlayerEnderChestContainer.h b/Minecraft.World/net/minecraft/world/inventory/PlayerEnderChestContainer.h similarity index 93% rename from Minecraft.World/Player/PlayerEnderChestContainer.h rename to Minecraft.World/net/minecraft/world/inventory/PlayerEnderChestContainer.h index a3ff584c4..3331421dd 100644 --- a/Minecraft.World/Player/PlayerEnderChestContainer.h +++ b/Minecraft.World/net/minecraft/world/inventory/PlayerEnderChestContainer.h @@ -1,6 +1,6 @@ #pragma once -#include "../Containers/SimpleContainer.h" +#include "../SimpleContainer.h" class EnderChestTileEntity; diff --git a/Minecraft.World/Containers/RepairContainer.cpp b/Minecraft.World/net/minecraft/world/inventory/RepairContainer.cpp similarity index 91% rename from Minecraft.World/Containers/RepairContainer.cpp rename to Minecraft.World/net/minecraft/world/inventory/RepairContainer.cpp index 53dfa21c5..29a180d70 100644 --- a/Minecraft.World/Containers/RepairContainer.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/RepairContainer.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "AnvilMenu.h" #include "RepairContainer.h" diff --git a/Minecraft.World/Containers/RepairContainer.h b/Minecraft.World/net/minecraft/world/inventory/RepairContainer.h similarity index 92% rename from Minecraft.World/Containers/RepairContainer.h rename to Minecraft.World/net/minecraft/world/inventory/RepairContainer.h index 1494a1099..66945e73a 100644 --- a/Minecraft.World/Containers/RepairContainer.h +++ b/Minecraft.World/net/minecraft/world/inventory/RepairContainer.h @@ -1,6 +1,6 @@ #pragma once -#include "SimpleContainer.h" +#include "../SimpleContainer.h" class AnvilMenu; diff --git a/Minecraft.World/Containers/RepairResultSlot.cpp b/Minecraft.World/net/minecraft/world/inventory/RepairResultSlot.cpp similarity index 90% rename from Minecraft.World/Containers/RepairResultSlot.cpp rename to Minecraft.World/net/minecraft/world/inventory/RepairResultSlot.cpp index 75a1318df..f628fe64d 100644 --- a/Minecraft.World/Containers/RepairResultSlot.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/RepairResultSlot.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.inventory.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "RepairResultSlot.h" RepairResultSlot::RepairResultSlot(AnvilMenu* menu, int xt, int yt, int zt, diff --git a/Minecraft.World/Containers/RepairResultSlot.h b/Minecraft.World/net/minecraft/world/inventory/RepairResultSlot.h similarity index 100% rename from Minecraft.World/Containers/RepairResultSlot.h rename to Minecraft.World/net/minecraft/world/inventory/RepairResultSlot.h diff --git a/Minecraft.World/Containers/ResultContainer.cpp b/Minecraft.World/net/minecraft/world/inventory/ResultContainer.cpp similarity index 93% rename from Minecraft.World/Containers/ResultContainer.cpp rename to Minecraft.World/net/minecraft/world/inventory/ResultContainer.cpp index c95258bd2..c5aad0465 100644 --- a/Minecraft.World/Containers/ResultContainer.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/ResultContainer.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "ResultContainer.h" ResultContainer::ResultContainer() : Container() {} diff --git a/Minecraft.World/Containers/ResultContainer.h b/Minecraft.World/net/minecraft/world/inventory/ResultContainer.h similarity index 97% rename from Minecraft.World/Containers/ResultContainer.h rename to Minecraft.World/net/minecraft/world/inventory/ResultContainer.h index dc4ff7a9e..1124c0d3a 100644 --- a/Minecraft.World/Containers/ResultContainer.h +++ b/Minecraft.World/net/minecraft/world/inventory/ResultContainer.h @@ -1,6 +1,6 @@ #pragma once -#include "Container.h" +#include "../Container.h" class ResultContainer : public Container { private: diff --git a/Minecraft.World/Containers/ResultSlot.cpp b/Minecraft.World/net/minecraft/world/inventory/ResultSlot.cpp similarity index 93% rename from Minecraft.World/Containers/ResultSlot.cpp rename to Minecraft.World/net/minecraft/world/inventory/ResultSlot.cpp index 21ba38854..7f46be655 100644 --- a/Minecraft.World/Containers/ResultSlot.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/ResultSlot.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "Container.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../Container.h" +#include "../../stats/net.minecraft.stats.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../item/net.minecraft.world.item.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ResultSlot.h" ResultSlot::ResultSlot(Player* player, std::shared_ptr craftSlots, diff --git a/Minecraft.World/Containers/ResultSlot.h b/Minecraft.World/net/minecraft/world/inventory/ResultSlot.h similarity index 100% rename from Minecraft.World/Containers/ResultSlot.h rename to Minecraft.World/net/minecraft/world/inventory/ResultSlot.h diff --git a/Minecraft.World/Containers/Slot.cpp b/Minecraft.World/net/minecraft/world/inventory/Slot.cpp similarity index 95% rename from Minecraft.World/Containers/Slot.cpp rename to Minecraft.World/net/minecraft/world/inventory/Slot.cpp index 45bdea020..438f596db 100644 --- a/Minecraft.World/Containers/Slot.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/Slot.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" -#include "Container.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../Container.h" +#include "../item/net.minecraft.world.item.h" +#include "../item/crafting/net.minecraft.world.item.crafting.h" #include "Slot.h" Slot::Slot(std::shared_ptr container, int slot, int x, int y) diff --git a/Minecraft.World/Containers/Slot.h b/Minecraft.World/net/minecraft/world/inventory/Slot.h similarity index 100% rename from Minecraft.World/Containers/Slot.h rename to Minecraft.World/net/minecraft/world/inventory/Slot.h diff --git a/Minecraft.World/Containers/TrapMenu.cpp b/Minecraft.World/net/minecraft/world/inventory/TrapMenu.cpp similarity index 89% rename from Minecraft.World/Containers/TrapMenu.cpp rename to Minecraft.World/net/minecraft/world/inventory/TrapMenu.cpp index 206ca0048..1b7f8cd75 100644 --- a/Minecraft.World/Containers/TrapMenu.cpp +++ b/Minecraft.World/net/minecraft/world/inventory/TrapMenu.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "Container.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../Container.h" #include "Slot.h" #include "TrapMenu.h" diff --git a/Minecraft.World/Containers/TrapMenu.h b/Minecraft.World/net/minecraft/world/inventory/TrapMenu.h similarity index 100% rename from Minecraft.World/Containers/TrapMenu.h rename to Minecraft.World/net/minecraft/world/inventory/TrapMenu.h diff --git a/Minecraft.World/Headers/net.minecraft.world.inventory.ContainerListener.h b/Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.ContainerListener.h similarity index 100% rename from Minecraft.World/Headers/net.minecraft.world.inventory.ContainerListener.h rename to Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.ContainerListener.h diff --git a/Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h b/Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h new file mode 100644 index 000000000..82a8a52d0 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h @@ -0,0 +1,32 @@ +#pragma once + +#include "AbstractContainerMenu.h" +#include "AnimalChest.h" +#include "ArmorSlot.h" +#include "BeaconMenu.h" +#include "net.minecraft.world.inventory.ContainerListener.h" +#include "ContainerMenu.h" +#include "CraftingContainer.h" +#include "CraftingMenu.h" +#include "FireworksMenu.h" +#include "FurnaceMenu.h" +#include "FurnaceResultSlot.h" +#include "HopperMenu.h" +#include "HorseInventoryMenu.h" +#include "InventoryMenu.h" +#include "MenuBackup.h" +#include "ResultContainer.h" +#include "ResultSlot.h" +#include "Slot.h" +#include "TrapMenu.h" +#include "EnchantmentMenu.h" +#include "EnchantmentSlot.h" +#include "EnchantmentContainer.h" +#include "BrewingStandMenu.h" +#include "MerchantContainer.h" +#include "MerchantMenu.h" +#include "MerchantResultSlot.h" +#include "PlayerEnderChestContainer.h" +#include "AnvilMenu.h" +#include "RepairContainer.h" +#include "RepairResultSlot.h" \ No newline at end of file diff --git a/Minecraft.World/Items/TileItems/AnvilTileItem.cpp b/Minecraft.World/net/minecraft/world/item/AnvilTileItem.cpp similarity index 80% rename from Minecraft.World/Items/TileItems/AnvilTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/AnvilTileItem.cpp index 44381fb3c..adc75435a 100644 --- a/Minecraft.World/Items/TileItems/AnvilTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/AnvilTileItem.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "AnvilTileItem.h" AnvilTileItem::AnvilTileItem(Tile* tile) diff --git a/Minecraft.World/Items/TileItems/AnvilTileItem.h b/Minecraft.World/net/minecraft/world/item/AnvilTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/AnvilTileItem.h rename to Minecraft.World/net/minecraft/world/item/AnvilTileItem.h diff --git a/Minecraft.World/Items/ArmorItem.cpp b/Minecraft.World/net/minecraft/world/item/ArmorItem.cpp similarity index 94% rename from Minecraft.World/Items/ArmorItem.cpp rename to Minecraft.World/net/minecraft/world/item/ArmorItem.cpp index e171e062d..c35452d2d 100644 --- a/Minecraft.World/Items/ArmorItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ArmorItem.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../net.minecraft.world.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/net.minecraft.world.level.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" #include "ArmorItem.h" const int ArmorItem::healthPerSlot[] = {11, 16, 15, 13}; diff --git a/Minecraft.World/Items/ArmorItem.h b/Minecraft.World/net/minecraft/world/item/ArmorItem.h similarity index 98% rename from Minecraft.World/Items/ArmorItem.h rename to Minecraft.World/net/minecraft/world/item/ArmorItem.h index f63da30c5..6bba66850 100644 --- a/Minecraft.World/Items/ArmorItem.h +++ b/Minecraft.World/net/minecraft/world/item/ArmorItem.h @@ -1,7 +1,7 @@ #pragma once #include "Item.h" -#include "../Core/DefaultDispenseItemBehavior.h" +#include "../../core/DefaultDispenseItemBehavior.h" class ArmorItem : public Item { public: diff --git a/Minecraft.World/Items/TileItems/AuxDataTileItem.cpp b/Minecraft.World/net/minecraft/world/item/AuxDataTileItem.cpp similarity index 78% rename from Minecraft.World/Items/TileItems/AuxDataTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/AuxDataTileItem.cpp index 3522706f4..48209e31a 100644 --- a/Minecraft.World/Items/TileItems/AuxDataTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/AuxDataTileItem.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "AuxDataTileItem.h" AuxDataTileItem::AuxDataTileItem(int id, Tile* parentTile) : TileItem(id) { diff --git a/Minecraft.World/Items/TileItems/AuxDataTileItem.h b/Minecraft.World/net/minecraft/world/item/AuxDataTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/AuxDataTileItem.h rename to Minecraft.World/net/minecraft/world/item/AuxDataTileItem.h diff --git a/Minecraft.World/Items/BedItem.cpp b/Minecraft.World/net/minecraft/world/item/BedItem.cpp similarity index 85% rename from Minecraft.World/Items/BedItem.cpp rename to Minecraft.World/net/minecraft/world/item/BedItem.cpp index cac4f35dd..ed1e1f94c 100644 --- a/Minecraft.World/Items/BedItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BedItem.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Util/Facing.h" -#include "../Stats/GenericStats.h" +#include "../../../../Header Files/stdafx.h" +#include "../../net.minecraft.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" +#include "../../Facing.h" +#include "../../stats/GenericStats.h" #include "BedItem.h" BedItem::BedItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/BedItem.h b/Minecraft.World/net/minecraft/world/item/BedItem.h similarity index 100% rename from Minecraft.World/Items/BedItem.h rename to Minecraft.World/net/minecraft/world/item/BedItem.h diff --git a/Minecraft.World/Items/BoatItem.cpp b/Minecraft.World/net/minecraft/world/item/BoatItem.cpp similarity index 92% rename from Minecraft.World/Items/BoatItem.cpp rename to Minecraft.World/net/minecraft/world/item/BoatItem.cpp index 883bda4b9..deefca47f 100644 --- a/Minecraft.World/Items/BoatItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BoatItem.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" #include "ItemInstance.h" -#include "Util/Vec3.h" +#include "../phys/Vec3.h" #include "BoatItem.h" BoatItem::BoatItem(int id) : Item(id) { maxStackSize = 1; } diff --git a/Minecraft.World/Items/BoatItem.h b/Minecraft.World/net/minecraft/world/item/BoatItem.h similarity index 100% rename from Minecraft.World/Items/BoatItem.h rename to Minecraft.World/net/minecraft/world/item/BoatItem.h diff --git a/Minecraft.World/Items/BookItem.cpp b/Minecraft.World/net/minecraft/world/item/BookItem.cpp similarity index 83% rename from Minecraft.World/Items/BookItem.cpp rename to Minecraft.World/net/minecraft/world/item/BookItem.cpp index 6ea875f3c..23bebfa10 100644 --- a/Minecraft.World/Items/BookItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BookItem.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "BookItem.h" diff --git a/Minecraft.World/Items/BookItem.h b/Minecraft.World/net/minecraft/world/item/BookItem.h similarity index 100% rename from Minecraft.World/Items/BookItem.h rename to Minecraft.World/net/minecraft/world/item/BookItem.h diff --git a/Minecraft.World/Items/BottleItem.cpp b/Minecraft.World/net/minecraft/world/item/BottleItem.cpp similarity index 88% rename from Minecraft.World/Items/BottleItem.cpp rename to Minecraft.World/net/minecraft/world/item/BottleItem.cpp index 8a6b26160..434a9dadd 100644 --- a/Minecraft.World/Items/BottleItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BottleItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "net.minecraft.world.item.h" #include "BottleItem.h" BottleItem::BottleItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/BottleItem.h b/Minecraft.World/net/minecraft/world/item/BottleItem.h similarity index 100% rename from Minecraft.World/Items/BottleItem.h rename to Minecraft.World/net/minecraft/world/item/BottleItem.h diff --git a/Minecraft.World/Items/BowItem.cpp b/Minecraft.World/net/minecraft/world/item/BowItem.cpp similarity index 88% rename from Minecraft.World/Items/BowItem.cpp rename to Minecraft.World/net/minecraft/world/item/BowItem.cpp index dae94bb4f..3e89d1c57 100644 --- a/Minecraft.World/Items/BowItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BowItem.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "enchantment/net.minecraft.world.item.enchantment.h" +#include "../net.minecraft.world.h" #include "BowItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" const std::wstring BowItem::TEXTURE_PULL[] = {L"bow_pull_0", L"bow_pull_1", L"bow_pull_2"}; diff --git a/Minecraft.World/Items/BowItem.h b/Minecraft.World/net/minecraft/world/item/BowItem.h similarity index 100% rename from Minecraft.World/Items/BowItem.h rename to Minecraft.World/net/minecraft/world/item/BowItem.h diff --git a/Minecraft.World/Items/BowlFoodItem.cpp b/Minecraft.World/net/minecraft/world/item/BowlFoodItem.cpp similarity index 80% rename from Minecraft.World/Items/BowlFoodItem.cpp rename to Minecraft.World/net/minecraft/world/item/BowlFoodItem.cpp index f0e70e584..5405f226d 100644 --- a/Minecraft.World/Items/BowlFoodItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BowlFoodItem.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "ItemInstance.h" #include "BowlFoodItem.h" diff --git a/Minecraft.World/Items/BowlFoodItem.h b/Minecraft.World/net/minecraft/world/item/BowlFoodItem.h similarity index 100% rename from Minecraft.World/Items/BowlFoodItem.h rename to Minecraft.World/net/minecraft/world/item/BowlFoodItem.h diff --git a/Minecraft.World/Items/BucketItem.cpp b/Minecraft.World/net/minecraft/world/item/BucketItem.cpp similarity index 88% rename from Minecraft.World/Items/BucketItem.cpp rename to Minecraft.World/net/minecraft/world/item/BucketItem.cpp index 405989b78..736d5bc01 100644 --- a/Minecraft.World/Items/BucketItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/BucketItem.cpp @@ -1,22 +1,22 @@ -#include "../Platform/stdafx.h" -#include "../Util/JavaMath.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Blocks/Material.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/dimension/net.minecraft.world.level.dimension.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../entity/animal/net.minecraft.world.entity.animal.h" +#include "../../stats/net.minecraft.stats.h" +#include "../level/material/Material.h" #include "ItemInstance.h" #include "BucketItem.h" -#include "../../Minecraft.Client/Player/LocalPlayer.h" -#include "../../Minecraft.Client/Player/ServerPlayer.h" -#include "../../Minecraft.Client/Network/PlayerConnection.h" -#include "../Network/Packets/ChatPacket.h" -#include "../Util/SoundTypes.h" +#include "../../Minecraft.Client/net/minecraft/client/player/LocalPlayer.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" +#include "../../Minecraft.Client/net/minecraft/server/network/PlayerConnection.h" +#include "../../network/packet/ChatPacket.h" +#include "../../../../Header Files/SoundTypes.h" BucketItem::BucketItem(int id, int content) : Item(id) { maxStackSize = 1; diff --git a/Minecraft.World/Items/BucketItem.h b/Minecraft.World/net/minecraft/world/item/BucketItem.h similarity index 100% rename from Minecraft.World/Items/BucketItem.h rename to Minecraft.World/net/minecraft/world/item/BucketItem.h diff --git a/Minecraft.World/Items/CarrotOnAStickItem.cpp b/Minecraft.World/net/minecraft/world/item/CarrotOnAStickItem.cpp similarity index 81% rename from Minecraft.World/Items/CarrotOnAStickItem.cpp rename to Minecraft.World/net/minecraft/world/item/CarrotOnAStickItem.cpp index 96b6a9b20..40452c7c1 100644 --- a/Minecraft.World/Items/CarrotOnAStickItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/CarrotOnAStickItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.ai.goal.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/animal/net.minecraft.world.entity.animal.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/ai/goal/net.minecraft.world.entity.ai.goal.h" +#include "net.minecraft.world.item.h" #include "CarrotOnAStickItem.h" CarrotOnAStickItem::CarrotOnAStickItem(int id) : Item(id) { diff --git a/Minecraft.World/Items/CarrotOnAStickItem.h b/Minecraft.World/net/minecraft/world/item/CarrotOnAStickItem.h similarity index 100% rename from Minecraft.World/Items/CarrotOnAStickItem.h rename to Minecraft.World/net/minecraft/world/item/CarrotOnAStickItem.h diff --git a/Minecraft.World/Items/ClockItem.cpp b/Minecraft.World/net/minecraft/world/item/ClockItem.cpp similarity index 78% rename from Minecraft.World/Items/ClockItem.cpp rename to Minecraft.World/net/minecraft/world/item/ClockItem.cpp index c8e04d544..3662a3d43 100644 --- a/Minecraft.World/Items/ClockItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ClockItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "ClockItem.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../Headers/net.minecraft.world.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../net.minecraft.world.h" const std::wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = { L"clockP0", L"clockP1", L"clockP2", L"clockP3"}; diff --git a/Minecraft.World/Items/ClockItem.h b/Minecraft.World/net/minecraft/world/item/ClockItem.h similarity index 100% rename from Minecraft.World/Items/ClockItem.h rename to Minecraft.World/net/minecraft/world/item/ClockItem.h diff --git a/Minecraft.World/Items/CoalItem.cpp b/Minecraft.World/net/minecraft/world/item/CoalItem.cpp similarity index 72% rename from Minecraft.World/Items/CoalItem.cpp rename to Minecraft.World/net/minecraft/world/item/CoalItem.cpp index 348a24e6e..379cee754 100644 --- a/Minecraft.World/Items/CoalItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/CoalItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.h" #include "CoalItem.h" CoalItem::CoalItem(int id) : Item(id) { diff --git a/Minecraft.World/Items/CoalItem.h b/Minecraft.World/net/minecraft/world/item/CoalItem.h similarity index 100% rename from Minecraft.World/Items/CoalItem.h rename to Minecraft.World/net/minecraft/world/item/CoalItem.h diff --git a/Minecraft.World/Items/TileItems/ColoredTileItem.cpp b/Minecraft.World/net/minecraft/world/item/ColoredTileItem.cpp similarity index 94% rename from Minecraft.World/Items/TileItems/ColoredTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/ColoredTileItem.cpp index dc6c607e6..7cf1225f1 100644 --- a/Minecraft.World/Items/TileItems/ColoredTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ColoredTileItem.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ColoredTileItem.h" ColoredTileItem::ColoredTileItem(int id, bool stackedByData) : TileItem(id) { diff --git a/Minecraft.World/Items/TileItems/ColoredTileItem.h b/Minecraft.World/net/minecraft/world/item/ColoredTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/ColoredTileItem.h rename to Minecraft.World/net/minecraft/world/item/ColoredTileItem.h diff --git a/Minecraft.World/Items/CompassItem.cpp b/Minecraft.World/net/minecraft/world/item/CompassItem.cpp similarity index 78% rename from Minecraft.World/Items/CompassItem.cpp rename to Minecraft.World/net/minecraft/world/item/CompassItem.cpp index 78237eadf..4254229ce 100644 --- a/Minecraft.World/Items/CompassItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/CompassItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "CompassItem.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h" -#include "../Headers/net.minecraft.world.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" +#include "../net.minecraft.world.h" const std::wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = { L"compassP0", L"compassP1", L"compassP2", L"compassP3"}; diff --git a/Minecraft.World/Items/CompassItem.h b/Minecraft.World/net/minecraft/world/item/CompassItem.h similarity index 100% rename from Minecraft.World/Items/CompassItem.h rename to Minecraft.World/net/minecraft/world/item/CompassItem.h diff --git a/Minecraft.World/Items/ComplexItem.cpp b/Minecraft.World/net/minecraft/world/item/ComplexItem.cpp similarity index 57% rename from Minecraft.World/Items/ComplexItem.cpp rename to Minecraft.World/net/minecraft/world/item/ComplexItem.cpp index 45a563348..e00cb0a92 100644 --- a/Minecraft.World/Items/ComplexItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ComplexItem.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" #include "ComplexItem.h" ComplexItem::ComplexItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/ComplexItem.h b/Minecraft.World/net/minecraft/world/item/ComplexItem.h similarity index 100% rename from Minecraft.World/Items/ComplexItem.h rename to Minecraft.World/net/minecraft/world/item/ComplexItem.h diff --git a/Minecraft.World/Items/DiggerItem.cpp b/Minecraft.World/net/minecraft/world/item/DiggerItem.cpp similarity index 86% rename from Minecraft.World/Items/DiggerItem.cpp rename to Minecraft.World/net/minecraft/world/item/DiggerItem.cpp index 2756b79d8..21412d6bb 100644 --- a/Minecraft.World/Items/DiggerItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/DiggerItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../entity/monster/net.minecraft.world.entity.monster.h" +#include "net.minecraft.world.item.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "DiggerItem.h" DiggerItem::DiggerItem(int id, float attackDamage, const Tier* tier, diff --git a/Minecraft.World/Items/DiggerItem.h b/Minecraft.World/net/minecraft/world/item/DiggerItem.h similarity index 100% rename from Minecraft.World/Items/DiggerItem.h rename to Minecraft.World/net/minecraft/world/item/DiggerItem.h diff --git a/Minecraft.World/Items/DoorItem.cpp b/Minecraft.World/net/minecraft/world/item/DoorItem.cpp similarity index 85% rename from Minecraft.World/Items/DoorItem.cpp rename to Minecraft.World/net/minecraft/world/item/DoorItem.cpp index da161538d..5802e61f9 100644 --- a/Minecraft.World/Items/DoorItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/DoorItem.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Util/Facing.h" -#include "../Blocks/Material.h" -#include "../Stats/GenericStats.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "net.minecraft.world.item.h" +#include "../../Facing.h" +#include "../level/material/Material.h" +#include "../../stats/GenericStats.h" #include "DoorItem.h" DoorItem::DoorItem(int id, Material* material) : Item(id) { diff --git a/Minecraft.World/Items/DoorItem.h b/Minecraft.World/net/minecraft/world/item/DoorItem.h similarity index 100% rename from Minecraft.World/Items/DoorItem.h rename to Minecraft.World/net/minecraft/world/item/DoorItem.h diff --git a/Minecraft.World/Items/DyePowderItem.cpp b/Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp similarity index 94% rename from Minecraft.World/Items/DyePowderItem.cpp rename to Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp index 6ea385dcc..acaab9123 100644 --- a/Minecraft.World/Items/DyePowderItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp @@ -1,16 +1,16 @@ -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.global.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.h" -#include "../Blocks/Material.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/net.minecraft.world.level.h" +#include "net.minecraft.world.item.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/global/net.minecraft.world.entity.global.h" +#include "../entity/animal/net.minecraft.world.entity.animal.h" +#include "../net.minecraft.world.h" +#include "../level/material/Material.h" #include "DyePowderItem.h" DyePowderItem::DyePowderItem(int id) : Item(id) { diff --git a/Minecraft.World/Items/DyePowderItem.h b/Minecraft.World/net/minecraft/world/item/DyePowderItem.h similarity index 100% rename from Minecraft.World/Items/DyePowderItem.h rename to Minecraft.World/net/minecraft/world/item/DyePowderItem.h diff --git a/Minecraft.World/net/minecraft/world/item/EggItem.cpp b/Minecraft.World/net/minecraft/world/item/EggItem.cpp new file mode 100644 index 000000000..32dcfa714 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/item/EggItem.cpp @@ -0,0 +1,29 @@ + +#include "../../../../Header Files/stdafx.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/net.minecraft.world.level.h" +#include "net.minecraft.world.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../entity/global/net.minecraft.world.entity.global.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "EggItem.h" +#include "../../../../Header Files/SoundTypes.h" + +EggItem::EggItem(int id) : Item(id) { maxStackSize = 16; } + +std::shared_ptr EggItem::use( + std::shared_ptr instance, Level* level, + std::shared_ptr player) { + if (!player->abilities.instabuild) { + instance->count--; + } + level->playEntitySound(player, eSoundType_RANDOM_BOW, 0.5f, + 0.4f / (random->nextFloat() * 0.4f + 0.8f)); + if (!level->isClientSide) + level->addEntity( + std::shared_ptr(new ThrownEgg(level, player))); + return instance; +} diff --git a/Minecraft.World/Items/EggItem.h b/Minecraft.World/net/minecraft/world/item/EggItem.h similarity index 100% rename from Minecraft.World/Items/EggItem.h rename to Minecraft.World/net/minecraft/world/item/EggItem.h diff --git a/Minecraft.World/Items/EmptyMapItem.cpp b/Minecraft.World/net/minecraft/world/item/EmptyMapItem.cpp similarity index 89% rename from Minecraft.World/Items/EmptyMapItem.cpp rename to Minecraft.World/net/minecraft/world/item/EmptyMapItem.cpp index 1fd80a19b..b8041229d 100644 --- a/Minecraft.World/Items/EmptyMapItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/EmptyMapItem.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "EmptyMapItem.h" EmptyMapItem::EmptyMapItem(int id) : ComplexItem(id) {} diff --git a/Minecraft.World/Items/EmptyMapItem.h b/Minecraft.World/net/minecraft/world/item/EmptyMapItem.h similarity index 100% rename from Minecraft.World/Items/EmptyMapItem.h rename to Minecraft.World/net/minecraft/world/item/EmptyMapItem.h diff --git a/Minecraft.World/Items/EnchantedBookItem.cpp b/Minecraft.World/net/minecraft/world/item/EnchantedBookItem.cpp similarity index 96% rename from Minecraft.World/Items/EnchantedBookItem.cpp rename to Minecraft.World/net/minecraft/world/item/EnchantedBookItem.cpp index 6428aae14..f887a2fb4 100644 --- a/Minecraft.World/Items/EnchantedBookItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/EnchantedBookItem.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Util/WeighedTreasure.h" +#include "../../../../Header Files/stdafx.h" +#include "enchantment/net.minecraft.world.item.enchantment.h" +#include "net.minecraft.world.item.h" +#include "../../util/WeighedTreasure.h" #include "EnchantedBookItem.h" const std::wstring EnchantedBookItem::TAG_STORED_ENCHANTMENTS = diff --git a/Minecraft.World/Items/EnchantedBookItem.h b/Minecraft.World/net/minecraft/world/item/EnchantedBookItem.h similarity index 100% rename from Minecraft.World/Items/EnchantedBookItem.h rename to Minecraft.World/net/minecraft/world/item/EnchantedBookItem.h diff --git a/Minecraft.World/Items/EnderEyeItem.cpp b/Minecraft.World/net/minecraft/world/item/EnderEyeItem.cpp similarity index 94% rename from Minecraft.World/Items/EnderEyeItem.cpp rename to Minecraft.World/net/minecraft/world/item/EnderEyeItem.cpp index df1c7f915..00f0423fa 100644 --- a/Minecraft.World/Items/EnderEyeItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/EnderEyeItem.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.levelgen.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/levelgen/net.minecraft.world.level.levelgen.h" +#include "../level/dimension/net.minecraft.world.level.dimension.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../phys/net.minecraft.world.phys.h" #include "EnderEyeItem.h" -#include "../Util/SoundTypes.h" -#include "../Level/LevelData.h" +#include "../../../../Header Files/SoundTypes.h" +#include "../level/storage/LevelData.h" EnderEyeItem::EnderEyeItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/EnderEyeItem.h b/Minecraft.World/net/minecraft/world/item/EnderEyeItem.h similarity index 100% rename from Minecraft.World/Items/EnderEyeItem.h rename to Minecraft.World/net/minecraft/world/item/EnderEyeItem.h diff --git a/Minecraft.World/Items/EnderPearlItem.cpp b/Minecraft.World/net/minecraft/world/item/EnderpearlItem.cpp similarity index 76% rename from Minecraft.World/Items/EnderPearlItem.cpp rename to Minecraft.World/net/minecraft/world/item/EnderpearlItem.cpp index 6cc7684a9..d2320f8ef 100644 --- a/Minecraft.World/Items/EnderPearlItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/EnderpearlItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "EnderPearlItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "EnderpearlItem.h" +#include "../../../../Header Files/SoundTypes.h" EnderpearlItem::EnderpearlItem(int id) : Item(id) { maxStackSize = 16; } diff --git a/Minecraft.World/Items/EnderPearlItem.h b/Minecraft.World/net/minecraft/world/item/EnderpearlItem.h similarity index 100% rename from Minecraft.World/Items/EnderPearlItem.h rename to Minecraft.World/net/minecraft/world/item/EnderpearlItem.h diff --git a/Minecraft.World/Items/ExperienceItem.cpp b/Minecraft.World/net/minecraft/world/item/ExperienceItem.cpp similarity index 73% rename from Minecraft.World/Items/ExperienceItem.cpp rename to Minecraft.World/net/minecraft/world/item/ExperienceItem.cpp index c02449444..d08176767 100644 --- a/Minecraft.World/Items/ExperienceItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ExperienceItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.item.h" +#include "../../../../Header Files/SoundTypes.h" #include "ExperienceItem.h" ExperienceItem::ExperienceItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/ExperienceItem.h b/Minecraft.World/net/minecraft/world/item/ExperienceItem.h similarity index 100% rename from Minecraft.World/Items/ExperienceItem.h rename to Minecraft.World/net/minecraft/world/item/ExperienceItem.h diff --git a/Minecraft.World/Items/FireChargeItem.cpp b/Minecraft.World/net/minecraft/world/item/FireChargeItem.cpp similarity index 79% rename from Minecraft.World/Items/FireChargeItem.cpp rename to Minecraft.World/net/minecraft/world/item/FireChargeItem.cpp index dd7dbab76..44254e2bd 100644 --- a/Minecraft.World/Items/FireChargeItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/FireChargeItem.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.item.h" +#include "../net.minecraft.world.h" +#include "../../../../Header Files/SoundTypes.h" #include "FireChargeItem.h" -#include "../Blocks/Tile.h" +#include "../level/tile/Tile.h" FireChargeItem::FireChargeItem(int id) : Item(id) { m_dragonFireballIcon = nullptr; diff --git a/Minecraft.World/Items/FireChargeItem.h b/Minecraft.World/net/minecraft/world/item/FireChargeItem.h similarity index 100% rename from Minecraft.World/Items/FireChargeItem.h rename to Minecraft.World/net/minecraft/world/item/FireChargeItem.h diff --git a/Minecraft.World/Items/FireworksChargeItem.cpp b/Minecraft.World/net/minecraft/world/item/FireworksChargeItem.cpp similarity index 98% rename from Minecraft.World/Items/FireworksChargeItem.cpp rename to Minecraft.World/net/minecraft/world/item/FireworksChargeItem.cpp index 69dc4036d..b7b07e885 100644 --- a/Minecraft.World/Items/FireworksChargeItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/FireworksChargeItem.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.h" +#include "../net.minecraft.world.h" #include "FireworksChargeItem.h" FireworksChargeItem::FireworksChargeItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/FireworksChargeItem.h b/Minecraft.World/net/minecraft/world/item/FireworksChargeItem.h similarity index 100% rename from Minecraft.World/Items/FireworksChargeItem.h rename to Minecraft.World/net/minecraft/world/item/FireworksChargeItem.h diff --git a/Minecraft.World/Items/FireworksItem.cpp b/Minecraft.World/net/minecraft/world/item/FireworksItem.cpp similarity index 91% rename from Minecraft.World/Items/FireworksItem.cpp rename to Minecraft.World/net/minecraft/world/item/FireworksItem.cpp index 53e413a8b..6ee1978fe 100644 --- a/Minecraft.World/Items/FireworksItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/FireworksItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" #include "FireworksItem.h" const std::wstring FireworksItem::TAG_FIREWORKS = L"Fireworks"; diff --git a/Minecraft.World/Items/FireworksItem.h b/Minecraft.World/net/minecraft/world/item/FireworksItem.h similarity index 100% rename from Minecraft.World/Items/FireworksItem.h rename to Minecraft.World/net/minecraft/world/item/FireworksItem.h diff --git a/Minecraft.World/Items/FishingRodItem.cpp b/Minecraft.World/net/minecraft/world/item/FishingRodItem.cpp similarity index 68% rename from Minecraft.World/Items/FishingRodItem.cpp rename to Minecraft.World/net/minecraft/world/item/FishingRodItem.cpp index 94632cc6c..018cb4c05 100644 --- a/Minecraft.World/Items/FishingRodItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/FishingRodItem.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.chunk.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.level.saveddata.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../Header Files/stdafx.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/chunk/net.minecraft.world.level.chunk.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../net.minecraft.world.h" #include "ItemInstance.h" #include "FishingRodItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" FishingRodItem::FishingRodItem(int id) : Item(id) { setMaxDamage(64); diff --git a/Minecraft.World/Items/FishingRodItem.h b/Minecraft.World/net/minecraft/world/item/FishingRodItem.h similarity index 100% rename from Minecraft.World/Items/FishingRodItem.h rename to Minecraft.World/net/minecraft/world/item/FishingRodItem.h diff --git a/Minecraft.World/Items/FlintAndSteelItem.cpp b/Minecraft.World/net/minecraft/world/item/FlintAndSteelItem.cpp similarity index 83% rename from Minecraft.World/Items/FlintAndSteelItem.cpp rename to Minecraft.World/net/minecraft/world/item/FlintAndSteelItem.cpp index eef623779..ce1125039 100644 --- a/Minecraft.World/Items/FlintAndSteelItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/FlintAndSteelItem.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Blocks/Material.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../../stats/net.minecraft.stats.h" +#include "../level/material/Material.h" #include "ItemInstance.h" #include "FlintAndSteelItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" FlintAndSteelItem::FlintAndSteelItem(int id) : Item(id) { maxStackSize = 1; diff --git a/Minecraft.World/Items/FlintAndSteelItem.h b/Minecraft.World/net/minecraft/world/item/FlintAndSteelItem.h similarity index 100% rename from Minecraft.World/Items/FlintAndSteelItem.h rename to Minecraft.World/net/minecraft/world/item/FlintAndSteelItem.h diff --git a/Minecraft.World/Items/FoodItem.cpp b/Minecraft.World/net/minecraft/world/item/FoodItem.cpp similarity index 88% rename from Minecraft.World/Items/FoodItem.cpp rename to Minecraft.World/net/minecraft/world/item/FoodItem.cpp index fd34b94be..41db2ff45 100644 --- a/Minecraft.World/Items/FoodItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/FoodItem.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../food/net.minecraft.world.food.h" +#include "../level/net.minecraft.world.level.h" +#include "../effect/net.minecraft.world.effect.h" +#include "../../net.minecraft.h" #include "ItemInstance.h" #include "FoodItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" // 4J : WESTY : Other award ... eating cooked pork chop. -#include "../Headers/net.minecraft.stats.h" +#include "../../stats/net.minecraft.stats.h" void FoodItem::_init() { // 4J Initialisers diff --git a/Minecraft.World/Items/FoodItem.h b/Minecraft.World/net/minecraft/world/item/FoodItem.h similarity index 100% rename from Minecraft.World/Items/FoodItem.h rename to Minecraft.World/net/minecraft/world/item/FoodItem.h diff --git a/Minecraft.World/Items/GoldenAppleItem.cpp b/Minecraft.World/net/minecraft/world/item/GoldenAppleItem.cpp similarity index 88% rename from Minecraft.World/Items/GoldenAppleItem.cpp rename to Minecraft.World/net/minecraft/world/item/GoldenAppleItem.cpp index 904ce7322..cc1b29baf 100644 --- a/Minecraft.World/Items/GoldenAppleItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/GoldenAppleItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Util/SharedConstants.h" +#include "../../../../Header Files/stdafx.h" +#include "../effect/net.minecraft.world.effect.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../../SharedConstants.h" #include "GoldenAppleItem.h" GoldenAppleItem::GoldenAppleItem(int id, int nutrition, float saturationMod, diff --git a/Minecraft.World/Items/GoldenAppleItem.h b/Minecraft.World/net/minecraft/world/item/GoldenAppleItem.h similarity index 100% rename from Minecraft.World/Items/GoldenAppleItem.h rename to Minecraft.World/net/minecraft/world/item/GoldenAppleItem.h diff --git a/Minecraft.World/Items/HangingEntityItem.cpp b/Minecraft.World/net/minecraft/world/item/HangingEntityItem.cpp similarity index 88% rename from Minecraft.World/Items/HangingEntityItem.cpp rename to Minecraft.World/net/minecraft/world/item/HangingEntityItem.cpp index 7dfcfe323..f5c3a50e0 100644 --- a/Minecraft.World/Items/HangingEntityItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/HangingEntityItem.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../../net.minecraft.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../damageSource/net.minecraft.world.damagesource.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" #include "HangingEntityItem.h" -#include "../Entities/HangingEntity.h" -#include "../Entities/Mobs/Painting.h" -#include "../Stats/GenericStats.h" -#include "../Entities/Mobs/ItemFrame.h" +#include "../entity/HangingEntity.h" +#include "../entity/Painting.h" +#include "../../stats/GenericStats.h" +#include "../entity/ItemFrame.h" HangingEntityItem::HangingEntityItem(int id, eINSTANCEOF eClassType) : Item(id) { diff --git a/Minecraft.World/Items/HangingEntityItem.h b/Minecraft.World/net/minecraft/world/item/HangingEntityItem.h similarity index 100% rename from Minecraft.World/Items/HangingEntityItem.h rename to Minecraft.World/net/minecraft/world/item/HangingEntityItem.h diff --git a/Minecraft.World/Items/HatchetItem.cpp b/Minecraft.World/net/minecraft/world/item/HatchetItem.cpp similarity index 91% rename from Minecraft.World/Items/HatchetItem.cpp rename to Minecraft.World/net/minecraft/world/item/HatchetItem.cpp index 7247e1caf..618ef9a4f 100644 --- a/Minecraft.World/Items/HatchetItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/HatchetItem.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "HatchetItem.h" TileArray* HatchetItem::diggables = nullptr; diff --git a/Minecraft.World/Items/HatchetItem.h b/Minecraft.World/net/minecraft/world/item/HatchetItem.h similarity index 100% rename from Minecraft.World/Items/HatchetItem.h rename to Minecraft.World/net/minecraft/world/item/HatchetItem.h diff --git a/Minecraft.World/Items/HoeItem.cpp b/Minecraft.World/net/minecraft/world/item/HoeItem.cpp similarity index 87% rename from Minecraft.World/Items/HoeItem.cpp rename to Minecraft.World/net/minecraft/world/item/HoeItem.cpp index d23a61027..76ff7c240 100644 --- a/Minecraft.World/Items/HoeItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/HoeItem.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ItemInstance.h" #include "HoeItem.h" diff --git a/Minecraft.World/Items/HoeItem.h b/Minecraft.World/net/minecraft/world/item/HoeItem.h similarity index 100% rename from Minecraft.World/Items/HoeItem.h rename to Minecraft.World/net/minecraft/world/item/HoeItem.h diff --git a/Minecraft.World/Items/Item.cpp b/Minecraft.World/net/minecraft/world/item/Item.cpp similarity index 99% rename from Minecraft.World/Items/Item.cpp rename to Minecraft.World/net/minecraft/world/item/Item.cpp index 2e3cdc4e0..3c6105e62 100644 --- a/Minecraft.World/Items/Item.cpp +++ b/Minecraft.World/net/minecraft/world/item/Item.cpp @@ -1,21 +1,21 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" -#include "../Headers/net.minecraft.locale.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.alchemy.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.stats.h" +#include "../../locale/net.minecraft.locale.h" +#include "../net.minecraft.world.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" +#include "alchemy/net.minecraft.world.item.alchemy.h" +#include "../food/net.minecraft.world.food.h" +#include "../effect/net.minecraft.world.effect.h" +#include "../../stats/net.minecraft.stats.h" #include "MapItem.h" #include "Item.h" #include "HangingEntityItem.h" -#include "../Util/HtmlString.h" -#include "Util/Vec3.h" +#include "../../util/HtmlString.h" +#include "../phys/Vec3.h" typedef Item::Tier _Tier; diff --git a/Minecraft.World/Items/Item.h b/Minecraft.World/net/minecraft/world/item/Item.h similarity index 99% rename from Minecraft.World/Items/Item.h rename to Minecraft.World/net/minecraft/world/item/Item.h index 857b287f4..40bb2bbcc 100644 --- a/Minecraft.World/Items/Item.h +++ b/Minecraft.World/net/minecraft/world/item/Item.h @@ -1,8 +1,8 @@ #pragma once -#include "../Containers/Container.h" -#include "../Util/UseAnim.h" -#include "../Util/Rarity.h" +#include "../Container.h" +#include "UseAnim.h" +#include "Rarity.h" class MapItem; class Mob; diff --git a/Minecraft.World/Items/ItemInstance.cpp b/Minecraft.World/net/minecraft/world/item/ItemInstance.cpp similarity index 97% rename from Minecraft.World/Items/ItemInstance.cpp rename to Minecraft.World/net/minecraft/world/item/ItemInstance.cpp index 2e01eb296..176de30cd 100644 --- a/Minecraft.World/Items/ItemInstance.cpp +++ b/Minecraft.World/net/minecraft/world/item/ItemInstance.cpp @@ -1,18 +1,18 @@ -#include "../Platform/stdafx.h" -#include "../Headers/com.mojang.nbt.h" -#include "../Headers/net.minecraft.locale.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../locale/net.minecraft.locale.h" +#include "../../stats/net.minecraft.stats.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../entity/monster/net.minecraft.world.entity.monster.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" +#include "enchantment/net.minecraft.world.item.enchantment.h" #include "Item.h" #include "ItemInstance.h" -#include "../Util/HtmlString.h" +#include "../../util/HtmlString.h" const std::wstring ItemInstance::ATTRIBUTE_MODIFIER_FORMAT = L"#.###"; diff --git a/Minecraft.World/Items/ItemInstance.h b/Minecraft.World/net/minecraft/world/item/ItemInstance.h similarity index 98% rename from Minecraft.World/Items/ItemInstance.h rename to Minecraft.World/net/minecraft/world/item/ItemInstance.h index ef3c7c624..43bee3f35 100644 --- a/Minecraft.World/Items/ItemInstance.h +++ b/Minecraft.World/net/minecraft/world/item/ItemInstance.h @@ -1,8 +1,8 @@ #pragma once -#include "../Util/UseAnim.h" -#include "../Headers/com.mojang.nbt.h" -#include "../AI/Attributes/Attribute.h" +#include "UseAnim.h" +#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../entity/ai/attributes/Attribute.h" class Entity; class Level; diff --git a/Minecraft.World/Items/TileItems/LeafTileItem.cpp b/Minecraft.World/net/minecraft/world/item/LeafTileItem.cpp similarity index 85% rename from Minecraft.World/Items/TileItems/LeafTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/LeafTileItem.cpp index b7961636c..b905d4b88 100644 --- a/Minecraft.World/Items/TileItems/LeafTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/LeafTileItem.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" #include "LeafTileItem.h" -#include "../../Util/FoliageColor.h" +#include "../level/FoliageColor.h" LeafTileItem::LeafTileItem(int id) : TileItem(id) { setMaxDamage(0); diff --git a/Minecraft.World/Items/TileItems/LeafTileItem.h b/Minecraft.World/net/minecraft/world/item/LeafTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/LeafTileItem.h rename to Minecraft.World/net/minecraft/world/item/LeafTileItem.h diff --git a/Minecraft.World/Items/LeashItem.cpp b/Minecraft.World/net/minecraft/world/item/LeashItem.cpp similarity index 90% rename from Minecraft.World/Items/LeashItem.cpp rename to Minecraft.World/net/minecraft/world/item/LeashItem.cpp index 17d08f85d..9c3230e9f 100644 --- a/Minecraft.World/Items/LeashItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/LeashItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "Util/AABB.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../phys/AABB.h" #include "LeashItem.h" LeashItem::LeashItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/LeashItem.h b/Minecraft.World/net/minecraft/world/item/LeashItem.h similarity index 100% rename from Minecraft.World/Items/LeashItem.h rename to Minecraft.World/net/minecraft/world/item/LeashItem.h diff --git a/Minecraft.World/Items/MapItem.cpp b/Minecraft.World/net/minecraft/world/item/MapItem.cpp similarity index 93% rename from Minecraft.World/Items/MapItem.cpp rename to Minecraft.World/net/minecraft/world/item/MapItem.cpp index 63d828af0..e6a384c81 100644 --- a/Minecraft.World/Items/MapItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/MapItem.cpp @@ -1,18 +1,18 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.network.packet.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.chunk.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.level.saveddata.h" -#include "../Headers/net.minecraft.world.level.storage.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../../network/packet/net.minecraft.network.packet.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/chunk/net.minecraft.world.level.chunk.h" +#include "../level/dimension/net.minecraft.world.level.dimension.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../level/saveddata/net.minecraft.world.level.saveddata.h" +#include "../level/storage/net.minecraft.world.level.storage.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" #include "MapItem.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Util/JavaMath.h" +#include "../inventory/net.minecraft.world.inventory.h" +#include "../../../../ConsoleJavaLibs/JavaMath.h" MapItem::MapItem(int id) : ComplexItem(id) { setStackedByData(true); } diff --git a/Minecraft.World/Items/MapItem.h b/Minecraft.World/net/minecraft/world/item/MapItem.h similarity index 100% rename from Minecraft.World/Items/MapItem.h rename to Minecraft.World/net/minecraft/world/item/MapItem.h diff --git a/Minecraft.World/Items/MilkBucketItem.cpp b/Minecraft.World/net/minecraft/world/item/MilkBucketItem.cpp similarity index 86% rename from Minecraft.World/Items/MilkBucketItem.cpp rename to Minecraft.World/net/minecraft/world/item/MilkBucketItem.cpp index 719c2898b..f4815f670 100644 --- a/Minecraft.World/Items/MilkBucketItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/MilkBucketItem.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "MilkBucketItem.h" MilkBucketItem::MilkBucketItem(int id) : Item(id) { setMaxStackSize(1); } diff --git a/Minecraft.World/Items/MilkBucketItem.h b/Minecraft.World/net/minecraft/world/item/MilkBucketItem.h similarity index 100% rename from Minecraft.World/Items/MilkBucketItem.h rename to Minecraft.World/net/minecraft/world/item/MilkBucketItem.h diff --git a/Minecraft.World/Items/MinecartItem.cpp b/Minecraft.World/net/minecraft/world/item/MinecartItem.cpp similarity index 92% rename from Minecraft.World/Items/MinecartItem.cpp rename to Minecraft.World/net/minecraft/world/item/MinecartItem.cpp index d73746206..65f1ab6ae 100644 --- a/Minecraft.World/Items/MinecartItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/MinecartItem.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ItemInstance.h" #include "MinecartItem.h" diff --git a/Minecraft.World/Items/MinecartItem.h b/Minecraft.World/net/minecraft/world/item/MinecartItem.h similarity index 94% rename from Minecraft.World/Items/MinecartItem.h rename to Minecraft.World/net/minecraft/world/item/MinecartItem.h index 21673e2cc..7e956cc14 100644 --- a/Minecraft.World/Items/MinecartItem.h +++ b/Minecraft.World/net/minecraft/world/item/MinecartItem.h @@ -1,7 +1,7 @@ #pragma once #include "Item.h" -#include "../Core/DefaultDispenseItemBehavior.h" +#include "../../core/DefaultDispenseItemBehavior.h" class MinecartItem : public Item { private: diff --git a/Minecraft.World/Items/TileItems/MultiTextureTileItem.cpp b/Minecraft.World/net/minecraft/world/item/MultiTextureTileItem.cpp similarity index 90% rename from Minecraft.World/Items/TileItems/MultiTextureTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/MultiTextureTileItem.cpp index 304b84d75..34b356178 100644 --- a/Minecraft.World/Items/TileItems/MultiTextureTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/MultiTextureTileItem.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Blocks/Tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/Tile.h" #include "MultiTextureTileItem.h" -#include "../../Headers/net.minecraft.world.item.crafting.h" +#include "crafting/net.minecraft.world.item.crafting.h" MultiTextureTileItem::MultiTextureTileItem(int id, Tile* parentTile, int* nameExtensions, int iLength, diff --git a/Minecraft.World/Items/TileItems/MultiTextureTileItem.h b/Minecraft.World/net/minecraft/world/item/MultiTextureTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/MultiTextureTileItem.h rename to Minecraft.World/net/minecraft/world/item/MultiTextureTileItem.h diff --git a/Minecraft.World/Items/NameTagItem.cpp b/Minecraft.World/net/minecraft/world/item/NameTagItem.cpp similarity index 88% rename from Minecraft.World/Items/NameTagItem.cpp rename to Minecraft.World/net/minecraft/world/item/NameTagItem.cpp index 0890b8f35..e0a1ed379 100644 --- a/Minecraft.World/Items/NameTagItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/NameTagItem.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" #include "NameTagItem.h" NameTagItem::NameTagItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/NameTagItem.h b/Minecraft.World/net/minecraft/world/item/NameTagItem.h similarity index 100% rename from Minecraft.World/Items/NameTagItem.h rename to Minecraft.World/net/minecraft/world/item/NameTagItem.h diff --git a/Minecraft.World/Items/PickaxeItem.cpp b/Minecraft.World/net/minecraft/world/item/PickaxeItem.cpp similarity index 96% rename from Minecraft.World/Items/PickaxeItem.cpp rename to Minecraft.World/net/minecraft/world/item/PickaxeItem.cpp index 55ff1a084..9f317ff26 100644 --- a/Minecraft.World/Items/PickaxeItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/PickaxeItem.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "PickaxeItem.h" TileArray PickaxeItem::diggables; diff --git a/Minecraft.World/Items/PickaxeItem.h b/Minecraft.World/net/minecraft/world/item/PickaxeItem.h similarity index 100% rename from Minecraft.World/Items/PickaxeItem.h rename to Minecraft.World/net/minecraft/world/item/PickaxeItem.h diff --git a/Minecraft.World/Items/TileItems/PistonTileItem.cpp b/Minecraft.World/net/minecraft/world/item/PistonTileItem.cpp similarity index 64% rename from Minecraft.World/Items/TileItems/PistonTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/PistonTileItem.cpp index 1d3eae892..277117f17 100644 --- a/Minecraft.World/Items/TileItems/PistonTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/PistonTileItem.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" #include "PistonTileItem.h" PistonTileItem::PistonTileItem(int id) : TileItem(id) {} diff --git a/Minecraft.World/Items/TileItems/PistonTileItem.h b/Minecraft.World/net/minecraft/world/item/PistonTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/PistonTileItem.h rename to Minecraft.World/net/minecraft/world/item/PistonTileItem.h diff --git a/Minecraft.World/Items/TileItems/PlanterTileItem.cpp b/Minecraft.World/net/minecraft/world/item/PlanterTileItem.cpp similarity index 90% rename from Minecraft.World/Items/TileItems/PlanterTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/PlanterTileItem.cpp index 34e01312d..8c952562e 100644 --- a/Minecraft.World/Items/TileItems/PlanterTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/PlanterTileItem.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.h" #include "PlanterTileItem.h" -#include "../../Stats/GenericStats.h" +#include "../../stats/GenericStats.h" // 4J-PB - for the debug option of not removing items #include #include diff --git a/Minecraft.World/Items/TileItems/PlanterTileItem.h b/Minecraft.World/net/minecraft/world/item/PlanterTileItem.h similarity index 95% rename from Minecraft.World/Items/TileItems/PlanterTileItem.h rename to Minecraft.World/net/minecraft/world/item/PlanterTileItem.h index 35f157a2f..2ec8bbb03 100644 --- a/Minecraft.World/Items/TileItems/PlanterTileItem.h +++ b/Minecraft.World/net/minecraft/world/item/PlanterTileItem.h @@ -1,6 +1,6 @@ #pragma once -#include "../Item.h" +#include "Item.h" class TilePlanterItem : public Item { private: diff --git a/Minecraft.World/Items/PotionItem.cpp b/Minecraft.World/net/minecraft/world/item/PotionItem.cpp similarity index 95% rename from Minecraft.World/Items/PotionItem.cpp rename to Minecraft.World/net/minecraft/world/item/PotionItem.cpp index 9bd524b5c..773dd18aa 100644 --- a/Minecraft.World/Items/PotionItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/PotionItem.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.alchemy.h" -#include "../Headers/net.minecraft.world.effect.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.h" -#include "../Entities/MobEffectInstance.h" -#include "../Util/StringHelpers.h" -#include "../Util/SharedConstants.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.h" +#include "alchemy/net.minecraft.world.item.alchemy.h" +#include "../effect/net.minecraft.world.effect.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../net.minecraft.world.h" +#include "../effect/MobEffectInstance.h" +#include "../../../../ConsoleHelpers/StringHelpers.h" +#include "../../SharedConstants.h" #include "PotionItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" const std::wstring PotionItem::DEFAULT_ICON = L"potion"; const std::wstring PotionItem::THROWABLE_ICON = L"potion_splash"; diff --git a/Minecraft.World/Items/PotionItem.h b/Minecraft.World/net/minecraft/world/item/PotionItem.h similarity index 100% rename from Minecraft.World/Items/PotionItem.h rename to Minecraft.World/net/minecraft/world/item/PotionItem.h diff --git a/Minecraft.World/Util/Rarity.cpp b/Minecraft.World/net/minecraft/world/item/Rarity.cpp similarity index 89% rename from Minecraft.World/Util/Rarity.cpp rename to Minecraft.World/net/minecraft/world/item/Rarity.cpp index 73368c2a7..1a9576144 100644 --- a/Minecraft.World/Util/Rarity.cpp +++ b/Minecraft.World/net/minecraft/world/item/Rarity.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "Rarity.h" diff --git a/Minecraft.World/Util/Rarity.h b/Minecraft.World/net/minecraft/world/item/Rarity.h similarity index 100% rename from Minecraft.World/Util/Rarity.h rename to Minecraft.World/net/minecraft/world/item/Rarity.h diff --git a/Minecraft.World/Items/RecordingItem.cpp b/Minecraft.World/net/minecraft/world/item/RecordingItem.cpp similarity index 87% rename from Minecraft.World/Items/RecordingItem.cpp rename to Minecraft.World/net/minecraft/world/item/RecordingItem.cpp index 1b8413a6d..cce62e64d 100644 --- a/Minecraft.World/Items/RecordingItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/RecordingItem.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" +#include "../net.minecraft.world.h" #include "ItemInstance.h" #include "RecordingItem.h" -#include "../Stats/GenericStats.h" +#include "../../stats/GenericStats.h" std::unordered_map RecordingItem::BY_NAME; diff --git a/Minecraft.World/Items/RecordingItem.h b/Minecraft.World/net/minecraft/world/item/RecordingItem.h similarity index 100% rename from Minecraft.World/Items/RecordingItem.h rename to Minecraft.World/net/minecraft/world/item/RecordingItem.h diff --git a/Minecraft.World/Items/RedstoneItem.cpp b/Minecraft.World/net/minecraft/world/item/RedStoneItem.cpp similarity index 82% rename from Minecraft.World/Items/RedstoneItem.cpp rename to Minecraft.World/net/minecraft/world/item/RedStoneItem.cpp index ef8454e08..5575d0325 100644 --- a/Minecraft.World/Items/RedstoneItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/RedStoneItem.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ItemInstance.h" -#include "../Stats/GenericStats.h" -#include "RedstoneItem.h" +#include "../../stats/GenericStats.h" +#include "RedStoneItem.h" RedStoneItem::RedStoneItem(int id) : Item(id) {} diff --git a/Minecraft.World/Items/RedstoneItem.h b/Minecraft.World/net/minecraft/world/item/RedStoneItem.h similarity index 100% rename from Minecraft.World/Items/RedstoneItem.h rename to Minecraft.World/net/minecraft/world/item/RedStoneItem.h diff --git a/Minecraft.World/Items/SaddleItem.cpp b/Minecraft.World/net/minecraft/world/item/SaddleItem.cpp similarity index 81% rename from Minecraft.World/Items/SaddleItem.cpp rename to Minecraft.World/net/minecraft/world/item/SaddleItem.cpp index a7a1544ff..55e8e16f9 100644 --- a/Minecraft.World/Items/SaddleItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SaddleItem.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/animal/net.minecraft.world.entity.animal.h" +#include "net.minecraft.world.item.h" +#include "../entity/net.minecraft.world.entity.h" #include "SaddleItem.h" SaddleItem::SaddleItem(int id) : Item(id) { maxStackSize = 1; } diff --git a/Minecraft.World/Items/SaddleItem.h b/Minecraft.World/net/minecraft/world/item/SaddleItem.h similarity index 100% rename from Minecraft.World/Items/SaddleItem.h rename to Minecraft.World/net/minecraft/world/item/SaddleItem.h diff --git a/Minecraft.World/Items/TileItems/SaplingTileItem.cpp b/Minecraft.World/net/minecraft/world/item/SaplingTileItem.cpp similarity index 87% rename from Minecraft.World/Items/TileItems/SaplingTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/SaplingTileItem.cpp index 86fda0381..f3cea6041 100644 --- a/Minecraft.World/Items/TileItems/SaplingTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SaplingTileItem.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "TileItem.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "SaplingTileItem.h" SaplingTileItem::SaplingTileItem(int id) : TileItem(id) { diff --git a/Minecraft.World/Items/TileItems/SaplingTileItem.h b/Minecraft.World/net/minecraft/world/item/SaplingTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/SaplingTileItem.h rename to Minecraft.World/net/minecraft/world/item/SaplingTileItem.h diff --git a/Minecraft.World/Items/SeedFoodItem.cpp b/Minecraft.World/net/minecraft/world/item/SeedFoodItem.cpp similarity index 84% rename from Minecraft.World/Items/SeedFoodItem.cpp rename to Minecraft.World/net/minecraft/world/item/SeedFoodItem.cpp index 6962b0be1..c1ef19e3f 100644 --- a/Minecraft.World/Items/SeedFoodItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SeedFoodItem.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.h" +#include "../level/net.minecraft.world.level.h" #include "SeedFoodItem.h" SeedFoodItem::SeedFoodItem(int id, int nutrition, float saturationMod, diff --git a/Minecraft.World/Items/SeedFoodItem.h b/Minecraft.World/net/minecraft/world/item/SeedFoodItem.h similarity index 100% rename from Minecraft.World/Items/SeedFoodItem.h rename to Minecraft.World/net/minecraft/world/item/SeedFoodItem.h diff --git a/Minecraft.World/Items/SeedItem.cpp b/Minecraft.World/net/minecraft/world/item/SeedItem.cpp similarity index 82% rename from Minecraft.World/Items/SeedItem.cpp rename to Minecraft.World/net/minecraft/world/item/SeedItem.cpp index 40393294f..2e1153dcd 100644 --- a/Minecraft.World/Items/SeedItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SeedItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "Item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ItemInstance.h" #include "SeedItem.h" diff --git a/Minecraft.World/Items/SeedItem.h b/Minecraft.World/net/minecraft/world/item/SeedItem.h similarity index 100% rename from Minecraft.World/Items/SeedItem.h rename to Minecraft.World/net/minecraft/world/item/SeedItem.h diff --git a/Minecraft.World/Items/ShearsItem.cpp b/Minecraft.World/net/minecraft/world/item/ShearsItem.cpp similarity index 90% rename from Minecraft.World/Items/ShearsItem.cpp rename to Minecraft.World/net/minecraft/world/item/ShearsItem.cpp index e1b4c360d..d858ca656 100644 --- a/Minecraft.World/Items/ShearsItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ShearsItem.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "ShearsItem.h" -#include "../Blocks/Tile.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../level/tile/Tile.h" +#include "../entity/net.minecraft.world.entity.h" ShearsItem::ShearsItem(int itemId) : Item(itemId) { setMaxStackSize(1); diff --git a/Minecraft.World/Items/ShearsItem.h b/Minecraft.World/net/minecraft/world/item/ShearsItem.h similarity index 100% rename from Minecraft.World/Items/ShearsItem.h rename to Minecraft.World/net/minecraft/world/item/ShearsItem.h diff --git a/Minecraft.World/Items/ShovelItem.cpp b/Minecraft.World/net/minecraft/world/item/ShovelItem.cpp similarity index 88% rename from Minecraft.World/Items/ShovelItem.cpp rename to Minecraft.World/net/minecraft/world/item/ShovelItem.cpp index cebb309a7..a03c42d9c 100644 --- a/Minecraft.World/Items/ShovelItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/ShovelItem.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "ShovelItem.h" TileArray* ShovelItem::diggables = nullptr; diff --git a/Minecraft.World/Items/ShovelItem.h b/Minecraft.World/net/minecraft/world/item/ShovelItem.h similarity index 100% rename from Minecraft.World/Items/ShovelItem.h rename to Minecraft.World/net/minecraft/world/item/ShovelItem.h diff --git a/Minecraft.World/Items/SignItem.cpp b/Minecraft.World/net/minecraft/world/item/SignItem.cpp similarity index 85% rename from Minecraft.World/Items/SignItem.cpp rename to Minecraft.World/net/minecraft/world/item/SignItem.cpp index f24b7d206..0ec2e5de0 100644 --- a/Minecraft.World/Items/SignItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SignItem.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "ItemInstance.h" #include "SignItem.h" -#include "../Stats/GenericStats.h" +#include "../../stats/GenericStats.h" SignItem::SignItem(int id) : Item(id) { // 4J-PB - Changed for TU9 diff --git a/Minecraft.World/Items/SignItem.h b/Minecraft.World/net/minecraft/world/item/SignItem.h similarity index 100% rename from Minecraft.World/Items/SignItem.h rename to Minecraft.World/net/minecraft/world/item/SignItem.h diff --git a/Minecraft.World/Items/SimpleFoiledItem.cpp b/Minecraft.World/net/minecraft/world/item/SimpleFoiledItem.cpp similarity index 80% rename from Minecraft.World/Items/SimpleFoiledItem.cpp rename to Minecraft.World/net/minecraft/world/item/SimpleFoiledItem.cpp index 06a176c12..b3695f7b8 100644 --- a/Minecraft.World/Items/SimpleFoiledItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SimpleFoiledItem.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "SimpleFoiledItem.h" diff --git a/Minecraft.World/Items/SimpleFoiledItem.h b/Minecraft.World/net/minecraft/world/item/SimpleFoiledItem.h similarity index 100% rename from Minecraft.World/Items/SimpleFoiledItem.h rename to Minecraft.World/net/minecraft/world/item/SimpleFoiledItem.h diff --git a/Minecraft.World/Items/TileItems/SkullItem.cpp b/Minecraft.World/net/minecraft/world/item/SkullItem.cpp similarity index 91% rename from Minecraft.World/Items/TileItems/SkullItem.cpp rename to Minecraft.World/net/minecraft/world/item/SkullItem.cpp index fb7a581be..526ca07eb 100644 --- a/Minecraft.World/Items/TileItems/SkullItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SkullItem.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/net.minecraft.world.level.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../net.minecraft.h" +#include "../net.minecraft.world.h" #include "SkullItem.h" const unsigned int SkullItem::NAMES[SKULL_COUNT] = { diff --git a/Minecraft.World/Items/TileItems/SkullItem.h b/Minecraft.World/net/minecraft/world/item/SkullItem.h similarity index 98% rename from Minecraft.World/Items/TileItems/SkullItem.h rename to Minecraft.World/net/minecraft/world/item/SkullItem.h index abc741a1c..16a97ca71 100644 --- a/Minecraft.World/Items/TileItems/SkullItem.h +++ b/Minecraft.World/net/minecraft/world/item/SkullItem.h @@ -1,6 +1,6 @@ #pragma once -#include "../Item.h" +#include "Item.h" class SkullItem : public Item { private: diff --git a/Minecraft.World/Items/SnowItem.cpp b/Minecraft.World/net/minecraft/world/item/SnowItem.cpp similarity index 88% rename from Minecraft.World/Items/SnowItem.cpp rename to Minecraft.World/net/minecraft/world/item/SnowItem.cpp index 66524f9b4..857e67c6c 100644 --- a/Minecraft.World/Items/SnowItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SnowItem.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/net.minecraft.world.level.h" #include "SnowItem.h" -#include "Util/AABB.h" +#include "../phys/AABB.h" SnowItem::SnowItem(int id, Tile* parentTile) : AuxDataTileItem(id, parentTile) {} diff --git a/Minecraft.World/Items/SnowItem.h b/Minecraft.World/net/minecraft/world/item/SnowItem.h similarity index 90% rename from Minecraft.World/Items/SnowItem.h rename to Minecraft.World/net/minecraft/world/item/SnowItem.h index 02b4bca99..b5ee55688 100644 --- a/Minecraft.World/Items/SnowItem.h +++ b/Minecraft.World/net/minecraft/world/item/SnowItem.h @@ -1,6 +1,6 @@ #pragma once -#include "TileItems/AuxDataTileItem.h" +#include "AuxDataTileItem.h" class SnowItem : public AuxDataTileItem { public: diff --git a/Minecraft.World/Items/SnowballItem.cpp b/Minecraft.World/net/minecraft/world/item/SnowballItem.cpp similarity index 67% rename from Minecraft.World/Items/SnowballItem.cpp rename to Minecraft.World/net/minecraft/world/item/SnowballItem.cpp index fed115d79..dfba0af77 100644 --- a/Minecraft.World/Items/SnowballItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SnowballItem.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" #include "SnowballItem.h" -#include "../Util/SoundTypes.h" +#include "../../../../Header Files/SoundTypes.h" SnowballItem::SnowballItem(int id) : Item(id) { this->maxStackSize = 16; } diff --git a/Minecraft.World/Items/SnowballItem.h b/Minecraft.World/net/minecraft/world/item/SnowballItem.h similarity index 100% rename from Minecraft.World/Items/SnowballItem.h rename to Minecraft.World/net/minecraft/world/item/SnowballItem.h diff --git a/Minecraft.World/Items/SpawnEggItem.cpp b/Minecraft.World/net/minecraft/world/item/SpawnEggItem.cpp similarity index 95% rename from Minecraft.World/Items/SpawnEggItem.cpp rename to Minecraft.World/net/minecraft/world/item/SpawnEggItem.cpp index ac2ba878d..75f63c08b 100644 --- a/Minecraft.World/Items/SpawnEggItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/SpawnEggItem.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.npc.h" -#include "../Headers/net.minecraft.world.h" -#include "../Util/HitResult.h" +#include "../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../net.minecraft.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/npc/net.minecraft.world.entity.npc.h" +#include "../net.minecraft.world.h" +#include "../phys/HitResult.h" #include "SpawnEggItem.h" -#include "../Util/Difficulty.h" +#include "../Difficulty.h" SpawnEggItem::SpawnEggItem(int id) : Item(id) { setMaxStackSize(16); // 4J-PB brought forward. It is 64 on PC, but we'll diff --git a/Minecraft.World/Items/SpawnEggItem.h b/Minecraft.World/net/minecraft/world/item/SpawnEggItem.h similarity index 100% rename from Minecraft.World/Items/SpawnEggItem.h rename to Minecraft.World/net/minecraft/world/item/SpawnEggItem.h diff --git a/Minecraft.World/Items/TileItems/StoneSlabTileItem.cpp b/Minecraft.World/net/minecraft/world/item/StoneSlabTileItem.cpp similarity index 92% rename from Minecraft.World/Items/TileItems/StoneSlabTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/StoneSlabTileItem.cpp index 3ec12fd21..2555010eb 100644 --- a/Minecraft.World/Items/TileItems/StoneSlabTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/StoneSlabTileItem.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.item.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.h" #include "StoneSlabTileItem.h" -#include "../../Util/AABB.h" +#include "../phys/AABB.h" StoneSlabTileItem::StoneSlabTileItem(int id, HalfSlabTile* halfTile, HalfSlabTile* fullTile, bool full) diff --git a/Minecraft.World/Items/TileItems/StoneSlabTileItem.h b/Minecraft.World/net/minecraft/world/item/StoneSlabTileItem.h similarity index 96% rename from Minecraft.World/Items/TileItems/StoneSlabTileItem.h rename to Minecraft.World/net/minecraft/world/item/StoneSlabTileItem.h index 2de07147e..e0007ffb6 100644 --- a/Minecraft.World/Items/TileItems/StoneSlabTileItem.h +++ b/Minecraft.World/net/minecraft/world/item/StoneSlabTileItem.h @@ -1,7 +1,7 @@ #pragma once #include "TileItem.h" -#include "../../Blocks/HalfSlabTile.h" +#include "../level/tile/HalfSlabTile.h" class StoneSlabTileItem : public TileItem { private: diff --git a/Minecraft.World/Items/TileItems/TileItem.cpp b/Minecraft.World/net/minecraft/world/item/TileItem.cpp similarity index 94% rename from Minecraft.World/Items/TileItems/TileItem.cpp rename to Minecraft.World/net/minecraft/world/item/TileItem.cpp index df2924593..fc53e9595 100644 --- a/Minecraft.World/Items/TileItems/TileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/TileItem.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.stats.h" +#include "../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" +#include "../net.minecraft.world.h" +#include "../../stats/net.minecraft.stats.h" #include "TileItem.h" -#include "../../Util/Facing.h" +#include "../../Facing.h" // 4J-PB - for the debug option of not removing items #include diff --git a/Minecraft.World/Items/TileItems/TileItem.h b/Minecraft.World/net/minecraft/world/item/TileItem.h similarity index 98% rename from Minecraft.World/Items/TileItems/TileItem.h rename to Minecraft.World/net/minecraft/world/item/TileItem.h index 8688f2c08..e8f4475a1 100644 --- a/Minecraft.World/Items/TileItems/TileItem.h +++ b/Minecraft.World/net/minecraft/world/item/TileItem.h @@ -1,6 +1,6 @@ #pragma once -#include "../Item.h" +#include "Item.h" class Player; class Level; diff --git a/Minecraft.World/Util/UseAnim.h b/Minecraft.World/net/minecraft/world/item/UseAnim.h similarity index 100% rename from Minecraft.World/Util/UseAnim.h rename to Minecraft.World/net/minecraft/world/item/UseAnim.h diff --git a/Minecraft.World/Items/TileItems/WaterLilyTileItem.cpp b/Minecraft.World/net/minecraft/world/item/WaterLilyTileItem.cpp similarity index 86% rename from Minecraft.World/Items/TileItems/WaterLilyTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/WaterLilyTileItem.cpp index ce6c6bd54..c59a978ef 100644 --- a/Minecraft.World/Items/TileItems/WaterLilyTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/WaterLilyTileItem.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.entity.player.h" +#include "../../../../Header Files/stdafx.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../level/net.minecraft.world.level.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "../level/material/net.minecraft.world.level.material.h" +#include "../entity/player/net.minecraft.world.entity.player.h" #include "WaterLilyTileItem.h" WaterLilyTileItem::WaterLilyTileItem(int id) : ColoredTileItem(id, false) {} diff --git a/Minecraft.World/Items/TileItems/WaterLilyTileItem.h b/Minecraft.World/net/minecraft/world/item/WaterLilyTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/WaterLilyTileItem.h rename to Minecraft.World/net/minecraft/world/item/WaterLilyTileItem.h diff --git a/Minecraft.World/Items/WeaponItem.cpp b/Minecraft.World/net/minecraft/world/item/WeaponItem.cpp similarity index 88% rename from Minecraft.World/Items/WeaponItem.cpp rename to Minecraft.World/net/minecraft/world/item/WeaponItem.cpp index d6ec87a90..041dd4b79 100644 --- a/Minecraft.World/Items/WeaponItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/WeaponItem.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.ai.attributes.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/ai/attributes/net.minecraft.world.entity.ai.attributes.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "../entity/monster/net.minecraft.world.entity.monster.h" +#include "../level/tile/net.minecraft.world.level.tile.h" #include "WeaponItem.h" WeaponItem::WeaponItem(int id, const Tier* tier) : Item(id), tier(tier) { diff --git a/Minecraft.World/Items/WeaponItem.h b/Minecraft.World/net/minecraft/world/item/WeaponItem.h similarity index 100% rename from Minecraft.World/Items/WeaponItem.h rename to Minecraft.World/net/minecraft/world/item/WeaponItem.h diff --git a/Minecraft.World/Items/TileItems/WoolTileItem.cpp b/Minecraft.World/net/minecraft/world/item/WoolTileItem.cpp similarity index 96% rename from Minecraft.World/Items/TileItems/WoolTileItem.cpp rename to Minecraft.World/net/minecraft/world/item/WoolTileItem.cpp index 7f7f6ec05..aa4a54cfa 100644 --- a/Minecraft.World/Items/TileItems/WoolTileItem.cpp +++ b/Minecraft.World/net/minecraft/world/item/WoolTileItem.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../ItemInstance.h" -#include "../DyePowderItem.h" +#include "../../../../Header Files/stdafx.h" +#include "../level/tile/net.minecraft.world.level.tile.h" +#include "ItemInstance.h" +#include "DyePowderItem.h" #include "WoolTileItem.h" const unsigned int WoolTileItem::COLOR_DESCS[] = { diff --git a/Minecraft.World/Items/TileItems/WoolTileItem.h b/Minecraft.World/net/minecraft/world/item/WoolTileItem.h similarity index 100% rename from Minecraft.World/Items/TileItems/WoolTileItem.h rename to Minecraft.World/net/minecraft/world/item/WoolTileItem.h diff --git a/Minecraft.World/Items/WrittenBookItem.h b/Minecraft.World/net/minecraft/world/item/WrittenBookItem.h similarity index 100% rename from Minecraft.World/Items/WrittenBookItem.h rename to Minecraft.World/net/minecraft/world/item/WrittenBookItem.h diff --git a/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp b/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp similarity index 99% rename from Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp rename to Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp index 9768fc063..433026aa7 100644 --- a/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp +++ b/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Util/JavaMath.h" -#include "../../Util/SharedConstants.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../effect/net.minecraft.world.effect.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../SharedConstants.h" #include "PotionBrewing.h" const int PotionBrewing::DEFAULT_APPEARANCES[] = { diff --git a/Minecraft.World/Blocks/TileEntities/PotionBrewing.h b/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/PotionBrewing.h rename to Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.h diff --git a/Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h b/Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h new file mode 100644 index 000000000..fe69821fb --- /dev/null +++ b/Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h @@ -0,0 +1,3 @@ +#pragma once + +#include "PotionBrewing.h" \ No newline at end of file diff --git a/Minecraft.World/Recipes/ArmorDyeRecipe.cpp b/Minecraft.World/net/minecraft/world/item/crafting/ArmorDyeRecipe.cpp similarity index 95% rename from Minecraft.World/Recipes/ArmorDyeRecipe.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/ArmorDyeRecipe.cpp index ebf83a363..0fab702b5 100644 --- a/Minecraft.World/Recipes/ArmorDyeRecipe.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/ArmorDyeRecipe.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.item.h" +#include "net.minecraft.world.item.crafting.h" #include "ArmorDyeRecipe.h" bool ArmorDyeRecipe::matches(std::shared_ptr craftSlots, diff --git a/Minecraft.World/Recipes/ArmorDyeRecipe.h b/Minecraft.World/net/minecraft/world/item/crafting/ArmorDyeRecipe.h similarity index 100% rename from Minecraft.World/Recipes/ArmorDyeRecipe.h rename to Minecraft.World/net/minecraft/world/item/crafting/ArmorDyeRecipe.h diff --git a/Minecraft.World/Recipes/ArmorRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/ArmorRecipes.cpp similarity index 97% rename from Minecraft.World/Recipes/ArmorRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/ArmorRecipes.cpp index 20a1b3c9f..32c0efb1c 100644 --- a/Minecraft.World/Recipes/ArmorRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/ArmorRecipes.cpp @@ -2,9 +2,9 @@ // import net.minecraft.world.item.*; // import net.minecraft.world.level.tile.Tile; -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "ArmorRecipes.h" diff --git a/Minecraft.World/Recipes/ArmorRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/ArmorRecipes.h similarity index 100% rename from Minecraft.World/Recipes/ArmorRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/ArmorRecipes.h diff --git a/Minecraft.World/Recipes/ClothDyeRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/ClothDyeRecipes.cpp similarity index 96% rename from Minecraft.World/Recipes/ClothDyeRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/ClothDyeRecipes.cpp index 26a382df9..52026e0bf 100644 --- a/Minecraft.World/Recipes/ClothDyeRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/ClothDyeRecipes.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" #include "Recipy.h" #include "Recipes.h" #include "ClothDyeRecipes.h" diff --git a/Minecraft.World/Recipes/ClothDyeRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/ClothDyeRecipes.h similarity index 100% rename from Minecraft.World/Recipes/ClothDyeRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/ClothDyeRecipes.h diff --git a/Minecraft.World/Recipes/FireworksRecipe.cpp b/Minecraft.World/net/minecraft/world/item/crafting/FireworksRecipe.cpp similarity index 99% rename from Minecraft.World/Recipes/FireworksRecipe.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/FireworksRecipe.cpp index f546810ef..49100e9dd 100644 --- a/Minecraft.World/Recipes/FireworksRecipe.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/FireworksRecipe.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" #include "FireworksRecipe.h" thread_local FireworksRecipe::ThreadStorage* FireworksRecipe::m_tlsStorage = diff --git a/Minecraft.World/Recipes/FireworksRecipe.h b/Minecraft.World/net/minecraft/world/item/crafting/FireworksRecipe.h similarity index 100% rename from Minecraft.World/Recipes/FireworksRecipe.h rename to Minecraft.World/net/minecraft/world/item/crafting/FireworksRecipe.h diff --git a/Minecraft.World/Recipes/FoodRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/FoodRecipes.cpp similarity index 95% rename from Minecraft.World/Recipes/FoodRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/FoodRecipes.cpp index f40ecaf16..501bd5434 100644 --- a/Minecraft.World/Recipes/FoodRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/FoodRecipes.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Items/DyePowderItem.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../DyePowderItem.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "FoodRecipes.h" diff --git a/Minecraft.World/Recipes/FoodRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/FoodRecipes.h similarity index 100% rename from Minecraft.World/Recipes/FoodRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/FoodRecipes.h diff --git a/Minecraft.World/Recipes/FurnaceRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/FurnaceRecipes.cpp similarity index 96% rename from Minecraft.World/Recipes/FurnaceRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/FurnaceRecipes.cpp index df477fb49..21e368842 100644 --- a/Minecraft.World/Recipes/FurnaceRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/FurnaceRecipes.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../level/tile/Tile.h" #include "FurnaceRecipes.h" FurnaceRecipes* FurnaceRecipes::instance = nullptr; diff --git a/Minecraft.World/Recipes/FurnaceRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/FurnaceRecipes.h similarity index 100% rename from Minecraft.World/Recipes/FurnaceRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/FurnaceRecipes.h diff --git a/Minecraft.World/Recipes/MapCloningRecipe.h b/Minecraft.World/net/minecraft/world/item/crafting/MapCloningRecipe.h similarity index 100% rename from Minecraft.World/Recipes/MapCloningRecipe.h rename to Minecraft.World/net/minecraft/world/item/crafting/MapCloningRecipe.h diff --git a/Minecraft.World/Recipes/MapExtendingRecipe.h b/Minecraft.World/net/minecraft/world/item/crafting/MapExtendingRecipe.h similarity index 100% rename from Minecraft.World/Recipes/MapExtendingRecipe.h rename to Minecraft.World/net/minecraft/world/item/crafting/MapExtendingRecipe.h diff --git a/Minecraft.World/Recipes/OreRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/OreRecipes.cpp similarity index 91% rename from Minecraft.World/Recipes/OreRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/OreRecipes.cpp index f5adc8a4d..67d2f1fdd 100644 --- a/Minecraft.World/Recipes/OreRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/OreRecipes.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Items/DyePowderItem.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../DyePowderItem.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "OreRecipes.h" diff --git a/Minecraft.World/Recipes/OreRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/OreRecipes.h similarity index 100% rename from Minecraft.World/Recipes/OreRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/OreRecipes.h diff --git a/Minecraft.World/Recipes/Recipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp similarity index 99% rename from Minecraft.World/Recipes/Recipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp index 8c683a85b..bd84abde0 100644 --- a/Minecraft.World/Recipes/Recipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Containers/Container.h" -#include "../Containers/AbstractContainerMenu.h" -#include "../Containers/CraftingContainer.h" -#include "../Items/CoalItem.h" -#include "../Items/Item.h" -#include "../Items/ItemInstance.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.crafting.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../Container.h" +#include "../../inventory/AbstractContainerMenu.h" +#include "../../inventory/CraftingContainer.h" +#include "../CoalItem.h" +#include "../Item.h" +#include "../ItemInstance.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.crafting.h" Recipes* Recipes::instance = nullptr; ArmorRecipes* Recipes::pArmorRecipes = nullptr; diff --git a/Minecraft.World/Recipes/Recipes.h b/Minecraft.World/net/minecraft/world/item/crafting/Recipes.h similarity index 100% rename from Minecraft.World/Recipes/Recipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/Recipes.h diff --git a/Minecraft.World/Recipes/Recipy.h b/Minecraft.World/net/minecraft/world/item/crafting/Recipy.h similarity index 97% rename from Minecraft.World/Recipes/Recipy.h rename to Minecraft.World/net/minecraft/world/item/crafting/Recipy.h index fded84c19..62df868ff 100644 --- a/Minecraft.World/Recipes/Recipy.h +++ b/Minecraft.World/net/minecraft/world/item/crafting/Recipy.h @@ -5,7 +5,7 @@ #pragma once -#include "../Containers/CraftingContainer.h" +#include "../../inventory/CraftingContainer.h" #define RECIPE_TYPE_2x2 0 #define RECIPE_TYPE_3x3 1 diff --git a/Minecraft.World/Recipes/ShapedRecipy.cpp b/Minecraft.World/net/minecraft/world/item/crafting/ShapedRecipy.cpp similarity index 97% rename from Minecraft.World/Recipes/ShapedRecipy.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/ShapedRecipy.cpp index e5b1ea0f0..9e24b3ee5 100644 --- a/Minecraft.World/Recipes/ShapedRecipy.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/ShapedRecipy.cpp @@ -3,10 +3,10 @@ // import net.minecraft.world.inventory.CraftingContainer; // import net.minecraft.world.item.ItemInstance; -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "ShapedRecipy.h" diff --git a/Minecraft.World/Recipes/ShapedRecipy.h b/Minecraft.World/net/minecraft/world/item/crafting/ShapedRecipy.h similarity index 100% rename from Minecraft.World/Recipes/ShapedRecipy.h rename to Minecraft.World/net/minecraft/world/item/crafting/ShapedRecipy.h diff --git a/Minecraft.World/Recipes/ShapelessRecipy.cpp b/Minecraft.World/net/minecraft/world/item/crafting/ShapelessRecipy.cpp similarity index 96% rename from Minecraft.World/Recipes/ShapelessRecipy.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/ShapelessRecipy.cpp index 7bffab698..d1cec39d1 100644 --- a/Minecraft.World/Recipes/ShapelessRecipy.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/ShapelessRecipy.cpp @@ -4,10 +4,10 @@ // // import net.minecraft.world.inventory.CraftingContainer; // import net.minecraft.world.item.ItemInstance; -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "ShapelessRecipy.h" diff --git a/Minecraft.World/Recipes/ShapelessRecipy.h b/Minecraft.World/net/minecraft/world/item/crafting/ShapelessRecipy.h similarity index 100% rename from Minecraft.World/Recipes/ShapelessRecipy.h rename to Minecraft.World/net/minecraft/world/item/crafting/ShapelessRecipy.h diff --git a/Minecraft.World/Recipes/StructureRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/StructureRecipes.cpp similarity index 96% rename from Minecraft.World/Recipes/StructureRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/StructureRecipes.cpp index 25f011866..7adb5cc68 100644 --- a/Minecraft.World/Recipes/StructureRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/StructureRecipes.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../level/tile/net.minecraft.world.level.tile.h" #include "Recipy.h" #include "Recipes.h" #include "StructureRecipes.h" diff --git a/Minecraft.World/Recipes/StructureRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/StructureRecipes.h similarity index 100% rename from Minecraft.World/Recipes/StructureRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/StructureRecipes.h diff --git a/Minecraft.World/Recipes/ToolRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/ToolRecipes.cpp similarity index 95% rename from Minecraft.World/Recipes/ToolRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/ToolRecipes.cpp index c782e0e45..b3b03b49b 100644 --- a/Minecraft.World/Recipes/ToolRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/ToolRecipes.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Blocks/Tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "ToolRecipes.h" diff --git a/Minecraft.World/Recipes/ToolRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/ToolRecipes.h similarity index 100% rename from Minecraft.World/Recipes/ToolRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/ToolRecipes.h diff --git a/Minecraft.World/Recipes/WeaponRecipes.cpp b/Minecraft.World/net/minecraft/world/item/crafting/WeaponRecipes.cpp similarity index 95% rename from Minecraft.World/Recipes/WeaponRecipes.cpp rename to Minecraft.World/net/minecraft/world/item/crafting/WeaponRecipes.cpp index a37f4ca90..e4a6a9161 100644 --- a/Minecraft.World/Recipes/WeaponRecipes.cpp +++ b/Minecraft.World/net/minecraft/world/item/crafting/WeaponRecipes.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Blocks/Tile.h" +#include "../net.minecraft.world.item.h" +#include "../../level/tile/Tile.h" #include "Recipy.h" #include "Recipes.h" #include "WeaponRecipes.h" diff --git a/Minecraft.World/Recipes/WeaponRecipes.h b/Minecraft.World/net/minecraft/world/item/crafting/WeaponRecipes.h similarity index 100% rename from Minecraft.World/Recipes/WeaponRecipes.h rename to Minecraft.World/net/minecraft/world/item/crafting/WeaponRecipes.h diff --git a/Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h b/Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h new file mode 100644 index 000000000..7224068c7 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Recipes.h" +#include "Recipy.h" +#include "ArmorDyeRecipe.h" +#include "ArmorRecipes.h" +#include "ClothDyeRecipes.h" +#include "FoodRecipes.h" +#include "FireworksRecipe.h" +#include "FurnaceRecipes.h" +#include "OreRecipes.h" +#include "ShapedRecipy.h" +#include "ShapelessRecipy.h" +#include "StructureRecipes.h" +#include "ToolRecipes.h" +#include "WeaponRecipes.h" \ No newline at end of file diff --git a/Minecraft.World/Enchantments/ArrowDamageEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowDamageEnchantment.cpp similarity index 90% rename from Minecraft.World/Enchantments/ArrowDamageEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowDamageEnchantment.cpp index cde223b65..72592608a 100644 --- a/Minecraft.World/Enchantments/ArrowDamageEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowDamageEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ArrowDamageEnchantment.h" ArrowDamageEnchantment::ArrowDamageEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/ArrowDamageEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowDamageEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/ArrowDamageEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowDamageEnchantment.h diff --git a/Minecraft.World/Enchantments/ArrowFireEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowFireEnchantment.cpp similarity index 89% rename from Minecraft.World/Enchantments/ArrowFireEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowFireEnchantment.cpp index d0e1208d7..a13ea670e 100644 --- a/Minecraft.World/Enchantments/ArrowFireEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowFireEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ArrowFireEnchantment.h" ArrowFireEnchantment::ArrowFireEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/ArrowFireEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowFireEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/ArrowFireEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowFireEnchantment.h diff --git a/Minecraft.World/Enchantments/ArrowInfiniteEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.cpp similarity index 89% rename from Minecraft.World/Enchantments/ArrowInfiniteEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.cpp index 29de1659a..3fecad4b9 100644 --- a/Minecraft.World/Enchantments/ArrowInfiniteEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ArrowInfiniteEnchantment.h" ArrowInfiniteEnchantment::ArrowInfiniteEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/ArrowInfiniteEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/ArrowInfiniteEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.h diff --git a/Minecraft.World/Enchantments/ArrowKnockbackEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowKnockbackEnchantment.cpp similarity index 90% rename from Minecraft.World/Enchantments/ArrowKnockbackEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowKnockbackEnchantment.cpp index a5d6cfcd9..adda48731 100644 --- a/Minecraft.World/Enchantments/ArrowKnockbackEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowKnockbackEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ArrowKnockbackEnchantment.h" ArrowKnockbackEnchantment::ArrowKnockbackEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/ArrowKnockbackEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/ArrowKnockbackEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/ArrowKnockbackEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/ArrowKnockbackEnchantment.h diff --git a/Minecraft.World/Enchantments/DamageEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/DamageEnchantment.cpp similarity index 92% rename from Minecraft.World/Enchantments/DamageEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/DamageEnchantment.cpp index 782e7f718..d7ef4e7e2 100644 --- a/Minecraft.World/Enchantments/DamageEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/DamageEnchantment.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../net.minecraft.world.item.h" #include "DamageEnchantment.h" const int DamageEnchantment::names[] = {IDS_ENCHANTMENT_DAMAGE_ALL, diff --git a/Minecraft.World/Enchantments/DamageEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/DamageEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/DamageEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/DamageEnchantment.h diff --git a/Minecraft.World/Enchantments/DigDurabilityEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/DigDurabilityEnchantment.cpp similarity index 91% rename from Minecraft.World/Enchantments/DigDurabilityEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/DigDurabilityEnchantment.cpp index 89bf00c5a..197bd2552 100644 --- a/Minecraft.World/Enchantments/DigDurabilityEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/DigDurabilityEnchantment.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" #include "DigDurabilityEnchantment.h" DigDurabilityEnchantment::DigDurabilityEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/DigDurabilityEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/DigDurabilityEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/DigDurabilityEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/DigDurabilityEnchantment.h diff --git a/Minecraft.World/Enchantments/DiggingEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/DiggingEnchantment.cpp similarity index 87% rename from Minecraft.World/Enchantments/DiggingEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/DiggingEnchantment.cpp index dca6f603f..36833fdab 100644 --- a/Minecraft.World/Enchantments/DiggingEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/DiggingEnchantment.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" #include "DiggingEnchantment.h" DiggingEnchantment::DiggingEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/DiggingEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/DiggingEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/DiggingEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/DiggingEnchantment.h diff --git a/Minecraft.World/Enchantments/Enchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/Enchantment.cpp similarity index 97% rename from Minecraft.World/Enchantments/Enchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/Enchantment.cpp index eb7be03a7..d7776062c 100644 --- a/Minecraft.World/Enchantments/Enchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/Enchantment.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.enchantment.h" +#include "../net.minecraft.world.item.h" #include "Enchantment.h" // Enchantment *Enchantment::enchantments[256]; diff --git a/Minecraft.World/Enchantments/Enchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/Enchantment.h similarity index 100% rename from Minecraft.World/Enchantments/Enchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/Enchantment.h diff --git a/Minecraft.World/Enchantments/EnchantmentCategory.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentCategory.cpp similarity index 94% rename from Minecraft.World/Enchantments/EnchantmentCategory.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentCategory.cpp index 90fd58a42..d81844c17 100644 --- a/Minecraft.World/Enchantments/EnchantmentCategory.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentCategory.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" #include "EnchantmentCategory.h" const EnchantmentCategory* EnchantmentCategory::all = new EnchantmentCategory(); diff --git a/Minecraft.World/Enchantments/EnchantmentCategory.h b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentCategory.h similarity index 100% rename from Minecraft.World/Enchantments/EnchantmentCategory.h rename to Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentCategory.h diff --git a/Minecraft.World/Enchantments/EnchantmentHelper.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp similarity index 97% rename from Minecraft.World/Enchantments/EnchantmentHelper.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp index 80e20b8cb..e7a75f8d9 100644 --- a/Minecraft.World/Enchantments/EnchantmentHelper.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Util/WeighedRandom.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "net.minecraft.world.item.enchantment.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../util/WeighedRandom.h" #include "EnchantmentHelper.h" Random EnchantmentHelper::random; diff --git a/Minecraft.World/Enchantments/EnchantmentHelper.h b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.h similarity index 100% rename from Minecraft.World/Enchantments/EnchantmentHelper.h rename to Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.h diff --git a/Minecraft.World/Enchantments/EnchantmentInstance.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentInstance.cpp similarity index 85% rename from Minecraft.World/Enchantments/EnchantmentInstance.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentInstance.cpp index 8538ec437..fdae7e150 100644 --- a/Minecraft.World/Enchantments/EnchantmentInstance.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentInstance.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.enchantment.h" #include "EnchantmentInstance.h" EnchantmentInstance::EnchantmentInstance(Enchantment* enchantment, int level) diff --git a/Minecraft.World/Enchantments/EnchantmentInstance.h b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentInstance.h similarity index 87% rename from Minecraft.World/Enchantments/EnchantmentInstance.h rename to Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentInstance.h index 4a62e764d..344a048cb 100644 --- a/Minecraft.World/Enchantments/EnchantmentInstance.h +++ b/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentInstance.h @@ -1,6 +1,6 @@ #pragma once -#include "../Util/WeighedRandom.h" +#include "../../../util/WeighedRandom.h" class EnchantmentInstance : public WeighedRandomItem { public: diff --git a/Minecraft.World/Enchantments/FireAspectEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/FireAspectEnchantment.cpp similarity index 90% rename from Minecraft.World/Enchantments/FireAspectEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/FireAspectEnchantment.cpp index d5bd5ef38..dcfc2a4b7 100644 --- a/Minecraft.World/Enchantments/FireAspectEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/FireAspectEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "FireAspectEnchantment.h" FireAspectEnchantment::FireAspectEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/FireAspectEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/FireAspectEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/FireAspectEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/FireAspectEnchantment.h diff --git a/Minecraft.World/Enchantments/KnockbackEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/KnockbackEnchantment.cpp similarity index 90% rename from Minecraft.World/Enchantments/KnockbackEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/KnockbackEnchantment.cpp index f7fca6bdd..7d5eb9ce8 100644 --- a/Minecraft.World/Enchantments/KnockbackEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/KnockbackEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "KnockbackEnchantment.h" KnockbackEnchantment::KnockbackEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/KnockbackEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/KnockbackEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/KnockbackEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/KnockbackEnchantment.h diff --git a/Minecraft.World/Enchantments/LootBonusEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/LootBonusEnchantment.cpp similarity index 94% rename from Minecraft.World/Enchantments/LootBonusEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/LootBonusEnchantment.cpp index 94ecde5e9..d9c788392 100644 --- a/Minecraft.World/Enchantments/LootBonusEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/LootBonusEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "LootBonusEnchantment.h" LootBonusEnchantment::LootBonusEnchantment(int id, int frequency, diff --git a/Minecraft.World/Enchantments/LootBonusEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/LootBonusEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/LootBonusEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/LootBonusEnchantment.h diff --git a/Minecraft.World/Enchantments/OxygenEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/OxygenEnchantment.cpp similarity index 89% rename from Minecraft.World/Enchantments/OxygenEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/OxygenEnchantment.cpp index 37df5c48d..764576d89 100644 --- a/Minecraft.World/Enchantments/OxygenEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/OxygenEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "OxygenEnchantment.h" OxygenEnchantment::OxygenEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/OxygenEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/OxygenEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/OxygenEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/OxygenEnchantment.h diff --git a/Minecraft.World/Enchantments/ProtectionEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/ProtectionEnchantment.cpp similarity index 92% rename from Minecraft.World/Enchantments/ProtectionEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/ProtectionEnchantment.cpp index 12b0042f1..e3f0a58f6 100644 --- a/Minecraft.World/Enchantments/ProtectionEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/ProtectionEnchantment.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "net.minecraft.world.item.enchantment.h" +#include "../../entity/net.minecraft.world.entity.h" #include "ProtectionEnchantment.h" const int ProtectionEnchantment::names[] = { diff --git a/Minecraft.World/Enchantments/ProtectionEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/ProtectionEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/ProtectionEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/ProtectionEnchantment.h diff --git a/Minecraft.World/Enchantments/ThornsEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/ThornsEnchantment.cpp similarity index 86% rename from Minecraft.World/Enchantments/ThornsEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/ThornsEnchantment.cpp index 30842b5b8..9938307e6 100644 --- a/Minecraft.World/Enchantments/ThornsEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/ThornsEnchantment.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.damagesource.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" +#include "net.minecraft.world.item.enchantment.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" #include "ThornsEnchantment.h" const float ThornsEnchantment::CHANCE_PER_LEVEl = 0.15f; diff --git a/Minecraft.World/Enchantments/ThornsEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/ThornsEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/ThornsEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/ThornsEnchantment.h diff --git a/Minecraft.World/Enchantments/UntouchingEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/UntouchingEnchantment.cpp similarity index 89% rename from Minecraft.World/Enchantments/UntouchingEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/UntouchingEnchantment.cpp index c9041227c..27a1e5754 100644 --- a/Minecraft.World/Enchantments/UntouchingEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/UntouchingEnchantment.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.item.h" #include "UntouchingEnchantment.h" UntouchingEnchantment::UntouchingEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/UntouchingEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/UntouchingEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/UntouchingEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/UntouchingEnchantment.h diff --git a/Minecraft.World/Enchantments/WaterWorkerEnchantment.cpp b/Minecraft.World/net/minecraft/world/item/enchantment/WaterWorkerEnchantment.cpp similarity index 90% rename from Minecraft.World/Enchantments/WaterWorkerEnchantment.cpp rename to Minecraft.World/net/minecraft/world/item/enchantment/WaterWorkerEnchantment.cpp index 3b497f137..6144308a5 100644 --- a/Minecraft.World/Enchantments/WaterWorkerEnchantment.cpp +++ b/Minecraft.World/net/minecraft/world/item/enchantment/WaterWorkerEnchantment.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "WaterWorkerEnchantment.h" WaterWorkerEnchantment::WaterWorkerEnchantment(int id, int frequency) diff --git a/Minecraft.World/Enchantments/WaterWorkerEnchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/WaterWorkerEnchantment.h similarity index 100% rename from Minecraft.World/Enchantments/WaterWorkerEnchantment.h rename to Minecraft.World/net/minecraft/world/item/enchantment/WaterWorkerEnchantment.h diff --git a/Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h b/Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h new file mode 100644 index 000000000..c0df52265 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h @@ -0,0 +1,24 @@ +#pragma once + +#include "DamageEnchantment.h" +#include "DigDurabilityEnchantment.h" +#include "DiggingEnchantment.h" +#include "Enchantment.h" +#include "EnchantmentCategory.h" +#include "EnchantmentHelper.h" +#include "EnchantmentInstance.h" +#include "FireAspectEnchantment.h" +#include "KnockbackEnchantment.h" +#include "LootBonusEnchantment.h" +#include "OxygenEnchantment.h" +#include "ProtectionEnchantment.h" +#include "UntouchingEnchantment.h" +#include "WaterWorkerEnchantment.h" + +// 4J Stu - Brought forward +#include "ArrowDamageEnchantment.h" +#include "ArrowFireEnchantment.h" +#include "ArrowInfiniteEnchantment.h" +#include "ArrowKnockbackEnchantment.h" + +#include "ThornsEnchantment.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h b/Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h new file mode 100644 index 000000000..393c6ae1f --- /dev/null +++ b/Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h @@ -0,0 +1,87 @@ +#pragma once + +#include "ArmorItem.h" +#include "BedItem.h" +#include "BoatItem.h" +#include "BowItem.h" +#include "BowlFoodItem.h" +#include "BucketItem.h" +#include "WoolTileItem.h" +#include "CoalItem.h" +#include "ComplexItem.h" +#include "DiggerItem.h" +#include "DoorItem.h" +#include "DyePowderItem.h" +#include "EggItem.h" +#include "FishingRodItem.h" +#include "FlintAndSteelItem.h" +#include "FoodItem.h" +#include "HatchetItem.h" +#include "HoeItem.h" +#include "Item.h" +#include "ItemInstance.h" +#include "LeafTileItem.h" +#include "MapItem.h" +#include "MinecartItem.h" +// #include "PaintingItem.h" +#include "PickaxeItem.h" +#include "PistonTileItem.h" +#include "RecordingItem.h" +#include "RedStoneItem.h" +#include "SaddleItem.h" +#include "SaplingTileItem.h" +#include "SeedItem.h" +#include "ShearsItem.h" +#include "ShovelItem.h" +#include "SignItem.h" +#include "SnowballItem.h" +#include "StoneSlabTileItem.h" +#include "TileItem.h" +#include "PlanterTileItem.h" +#include "WeaponItem.h" + +// 1.8.2 +#include "AuxDataTileItem.h" +#include "ColoredTileItem.h" +#include "UseAnim.h" + +// 1.0.1 +#include "BottleItem.h" +#include "EnderEyeItem.h" +#include "EnderpearlItem.h" +#include "GoldenAppleItem.h" +#include "MilkBucketItem.h" +#include "PotionItem.h" +#include "Rarity.h" +#include "WaterLilyTileItem.h" +#include "ExperienceItem.h" // 4J Stu brought forward + +// TU9 +#include "FireChargeItem.h" +#include "../entity/ItemFrame.h" +#include "SpawnEggItem.h" +#include "MultiTextureTileItem.h" + +// TU12 +#include "SkullItem.h" + +// TU14 +#include "AnvilTileItem.h" +#include "BookItem.h" +#include "CarrotOnAStickItem.h" +#include "EnchantedBookItem.h" +#include "SeedFoodItem.h" + +// 1.6.4 +#include "FireworksChargeItem.h" +#include "FireworksItem.h" +#include "LeashItem.h" +#include "NameTagItem.h" +#include "SimpleFoiledItem.h" +#include "SnowItem.h" +#include "EmptyMapItem.h" + +// 4J Added +#include "ClockItem.h" +#include "CompassItem.h" +#include "../../util/HtmlString.h" \ No newline at end of file diff --git a/Minecraft.World/Containers/Merchant.h b/Minecraft.World/net/minecraft/world/item/trading/Merchant.h similarity index 100% rename from Minecraft.World/Containers/Merchant.h rename to Minecraft.World/net/minecraft/world/item/trading/Merchant.h diff --git a/Minecraft.World/Containers/MerchantRecipe.cpp b/Minecraft.World/net/minecraft/world/item/trading/MerchantRecipe.cpp similarity index 98% rename from Minecraft.World/Containers/MerchantRecipe.cpp rename to Minecraft.World/net/minecraft/world/item/trading/MerchantRecipe.cpp index ace323517..3a6ca5320 100644 --- a/Minecraft.World/Containers/MerchantRecipe.cpp +++ b/Minecraft.World/net/minecraft/world/item/trading/MerchantRecipe.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "MerchantRecipe.h" diff --git a/Minecraft.World/Containers/MerchantRecipe.h b/Minecraft.World/net/minecraft/world/item/trading/MerchantRecipe.h similarity index 100% rename from Minecraft.World/Containers/MerchantRecipe.h rename to Minecraft.World/net/minecraft/world/item/trading/MerchantRecipe.h diff --git a/Minecraft.World/Containers/MerchantRecipeList.cpp b/Minecraft.World/net/minecraft/world/item/trading/MerchantRecipeList.cpp similarity index 98% rename from Minecraft.World/Containers/MerchantRecipeList.cpp rename to Minecraft.World/net/minecraft/world/item/trading/MerchantRecipeList.cpp index f1dc83185..5e4464397 100644 --- a/Minecraft.World/Containers/MerchantRecipeList.cpp +++ b/Minecraft.World/net/minecraft/world/item/trading/MerchantRecipeList.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.trading.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.item.trading.h" #include "MerchantRecipeList.h" MerchantRecipeList::MerchantRecipeList() {} diff --git a/Minecraft.World/Containers/MerchantRecipeList.h b/Minecraft.World/net/minecraft/world/item/trading/MerchantRecipeList.h similarity index 100% rename from Minecraft.World/Containers/MerchantRecipeList.h rename to Minecraft.World/net/minecraft/world/item/trading/MerchantRecipeList.h diff --git a/Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h b/Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h new file mode 100644 index 000000000..a705a1c07 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h @@ -0,0 +1,5 @@ +#pragma once + +#include "Merchant.h" +#include "MerchantRecipe.h" +#include "MerchantRecipeList.h" \ No newline at end of file diff --git a/Minecraft.World/Level/BaseMobSpawner.cpp b/Minecraft.World/net/minecraft/world/level/BaseMobSpawner.cpp similarity index 97% rename from Minecraft.World/Level/BaseMobSpawner.cpp rename to Minecraft.World/net/minecraft/world/level/BaseMobSpawner.cpp index e85d3f7ae..1ebdb0348 100644 --- a/Minecraft.World/Level/BaseMobSpawner.cpp +++ b/Minecraft.World/net/minecraft/world/level/BaseMobSpawner.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "net.minecraft.world.level.h" +#include "tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" #include "BaseMobSpawner.h" BaseMobSpawner::BaseMobSpawner() { diff --git a/Minecraft.World/Level/BaseMobSpawner.h b/Minecraft.World/net/minecraft/world/level/BaseMobSpawner.h similarity index 97% rename from Minecraft.World/Level/BaseMobSpawner.h rename to Minecraft.World/net/minecraft/world/level/BaseMobSpawner.h index 0933908b1..85fa2ff74 100644 --- a/Minecraft.World/Level/BaseMobSpawner.h +++ b/Minecraft.World/net/minecraft/world/level/BaseMobSpawner.h @@ -1,6 +1,6 @@ #pragma once -#include "../Util/WeighedRandom.h" +#include "../../util/WeighedRandom.h" class BaseMobSpawner { public: diff --git a/Minecraft.World/Level/BlockDestructionProgress.cpp b/Minecraft.World/net/minecraft/world/level/BlockDestructionProgress.cpp similarity index 95% rename from Minecraft.World/Level/BlockDestructionProgress.cpp rename to Minecraft.World/net/minecraft/world/level/BlockDestructionProgress.cpp index c56a4de29..d8d34c873 100644 --- a/Minecraft.World/Level/BlockDestructionProgress.cpp +++ b/Minecraft.World/net/minecraft/world/level/BlockDestructionProgress.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "BlockDestructionProgress.h" BlockDestructionProgress::BlockDestructionProgress(int id, int x, int y, diff --git a/Minecraft.World/Level/BlockDestructionProgress.h b/Minecraft.World/net/minecraft/world/level/BlockDestructionProgress.h similarity index 100% rename from Minecraft.World/Level/BlockDestructionProgress.h rename to Minecraft.World/net/minecraft/world/level/BlockDestructionProgress.h diff --git a/Minecraft.World/Level/Calendar.cpp b/Minecraft.World/net/minecraft/world/level/Calendar.cpp similarity index 86% rename from Minecraft.World/Level/Calendar.cpp rename to Minecraft.World/net/minecraft/world/level/Calendar.cpp index b978fee26..08a41a608 100644 --- a/Minecraft.World/Level/Calendar.cpp +++ b/Minecraft.World/net/minecraft/world/level/Calendar.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "Calendar.h" #include diff --git a/Minecraft.World/Level/Calendar.h b/Minecraft.World/net/minecraft/world/level/Calendar.h similarity index 100% rename from Minecraft.World/Level/Calendar.h rename to Minecraft.World/net/minecraft/world/level/Calendar.h diff --git a/Minecraft.World/Level/ChunkPos.cpp b/Minecraft.World/net/minecraft/world/level/ChunkPos.cpp similarity index 93% rename from Minecraft.World/Level/ChunkPos.cpp rename to Minecraft.World/net/minecraft/world/level/ChunkPos.cpp index bf479e109..dd452ded2 100644 --- a/Minecraft.World/Level/ChunkPos.cpp +++ b/Minecraft.World/net/minecraft/world/level/ChunkPos.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" #include "ChunkPos.h" ChunkPos::ChunkPos(int x, int z) : x(x), z(z) {} diff --git a/Minecraft.World/Level/ChunkPos.h b/Minecraft.World/net/minecraft/world/level/ChunkPos.h similarity index 100% rename from Minecraft.World/Level/ChunkPos.h rename to Minecraft.World/net/minecraft/world/level/ChunkPos.h diff --git a/Minecraft.World/Util/Coord.h b/Minecraft.World/net/minecraft/world/level/Coord.h similarity index 100% rename from Minecraft.World/Util/Coord.h rename to Minecraft.World/net/minecraft/world/level/Coord.h diff --git a/Minecraft.World/Level/Explosion.cpp b/Minecraft.World/net/minecraft/world/level/Explosion.cpp similarity index 95% rename from Minecraft.World/Level/Explosion.cpp rename to Minecraft.World/net/minecraft/world/level/Explosion.cpp index fe1ac7c03..7af5a3dbc 100644 --- a/Minecraft.World/Level/Explosion.cpp +++ b/Minecraft.World/net/minecraft/world/level/Explosion.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.damagesource.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/item/net.minecraft.world.entity.item.h" +#include "../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "net.minecraft.world.level.h" +#include "tile/net.minecraft.world.level.tile.h" +#include "../phys/net.minecraft.world.phys.h" +#include "../damageSource/net.minecraft.world.damagesource.h" #include "TilePos.h" #include "Explosion.h" -#include "../Util/SoundTypes.h" -#include "Util/AABB.h" +#include "../../../../Header Files/SoundTypes.h" +#include "../phys/AABB.h" Explosion::Explosion(Level* level, std::shared_ptr source, double x, double y, double z, float r) { diff --git a/Minecraft.World/Level/Explosion.h b/Minecraft.World/net/minecraft/world/level/Explosion.h similarity index 96% rename from Minecraft.World/Level/Explosion.h rename to Minecraft.World/net/minecraft/world/level/Explosion.h index 36ab53016..3d5d07fd7 100644 --- a/Minecraft.World/Level/Explosion.h +++ b/Minecraft.World/net/minecraft/world/level/Explosion.h @@ -1,6 +1,6 @@ #pragma once #include "TilePos.h" -#include "../Player/Player.h" +#include "../entity/player/Player.h" class Random; class Level; diff --git a/Minecraft.World/Util/FoliageColor.cpp b/Minecraft.World/net/minecraft/world/level/FoliageColor.cpp similarity index 89% rename from Minecraft.World/Util/FoliageColor.cpp rename to Minecraft.World/net/minecraft/world/level/FoliageColor.cpp index a6d328dc4..181261cb4 100644 --- a/Minecraft.World/Util/FoliageColor.cpp +++ b/Minecraft.World/net/minecraft/world/level/FoliageColor.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" #include "FoliageColor.h" // 4J Stu - Don't use this any more diff --git a/Minecraft.World/Util/FoliageColor.h b/Minecraft.World/net/minecraft/world/level/FoliageColor.h similarity index 100% rename from Minecraft.World/Util/FoliageColor.h rename to Minecraft.World/net/minecraft/world/level/FoliageColor.h diff --git a/Minecraft.World/Level/GameRules.cpp b/Minecraft.World/net/minecraft/world/level/GameRules.cpp similarity index 99% rename from Minecraft.World/Level/GameRules.cpp rename to Minecraft.World/net/minecraft/world/level/GameRules.cpp index fef5c9c6d..7c40547a2 100644 --- a/Minecraft.World/Level/GameRules.cpp +++ b/Minecraft.World/net/minecraft/world/level/GameRules.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "GameRules.h" diff --git a/Minecraft.World/Level/GameRules.h b/Minecraft.World/net/minecraft/world/level/GameRules.h similarity index 100% rename from Minecraft.World/Level/GameRules.h rename to Minecraft.World/net/minecraft/world/level/GameRules.h diff --git a/Minecraft.World/Util/GrassColor.cpp b/Minecraft.World/net/minecraft/world/level/GrassColor.cpp similarity index 91% rename from Minecraft.World/Util/GrassColor.cpp rename to Minecraft.World/net/minecraft/world/level/GrassColor.cpp index 77f75a350..2a92be999 100644 --- a/Minecraft.World/Util/GrassColor.cpp +++ b/Minecraft.World/net/minecraft/world/level/GrassColor.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "GrassColor.h" // 4J Stu - Don't want to do this any more diff --git a/Minecraft.World/Util/GrassColor.h b/Minecraft.World/net/minecraft/world/level/GrassColor.h similarity index 100% rename from Minecraft.World/Util/GrassColor.h rename to Minecraft.World/net/minecraft/world/level/GrassColor.h diff --git a/Minecraft.World/Level/Level.cpp b/Minecraft.World/net/minecraft/world/level/Level.cpp similarity index 98% rename from Minecraft.World/Level/Level.cpp rename to Minecraft.World/net/minecraft/world/level/Level.cpp index 98bf3d669..9e2cd3649 100644 --- a/Minecraft.World/Level/Level.cpp +++ b/Minecraft.World/net/minecraft/world/level/Level.cpp @@ -1,52 +1,52 @@ -#include "../Platform/stdafx.h" -#include "../Platform/System.h" -#include "../IO/Files/File.h" -#include "../Util/ProgressListener.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.entity.ai.village.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.global.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.level.chunk.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.levelgen.h" -#include "../Headers/net.minecraft.world.level.storage.h" -#include "../Headers/net.minecraft.world.level.pathfinder.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.scores.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../Header Files/stdafx.h" +#include "../../../../ConsoleJavaLibs/System.h" +#include "../../../../ConsoleJavaLibs/File.h" +#include "../../util/ProgressListener.h" +#include "../../net.minecraft.h" +#include "../net.minecraft.world.h" +#include "../entity/ai/village/net.minecraft.world.entity.ai.village.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/global/net.minecraft.world.entity.global.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "biome/net.minecraft.world.level.biome.h" +#include "chunk/net.minecraft.world.level.chunk.h" +#include "dimension/net.minecraft.world.level.dimension.h" +#include "tile/net.minecraft.world.level.tile.h" +#include "tile/entity/net.minecraft.world.level.tile.entity.h" +#include "net.minecraft.world.level.h" +#include "levelgen/net.minecraft.world.level.levelgen.h" +#include "storage/net.minecraft.world.level.storage.h" +#include "pathfinder/net.minecraft.world.level.pathfinder.h" +#include "redstone/net.minecraft.world.level.redstone.h" +#include "../scores/net.minecraft.world.scores.h" +#include "../phys/net.minecraft.world.phys.h" #include "Explosion.h" -#include "Events/LevelListener.h" +#include "LevelListener.h" #include "Level.h" -#include "../Util/ThreadName.h" -#include "../Util/WeighedRandom.h" +#include "../../../../ConsoleHelpers/ThreadName.h" +#include "../../util/WeighedRandom.h" -#include "../IO/Files/ConsoleSaveFile.h" +#include "../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h" #include #include -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Rendering/LevelRenderer.h" -#include "../Util/SoundTypes.h" -#include "Storage/SparseLightStorage.h" -#include "../../Minecraft.Client/Textures/Textures.h" -#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h" -#include "../../Minecraft.Client/Textures/Packs/DLCTexturePack.h" -#include "../../Minecraft.Client/Platform/Common/DLC/DLCPack.h" -#include "../../Minecraft.Client/Platform/Common/ShutdownManager.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Utils/FrameProfiler.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h" +#include "../../../../Header Files/SoundTypes.h" +#include "chunk/SparseLightStorage.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Textures.h" +#include "../../Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.h" +#include "../../Minecraft.Client/net/minecraft/client/skins/DLCTexturePack.h" +#include "../../Minecraft.Client/Common/Source Files/DLC/DLCPack.h" +#include "../../Minecraft.Client/Common/ShutdownManager.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/Header Files/FrameProfiler.h" #include #include #include #include // 4J : WESTY : Added for time played stats. -#include "../Headers/net.minecraft.stats.h" +#include "../../stats/net.minecraft.stats.h" // 4J - Caching of lighting data added. This is implemented as a 16x16x16 cache // of ints (ie 16K storage in total). The index of the element to be used in the diff --git a/Minecraft.World/Level/Level.h b/Minecraft.World/net/minecraft/world/level/Level.h similarity index 99% rename from Minecraft.World/Level/Level.h rename to Minecraft.World/net/minecraft/world/level/Level.h index 9503e1d2d..4d069d31b 100644 --- a/Minecraft.World/Level/Level.h +++ b/Minecraft.World/net/minecraft/world/level/Level.h @@ -1,14 +1,14 @@ #pragma once -#include "Storage/LevelSource.h" -#include "../Util/LightLayer.h" +#include "LevelSource.h" +#include "LightLayer.h" #include "ChunkPos.h" #include "TickNextTickData.h" -#include "Storage/SavedData.h" -#include "../Util/Definitions.h" -#include "../Util/ParticleTypes.h" -#include "../WorldGen/Biomes/Biome.h" -#include "../Util/C4JThread.h" +#include "saveddata/SavedData.h" +#include "../../../../ConsoleHelpers/Definitions.h" +#include "../../../../Header Files/ParticleTypes.h" +#include "biome/Biome.h" +#include "../../../../ConsoleHelpers/C4JThread.h" #include #include #include diff --git a/Minecraft.World/Level/LevelConflictException.cpp b/Minecraft.World/net/minecraft/world/level/LevelConflictException.cpp similarity index 75% rename from Minecraft.World/Level/LevelConflictException.cpp rename to Minecraft.World/net/minecraft/world/level/LevelConflictException.cpp index 18d0c1360..ab09ab12d 100644 --- a/Minecraft.World/Level/LevelConflictException.cpp +++ b/Minecraft.World/net/minecraft/world/level/LevelConflictException.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "LevelConflictException.h" LevelConflictException::LevelConflictException(const std::wstring& msg) diff --git a/Minecraft.World/Level/LevelConflictException.h b/Minecraft.World/net/minecraft/world/level/LevelConflictException.h similarity index 78% rename from Minecraft.World/Level/LevelConflictException.h rename to Minecraft.World/net/minecraft/world/level/LevelConflictException.h index f2153e2af..c063def27 100644 --- a/Minecraft.World/Level/LevelConflictException.h +++ b/Minecraft.World/net/minecraft/world/level/LevelConflictException.h @@ -1,6 +1,6 @@ #pragma once -#include "../Util/Exceptions.h" +#include "../../../../ConsoleJavaLibs/Exceptions.h" class LevelConflictException : public RuntimeException { private: diff --git a/Minecraft.World/Level/Events/LevelListener.h b/Minecraft.World/net/minecraft/world/level/LevelListener.h similarity index 96% rename from Minecraft.World/Level/Events/LevelListener.h rename to Minecraft.World/net/minecraft/world/level/LevelListener.h index bb6bd6815..c2ffca054 100644 --- a/Minecraft.World/Level/Events/LevelListener.h +++ b/Minecraft.World/net/minecraft/world/level/LevelListener.h @@ -1,8 +1,8 @@ #pragma once class TileEntity; -#include "../../Player/Player.h" -#include "../../Util/ParticleTypes.h" +#include "../entity/player/Player.h" +#include "../../../../Header Files/ParticleTypes.h" class LevelListener { public: diff --git a/Minecraft.World/Level/Storage/LevelSettings.cpp b/Minecraft.World/net/minecraft/world/level/LevelSettings.cpp similarity index 97% rename from Minecraft.World/Level/Storage/LevelSettings.cpp rename to Minecraft.World/net/minecraft/world/level/LevelSettings.cpp index cd0120eff..8fe650562 100644 --- a/Minecraft.World/Level/Storage/LevelSettings.cpp +++ b/Minecraft.World/net/minecraft/world/level/LevelSettings.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "LevelSettings.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "storage/net.minecraft.world.level.storage.h" #include "LevelType.h" GameType* GameType::NOT_SET = nullptr; diff --git a/Minecraft.World/Level/Storage/LevelSettings.h b/Minecraft.World/net/minecraft/world/level/LevelSettings.h similarity index 100% rename from Minecraft.World/Level/Storage/LevelSettings.h rename to Minecraft.World/net/minecraft/world/level/LevelSettings.h diff --git a/Minecraft.World/Level/Storage/LevelSource.h b/Minecraft.World/net/minecraft/world/level/LevelSource.h similarity index 97% rename from Minecraft.World/Level/Storage/LevelSource.h rename to Minecraft.World/net/minecraft/world/level/LevelSource.h index fd84ea9c9..ac8b144b3 100644 --- a/Minecraft.World/Level/Storage/LevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/LevelSource.h @@ -4,7 +4,7 @@ class BiomeSource; class Material; class TileEntity; -#include "../../Util/LightLayer.h" +#include "LightLayer.h" class LevelSource { public: diff --git a/Minecraft.World/Level/Storage/LevelType.cpp b/Minecraft.World/net/minecraft/world/level/LevelType.cpp similarity index 96% rename from Minecraft.World/Level/Storage/LevelType.cpp rename to Minecraft.World/net/minecraft/world/level/LevelType.cpp index ae48a2f82..46a8c7845 100644 --- a/Minecraft.World/Level/Storage/LevelType.cpp +++ b/Minecraft.World/net/minecraft/world/level/LevelType.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.h" // public static final LevelType[] levelTypes = new LevelType[16]; // diff --git a/Minecraft.World/Level/Storage/LevelType.h b/Minecraft.World/net/minecraft/world/level/LevelType.h similarity index 95% rename from Minecraft.World/Level/Storage/LevelType.h rename to Minecraft.World/net/minecraft/world/level/LevelType.h index cd83597a2..527a41489 100644 --- a/Minecraft.World/Level/Storage/LevelType.h +++ b/Minecraft.World/net/minecraft/world/level/LevelType.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Headers/net.minecraft.world.level.h" +#include "net.minecraft.world.level.h" class LevelType { public: diff --git a/Minecraft.World/Util/LightLayer.h b/Minecraft.World/net/minecraft/world/level/LightLayer.h similarity index 100% rename from Minecraft.World/Util/LightLayer.h rename to Minecraft.World/net/minecraft/world/level/LightLayer.h diff --git a/Minecraft.World/Blocks/MobSpawner.cpp b/Minecraft.World/net/minecraft/world/level/MobSpawner.cpp similarity index 95% rename from Minecraft.World/Blocks/MobSpawner.cpp rename to Minecraft.World/net/minecraft/world/level/MobSpawner.cpp index 123e88295..10f15f115 100644 --- a/Minecraft.World/Blocks/MobSpawner.cpp +++ b/Minecraft.World/net/minecraft/world/level/MobSpawner.cpp @@ -1,22 +1,22 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.level.pathfinder.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Util/Difficulty.h" -#include "../Util/WeighedRandom.h" -#include "../Level/Level.h" -#include "../Level/ChunkPos.h" -#include "../Level/TilePos.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" +#include "../../../../Header Files/stdafx.h" +#include "../../net.minecraft.h" +#include "../entity/net.minecraft.world.entity.h" +#include "../entity/animal/net.minecraft.world.entity.animal.h" +#include "../entity/monster/net.minecraft.world.entity.monster.h" +#include "../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.level.h" +#include "biome/net.minecraft.world.level.biome.h" +#include "material/net.minecraft.world.level.material.h" +#include "pathfinder/net.minecraft.world.level.pathfinder.h" +#include "tile/net.minecraft.world.level.tile.h" +#include "../Difficulty.h" +#include "../../util/WeighedRandom.h" +#include "Level.h" +#include "ChunkPos.h" +#include "TilePos.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" #include "MobSpawner.h" -#include "../Level/Dimensions/Dimension.h" +#include "dimension/Dimension.h" const int MobSpawner::MIN_SPAWN_DISTANCE = 24; diff --git a/Minecraft.World/Blocks/MobSpawner.h b/Minecraft.World/net/minecraft/world/level/MobSpawner.h similarity index 96% rename from Minecraft.World/Blocks/MobSpawner.h rename to Minecraft.World/net/minecraft/world/level/MobSpawner.h index 307f7b8c2..aae97e98b 100644 --- a/Minecraft.World/Blocks/MobSpawner.h +++ b/Minecraft.World/net/minecraft/world/level/MobSpawner.h @@ -1,6 +1,6 @@ #pragma once -#include "../Entities/Mob.h" +#include "../entity/Mob.h" class Player; class Level; diff --git a/Minecraft.World/Level/Storage/PortalForcer.cpp b/Minecraft.World/net/minecraft/world/level/PortalForcer.cpp similarity index 98% rename from Minecraft.World/Level/Storage/PortalForcer.cpp rename to Minecraft.World/net/minecraft/world/level/PortalForcer.cpp index 19e93c033..1fbe9d075 100644 --- a/Minecraft.World/Level/Storage/PortalForcer.cpp +++ b/Minecraft.World/net/minecraft/world/level/PortalForcer.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../../Minecraft.Client/Level/ServerLevel.h" +#include "../../../../Header Files/stdafx.h" +#include "../entity/net.minecraft.world.entity.h" +#include "net.minecraft.world.level.h" +#include "tile/net.minecraft.world.level.tile.h" +#include "dimension/net.minecraft.world.level.dimension.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" #include "PortalForcer.h" PortalForcer::PortalPosition::PortalPosition(int x, int y, int z, int64_t time) diff --git a/Minecraft.World/Level/Storage/PortalForcer.h b/Minecraft.World/net/minecraft/world/level/PortalForcer.h similarity index 100% rename from Minecraft.World/Level/Storage/PortalForcer.h rename to Minecraft.World/net/minecraft/world/level/PortalForcer.h diff --git a/Minecraft.World/Level/Storage/Region.cpp b/Minecraft.World/net/minecraft/world/level/Region.cpp similarity index 96% rename from Minecraft.World/Level/Storage/Region.cpp rename to Minecraft.World/net/minecraft/world/level/Region.cpp index ca1687549..9228f582d 100644 --- a/Minecraft.World/Level/Storage/Region.cpp +++ b/Minecraft.World/net/minecraft/world/level/Region.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.redstone.h" -#include "../../Blocks/Material.h" -#include "../Level.h" +#include "../../../../Header Files/stdafx.h" +#include "biome/net.minecraft.world.level.biome.h" +#include "chunk/net.minecraft.world.level.chunk.h" +#include "dimension/net.minecraft.world.level.dimension.h" +#include "tile/net.minecraft.world.level.tile.h" +#include "redstone/net.minecraft.world.level.redstone.h" +#include "material/Material.h" +#include "Level.h" #include "Region.h" diff --git a/Minecraft.World/Level/Storage/Region.h b/Minecraft.World/net/minecraft/world/level/Region.h similarity index 100% rename from Minecraft.World/Level/Storage/Region.h rename to Minecraft.World/net/minecraft/world/level/Region.h diff --git a/Minecraft.World/Level/TickNextTickData.cpp b/Minecraft.World/net/minecraft/world/level/TickNextTickData.cpp similarity index 96% rename from Minecraft.World/Level/TickNextTickData.cpp rename to Minecraft.World/net/minecraft/world/level/TickNextTickData.cpp index aa3455296..3f3cdc146 100644 --- a/Minecraft.World/Level/TickNextTickData.cpp +++ b/Minecraft.World/net/minecraft/world/level/TickNextTickData.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../Header Files/stdafx.h" +#include "tile/net.minecraft.world.level.tile.h" #include "TickNextTickData.h" int64_t TickNextTickData::C = 0; diff --git a/Minecraft.World/Level/TickNextTickData.h b/Minecraft.World/net/minecraft/world/level/TickNextTickData.h similarity index 100% rename from Minecraft.World/Level/TickNextTickData.h rename to Minecraft.World/net/minecraft/world/level/TickNextTickData.h diff --git a/Minecraft.World/Level/TileEventData.cpp b/Minecraft.World/net/minecraft/world/level/TileEventData.cpp similarity index 94% rename from Minecraft.World/Level/TileEventData.cpp rename to Minecraft.World/net/minecraft/world/level/TileEventData.cpp index c904e510c..719e631e6 100644 --- a/Minecraft.World/Level/TileEventData.cpp +++ b/Minecraft.World/net/minecraft/world/level/TileEventData.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "TileEventData.h" diff --git a/Minecraft.World/Level/TileEventData.h b/Minecraft.World/net/minecraft/world/level/TileEventData.h similarity index 100% rename from Minecraft.World/Level/TileEventData.h rename to Minecraft.World/net/minecraft/world/level/TileEventData.h diff --git a/Minecraft.World/Level/TilePos.cpp b/Minecraft.World/net/minecraft/world/level/TilePos.cpp similarity index 87% rename from Minecraft.World/Level/TilePos.cpp rename to Minecraft.World/net/minecraft/world/level/TilePos.cpp index bb83514f3..4fd621617 100644 --- a/Minecraft.World/Level/TilePos.cpp +++ b/Minecraft.World/net/minecraft/world/level/TilePos.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "TilePos.h" -#include "../Util/Vec3.h" +#include "../phys/Vec3.h" TilePos::TilePos(int x, int y, int z) { this->x = x; diff --git a/Minecraft.World/Level/TilePos.h b/Minecraft.World/net/minecraft/world/level/TilePos.h similarity index 100% rename from Minecraft.World/Level/TilePos.h rename to Minecraft.World/net/minecraft/world/level/TilePos.h diff --git a/Minecraft.World/Util/WaterColor.cpp b/Minecraft.World/net/minecraft/world/level/WaterColor.cpp similarity index 91% rename from Minecraft.World/Util/WaterColor.cpp rename to Minecraft.World/net/minecraft/world/level/WaterColor.cpp index 8399afd08..f5bfaf018 100644 --- a/Minecraft.World/Util/WaterColor.cpp +++ b/Minecraft.World/net/minecraft/world/level/WaterColor.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "WaterColor.h" diff --git a/Minecraft.World/Util/WaterColor.h b/Minecraft.World/net/minecraft/world/level/WaterColor.h similarity index 100% rename from Minecraft.World/Util/WaterColor.h rename to Minecraft.World/net/minecraft/world/level/WaterColor.h diff --git a/Minecraft.World/WorldGen/Biomes/BeachBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/BeachBiome.cpp similarity index 80% rename from Minecraft.World/WorldGen/Biomes/BeachBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/BeachBiome.cpp index cfa68b6b4..a8825977a 100644 --- a/Minecraft.World/WorldGen/Biomes/BeachBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/BeachBiome.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../tile/net.minecraft.world.level.tile.h" #include "BiomeDecorator.h" #include "BeachBiome.h" diff --git a/Minecraft.World/WorldGen/Biomes/BeachBiome.h b/Minecraft.World/net/minecraft/world/level/biome/BeachBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/BeachBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/BeachBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/Biome.cpp b/Minecraft.World/net/minecraft/world/level/biome/Biome.cpp similarity index 97% rename from Minecraft.World/WorldGen/Biomes/Biome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/Biome.cpp index 8adde11c2..04a049f5f 100644 --- a/Minecraft.World/WorldGen/Biomes/Biome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/Biome.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/Color.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/Color.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../../entity/monster/net.minecraft.world.entity.monster.h" +#include "../../entity/net.minecraft.world.entity.h" #include "Biome.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.biome.h" // public static final Biome[] biomes = new Biome[256]; Biome* Biome::biomes[256]; diff --git a/Minecraft.World/WorldGen/Biomes/Biome.h b/Minecraft.World/net/minecraft/world/level/biome/Biome.h similarity index 97% rename from Minecraft.World/WorldGen/Biomes/Biome.h rename to Minecraft.World/net/minecraft/world/level/biome/Biome.h index dd9ecd3e3..bab5cac84 100644 --- a/Minecraft.World/WorldGen/Biomes/Biome.h +++ b/Minecraft.World/net/minecraft/world/level/biome/Biome.h @@ -1,8 +1,8 @@ #pragma once -#include "../../Level/Storage/LevelSource.h" -#include "../../Entities/Mob.h" -#include "../../Util/WeighedRandom.h" +#include "../LevelSource.h" +#include "../../entity/Mob.h" +#include "../../../util/WeighedRandom.h" class Feature; class MobCategory; diff --git a/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp b/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp similarity index 97% rename from Minecraft.World/WorldGen/Biomes/BiomeCache.cpp rename to Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp index 75fc85b82..a32bbdaaa 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "Biome.h" #include "BiomeSource.h" #include "BiomeCache.h" -#include "../../Platform/System.h" +#include "../../../../../ConsoleJavaLibs/System.h" BiomeCache::Block::Block(int x, int z, BiomeCache* parent) { // temps = floatArray(ZONE_SIZE * ZONE_SIZE, false); // MGH - diff --git a/Minecraft.World/WorldGen/Biomes/BiomeCache.h b/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h similarity index 96% rename from Minecraft.World/WorldGen/Biomes/BiomeCache.h rename to Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h index 529461404..f3a2f5b4c 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeCache.h +++ b/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../Minecraft.World/Util/JavaIntHash.h" +#include "../../../../../ConsoleJavaLibs/JavaIntHash.h" class BiomeCache { private: diff --git a/Minecraft.World/WorldGen/Biomes/BiomeDecorator.cpp b/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp similarity index 97% rename from Minecraft.World/WorldGen/Biomes/BiomeDecorator.cpp rename to Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp index 27349e494..767c6aea3 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeDecorator.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "net.minecraft.world.level.biome.h" BiomeDecorator::BiomeDecorator(Biome* biome) { _init(); diff --git a/Minecraft.World/WorldGen/Biomes/BiomeDecorator.h b/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/BiomeDecorator.h rename to Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.h diff --git a/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp b/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp similarity index 97% rename from Minecraft.World/WorldGen/Biomes/BiomeSource.cpp rename to Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp index 76e896d34..dab4e2e47 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Platform/System.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../storage/net.minecraft.world.level.storage.h" +#include "net.minecraft.world.level.biome.h" +#include "../newbiome/layer/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../ConsoleJavaLibs/System.h" #include "BiomeSource.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/client/ProgressRenderer.h" // 4J - removal of separate temperature & downfall layers brought forward // from 1.2.3 diff --git a/Minecraft.World/WorldGen/Biomes/BiomeSource.h b/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h similarity index 98% rename from Minecraft.World/WorldGen/Biomes/BiomeSource.h rename to Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h index 7508c8f83..095167aca 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeSource.h +++ b/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h @@ -2,7 +2,7 @@ #include "Biome.h" #include "BiomeSource.h" #include "BiomeCache.h" -#include "../../Headers/net.minecraft.world.level.levelgen.synth.h" +#include "../levelgen/synth/net.minecraft.world.level.levelgen.synth.h" class ChunkPos; class Level; diff --git a/Minecraft.World/WorldGen/Biomes/DesertBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/DesertBiome.cpp similarity index 75% rename from Minecraft.World/WorldGen/Biomes/DesertBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/DesertBiome.cpp index e01145c8d..396eb946f 100644 --- a/Minecraft.World/WorldGen/Biomes/DesertBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/DesertBiome.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../Header Files/stdafx.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.biome.h" DesertBiome::DesertBiome(int id) : Biome(id) { // remove default mob spawn settings diff --git a/Minecraft.World/WorldGen/Biomes/DesertBiome.h b/Minecraft.World/net/minecraft/world/level/biome/DesertBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/DesertBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/DesertBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/ExtremeHillsBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/ExtremeHillsBiome.cpp similarity index 84% rename from Minecraft.World/WorldGen/Biomes/ExtremeHillsBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/ExtremeHillsBiome.cpp index 5ce0fb2db..3204c15c9 100644 --- a/Minecraft.World/WorldGen/Biomes/ExtremeHillsBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/ExtremeHillsBiome.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" #include "ExtremeHillsBiome.h" ExtremeHillsBiome::ExtremeHillsBiome(int id) : Biome(id) { diff --git a/Minecraft.World/WorldGen/Biomes/ExtremeHillsBiome.h b/Minecraft.World/net/minecraft/world/level/biome/ExtremeHillsBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/ExtremeHillsBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/ExtremeHillsBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp b/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp similarity index 98% rename from Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp rename to Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp index d0f2ea0f7..74c8b057e 100644 --- a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/Arrays.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/Arrays.h" #include "FixedBiomeSource.h" FixedBiomeSource::FixedBiomeSource(Biome* fixed, float temperature, diff --git a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.h b/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/FixedBiomeSource.h rename to Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.h diff --git a/Minecraft.World/WorldGen/Biomes/ForestBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/ForestBiome.cpp similarity index 78% rename from Minecraft.World/WorldGen/Biomes/ForestBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/ForestBiome.cpp index b7c1b994c..23795a040 100644 --- a/Minecraft.World/WorldGen/Biomes/ForestBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/ForestBiome.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "net.minecraft.world.level.biome.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../../entity/net.minecraft.world.entity.h" #include "ForestBiome.h" ForestBiome::ForestBiome(int id) : Biome(id) { diff --git a/Minecraft.World/WorldGen/Biomes/ForestBiome.h b/Minecraft.World/net/minecraft/world/level/biome/ForestBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/ForestBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/ForestBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/HellBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/HellBiome.cpp similarity index 80% rename from Minecraft.World/WorldGen/Biomes/HellBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/HellBiome.cpp index 273371764..76d31110c 100644 --- a/Minecraft.World/WorldGen/Biomes/HellBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/HellBiome.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/monster/net.minecraft.world.entity.monster.h" #include "HellBiome.h" HellBiome::HellBiome(int id) : Biome(id) { diff --git a/Minecraft.World/WorldGen/Biomes/HellBiome.h b/Minecraft.World/net/minecraft/world/level/biome/HellBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/HellBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/HellBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/IceBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/IceBiome.cpp similarity index 57% rename from Minecraft.World/WorldGen/Biomes/IceBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/IceBiome.cpp index c37c49f8d..1b6cd0c9e 100644 --- a/Minecraft.World/WorldGen/Biomes/IceBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/IceBiome.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "IceBiome.h" IceBiome::IceBiome(int id) : Biome(id) {}; \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Biomes/IceBiome.h b/Minecraft.World/net/minecraft/world/level/biome/IceBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/IceBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/IceBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/JungleBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/JungleBiome.cpp similarity index 85% rename from Minecraft.World/WorldGen/Biomes/JungleBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/JungleBiome.cpp index 820b2a4b5..a338ec163 100644 --- a/Minecraft.World/WorldGen/Biomes/JungleBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/JungleBiome.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.biome.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" #include "JungleBiome.h" JungleBiome::JungleBiome(int id) : Biome(id) { diff --git a/Minecraft.World/WorldGen/Biomes/JungleBiome.h b/Minecraft.World/net/minecraft/world/level/biome/JungleBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/JungleBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/JungleBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/MushroomIslandBiome.cpp similarity index 79% rename from Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/MushroomIslandBiome.cpp index 027e28bce..aecf73f59 100644 --- a/Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/MushroomIslandBiome.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "MushroomIslandBiome.h" #include "BiomeDecorator.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../tile/net.minecraft.world.level.tile.h" MushroomIslandBiome::MushroomIslandBiome(int id) : Biome(id) { decorator->treeCount = -100; diff --git a/Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.h b/Minecraft.World/net/minecraft/world/level/biome/MushroomIslandBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/MushroomIslandBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/OceanBiome.h b/Minecraft.World/net/minecraft/world/level/biome/OceanBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/OceanBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/OceanBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/PlainsBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/PlainsBiome.cpp similarity index 69% rename from Minecraft.World/WorldGen/Biomes/PlainsBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/PlainsBiome.cpp index c86f58566..fbb0f548c 100644 --- a/Minecraft.World/WorldGen/Biomes/PlainsBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/PlainsBiome.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.biome.h" PlainsBiome::PlainsBiome(int id) : Biome(id) { friendlies.push_back(new MobSpawnerData(eTYPE_HORSE, 5, 2, 6)); diff --git a/Minecraft.World/WorldGen/Biomes/PlainsBiome.h b/Minecraft.World/net/minecraft/world/level/biome/PlainsBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/PlainsBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/PlainsBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/RainforestBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/RainforestBiome.cpp similarity index 67% rename from Minecraft.World/WorldGen/Biomes/RainforestBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/RainforestBiome.cpp index dfbb9eb4a..4c6bfaa6b 100644 --- a/Minecraft.World/WorldGen/Biomes/RainforestBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/RainforestBiome.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "RainforestBiome.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" RainforestBiome::RainforestBiome(int id) : Biome(id) {} diff --git a/Minecraft.World/WorldGen/Biomes/RainforestBiome.h b/Minecraft.World/net/minecraft/world/level/biome/RainforestBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/RainforestBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/RainforestBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/RiverBiome.h b/Minecraft.World/net/minecraft/world/level/biome/RiverBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/RiverBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/RiverBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/SwampBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/SwampBiome.cpp similarity index 85% rename from Minecraft.World/WorldGen/Biomes/SwampBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/SwampBiome.cpp index 9c50c03cc..42d5a35da 100644 --- a/Minecraft.World/WorldGen/Biomes/SwampBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/SwampBiome.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../Features/SwampTreeFeature.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.biome.h" +#include "../levelgen/feature/SwampTreeFeature.h" SwampBiome::SwampBiome(int id) : Biome(id) { decorator->treeCount = 2; diff --git a/Minecraft.World/WorldGen/Biomes/SwampBiome.h b/Minecraft.World/net/minecraft/world/level/biome/SwampBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/SwampBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/SwampBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/TaigaBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/TaigaBiome.cpp similarity index 64% rename from Minecraft.World/WorldGen/Biomes/TaigaBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/TaigaBiome.cpp index e25d5e7d1..b12672cc1 100644 --- a/Minecraft.World/WorldGen/Biomes/TaigaBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/TaigaBiome.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "TaigaBiome.h" -#include "../../Headers/net.minecraft.world.entity.animal.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "net.minecraft.world.level.biome.h" TaigaBiome::TaigaBiome(int id) : Biome(id) { friendlies_wolf.push_back(new MobSpawnerData( diff --git a/Minecraft.World/WorldGen/Biomes/TaigaBiome.h b/Minecraft.World/net/minecraft/world/level/biome/TaigaBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/TaigaBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/TaigaBiome.h diff --git a/Minecraft.World/WorldGen/Biomes/TheEndBiome.cpp b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiome.cpp similarity index 73% rename from Minecraft.World/WorldGen/Biomes/TheEndBiome.cpp rename to Minecraft.World/net/minecraft/world/level/biome/TheEndBiome.cpp index 77dce0233..bf1a1ead9 100644 --- a/Minecraft.World/WorldGen/Biomes/TheEndBiome.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiome.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "TheEndBiome.h" -#include "../Structures/TheEndBiomeDecorator.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "TheEndBiomeDecorator.h" +#include "../../entity/monster/net.minecraft.world.entity.monster.h" +#include "../tile/net.minecraft.world.level.tile.h" TheEndBiome::TheEndBiome(int id) : Biome(id) { enemies.clear(); diff --git a/Minecraft.World/WorldGen/Biomes/TheEndBiome.h b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiome.h similarity index 100% rename from Minecraft.World/WorldGen/Biomes/TheEndBiome.h rename to Minecraft.World/net/minecraft/world/level/biome/TheEndBiome.h diff --git a/Minecraft.World/WorldGen/Structures/TheEndBiomeDecorator.cpp b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp similarity index 89% rename from Minecraft.World/WorldGen/Structures/TheEndBiomeDecorator.cpp rename to Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp index c7baf035d..86c7483b1 100644 --- a/Minecraft.World/WorldGen/Structures/TheEndBiomeDecorator.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "TheEndBiomeDecorator.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.entity.boss.enderdragon.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../../entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" // Spike centre positions, calculated using // for(int i=0;i<8;i++) diff --git a/Minecraft.World/WorldGen/Structures/TheEndBiomeDecorator.h b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.h similarity index 90% rename from Minecraft.World/WorldGen/Structures/TheEndBiomeDecorator.h rename to Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.h index c184af238..82a3bc9ca 100644 --- a/Minecraft.World/WorldGen/Structures/TheEndBiomeDecorator.h +++ b/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.h @@ -1,5 +1,5 @@ #pragma once -#include "../Biomes/BiomeDecorator.h" +#include "BiomeDecorator.h" class TheEndBiomeDecorator : public BiomeDecorator { public: diff --git a/Minecraft.World/WorldGen/Features/WaterlilyFeature.cpp b/Minecraft.World/net/minecraft/world/level/biome/WaterlilyFeature.cpp similarity index 81% rename from Minecraft.World/WorldGen/Features/WaterlilyFeature.cpp rename to Minecraft.World/net/minecraft/world/level/biome/WaterlilyFeature.cpp index 0271759ff..afd7799b9 100644 --- a/Minecraft.World/WorldGen/Features/WaterlilyFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/biome/WaterlilyFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "WaterlilyFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.level.h" bool WaterlilyFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/WaterlilyFeature.h b/Minecraft.World/net/minecraft/world/level/biome/WaterlilyFeature.h similarity index 76% rename from Minecraft.World/WorldGen/Features/WaterlilyFeature.h rename to Minecraft.World/net/minecraft/world/level/biome/WaterlilyFeature.h index de2a2eaff..b1d303c00 100644 --- a/Minecraft.World/WorldGen/Features/WaterlilyFeature.h +++ b/Minecraft.World/net/minecraft/world/level/biome/WaterlilyFeature.h @@ -1,5 +1,5 @@ #pragma once -#include "Feature.h" +#include "../levelgen/feature/Feature.h" class WaterlilyFeature : public Feature { virtual bool place(Level* level, Random* random, int x, int y, int z); diff --git a/Minecraft.World/net/minecraft/world/level/biome/net.minecraft.world.level.biome.h b/Minecraft.World/net/minecraft/world/level/biome/net.minecraft.world.level.biome.h new file mode 100644 index 000000000..a47131d79 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/biome/net.minecraft.world.level.biome.h @@ -0,0 +1,31 @@ +#pragma once + +#include "Biome.h" +#include "ForestBiome.h" +#include "HellBiome.h" +#include "RainforestBiome.h" +#include "IceBiome.h" +#include "MushroomIslandBiome.h" +#include "TheEndBiome.h" +#include "TheEndBiomeDecorator.h" +#include "WaterlilyFeature.h" +#include "SwampBiome.h" +#include "TaigaBiome.h" +#include "../LevelSource.h" +#include "BiomeSource.h" +#include "FixedBiomeSource.h" + +// 1.8.2 +#include "BiomeCache.h" +#include "BiomeDecorator.h" +#include "DesertBiome.h" +#include "ExtremeHillsBiome.h" +#include "OceanBiome.h" +#include "PlainsBiome.h" +#include "RiverBiome.h" + +// 1.1 +#include "BeachBiome.h" + +// 1.2.3 +#include "JungleBiome.h" \ No newline at end of file diff --git a/Minecraft.World/Level/BlockReplacements.cpp b/Minecraft.World/net/minecraft/world/level/chunk/BlockReplacements.cpp similarity index 83% rename from Minecraft.World/Level/BlockReplacements.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/BlockReplacements.cpp index 94a9e26dc..54cf95874 100644 --- a/Minecraft.World/Level/BlockReplacements.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/BlockReplacements.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "BlockReplacements.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../tile/net.minecraft.world.level.tile.h" byteArray BlockReplacements::replacements = byteArray(256); diff --git a/Minecraft.World/Level/BlockReplacements.h b/Minecraft.World/net/minecraft/world/level/chunk/BlockReplacements.h similarity index 100% rename from Minecraft.World/Level/BlockReplacements.h rename to Minecraft.World/net/minecraft/world/level/chunk/BlockReplacements.h diff --git a/Minecraft.World/Level/ChunkSource.h b/Minecraft.World/net/minecraft/world/level/chunk/ChunkSource.h similarity index 98% rename from Minecraft.World/Level/ChunkSource.h rename to Minecraft.World/net/minecraft/world/level/chunk/ChunkSource.h index ced0a1e84..2ed5cde91 100644 --- a/Minecraft.World/Level/ChunkSource.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/ChunkSource.h @@ -1,6 +1,6 @@ #pragma once -#include "../WorldGen/Biomes/Biome.h" +#include "../biome/Biome.h" class ProgressListener; class TilePos; diff --git a/Minecraft.World/Level/Storage/CompressedTileStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp similarity index 99% rename from Minecraft.World/Level/Storage/CompressedTileStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp index a2b3f921c..870a964e7 100644 --- a/Minecraft.World/Level/Storage/CompressedTileStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "CompressedTileStorage.h" // Note: See header for an overview of this class diff --git a/Minecraft.World/Level/Storage/CompressedTileStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.h similarity index 99% rename from Minecraft.World/Level/Storage/CompressedTileStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.h index 42e91e455..66452e5a5 100644 --- a/Minecraft.World/Level/Storage/CompressedTileStorage.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.h @@ -1,7 +1,7 @@ #pragma once #include #if !defined(__linux__) -#include "../../Platform/x64headers/xmcore.h" +#include "../../../../../x64headers/xmcore.h" #endif // This class is used for the compressed storage of tile data. Unlike the diff --git a/Minecraft.World/Level/Storage/DataLayer.cpp b/Minecraft.World/net/minecraft/world/level/chunk/DataLayer.cpp similarity index 96% rename from Minecraft.World/Level/Storage/DataLayer.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/DataLayer.cpp index e52287c09..24c50c0ca 100644 --- a/Minecraft.World/Level/Storage/DataLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/DataLayer.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "DataLayer.h" DataLayer::DataLayer(int length, int depthBits) diff --git a/Minecraft.World/Level/Storage/DataLayer.h b/Minecraft.World/net/minecraft/world/level/chunk/DataLayer.h similarity index 100% rename from Minecraft.World/Level/Storage/DataLayer.h rename to Minecraft.World/net/minecraft/world/level/chunk/DataLayer.h diff --git a/Minecraft.World/Level/EmptyLevelChunk.cpp b/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp similarity index 96% rename from Minecraft.World/Level/EmptyLevelChunk.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp index addbb0992..4704acf13 100644 --- a/Minecraft.World/Level/EmptyLevelChunk.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Util/Arrays.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/Arrays.h" +#include "../net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" #include "EmptyLevelChunk.h" EmptyLevelChunk::EmptyLevelChunk(Level* level, int x, int z) diff --git a/Minecraft.World/Level/EmptyLevelChunk.h b/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.h similarity index 98% rename from Minecraft.World/Level/EmptyLevelChunk.h rename to Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.h index 5c64f9c8c..eaa165237 100644 --- a/Minecraft.World/Level/EmptyLevelChunk.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.h @@ -1,6 +1,6 @@ #pragma once #include "LevelChunk.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Level; diff --git a/Minecraft.World/Level/LevelChunk.cpp b/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp similarity index 99% rename from Minecraft.World/Level/LevelChunk.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp index 69d4a9ebc..8a06d521e 100644 --- a/Minecraft.World/Level/LevelChunk.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp @@ -1,23 +1,23 @@ -#include "../Platform/stdafx.h" -#include "../Platform/System.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "Storage/DataLayer.h" -#include "Storage/SparseLightStorage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/System.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../net.minecraft.world.level.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../entity/monster/net.minecraft.world.entity.monster.h" +#include "DataLayer.h" +#include "SparseLightStorage.h" #include "BlockReplacements.h" #include "LevelChunk.h" #include -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Minecraft.Client/Network/ServerChunkCache.h" -#include "../../Minecraft.Client/Rendering/GameRenderer.h" -#include "../Entities/ItemEntity.h" -#include "../Entities/Mobs/Minecart.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/GameRenderer.h" +#include "../../entity/item/ItemEntity.h" +#include "../../entity/item/Minecart.h" #include diff --git a/Minecraft.World/Level/LevelChunk.h b/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h similarity index 98% rename from Minecraft.World/Level/LevelChunk.h rename to Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h index 7796cb7a3..7c0a55feb 100644 --- a/Minecraft.World/Level/LevelChunk.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h @@ -8,13 +8,13 @@ class Random; class ChunkSource; class EntitySelector; -#include "Storage/SparseLightStorage.h" -#include "Storage/CompressedTileStorage.h" -#include "Storage/SparseDataStorage.h" +#include "SparseLightStorage.h" +#include "CompressedTileStorage.h" +#include "SparseDataStorage.h" -#include "../Util/LightLayer.h" -#include "../Entities/Entity.h" -#include "Level.h" +#include "../LightLayer.h" +#include "../../entity/Entity.h" +#include "../Level.h" #define SHARING_ENABLED class TileCompressData_SPU; diff --git a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp b/Minecraft.World/net/minecraft/world/level/chunk/ReadOnlyChunkCache.cpp similarity index 94% rename from Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/ReadOnlyChunkCache.cpp index 41f8c72e3..acdc71e59 100644 --- a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/ReadOnlyChunkCache.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "ReadOnlyChunkCache.h" -#include "../../WorldGen/Biomes/Biome.h" +#include "../biome/Biome.h" ReadOnlyChunkCache::ReadOnlyChunkCache(Level* level, ChunkStorage* storage) { chunks = LevelChunkArray(LEN * LEN); diff --git a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.h b/Minecraft.World/net/minecraft/world/level/chunk/ReadOnlyChunkCache.h similarity index 91% rename from Minecraft.World/Level/Storage/ReadOnlyChunkCache.h rename to Minecraft.World/net/minecraft/world/level/chunk/ReadOnlyChunkCache.h index 6d96389bf..01c421c99 100644 --- a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/ReadOnlyChunkCache.h @@ -1,8 +1,8 @@ #pragma once -#include "../ChunkSource.h" -#include "../LevelChunk.h" -#include "../EmptyLevelChunk.h" -#include "ChunkStorage.h" +#include "ChunkSource.h" +#include "LevelChunk.h" +#include "EmptyLevelChunk.h" +#include "storage/ChunkStorage.h" class ProgressListener; diff --git a/Minecraft.World/Level/Storage/SparseDataStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp similarity index 99% rename from Minecraft.World/Level/Storage/SparseDataStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp index 061c38a03..a3114c574 100644 --- a/Minecraft.World/Level/Storage/SparseDataStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "SparseDataStorage.h" // Note: See header for an overview of this class diff --git a/Minecraft.World/Level/Storage/SparseDataStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h similarity index 99% rename from Minecraft.World/Level/Storage/SparseDataStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h index 09c4140c3..efe32b763 100644 --- a/Minecraft.World/Level/Storage/SparseDataStorage.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h @@ -1,6 +1,6 @@ #pragma once #if !defined(__linux__) -#include "../../Platform/x64headers/xmcore.h" +#include "../../../../../x64headers/xmcore.h" #endif // 4J added - Storage for data (ie the extra per tile storage). Data is normally diff --git a/Minecraft.World/Level/Storage/SparseLightStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp similarity index 99% rename from Minecraft.World/Level/Storage/SparseLightStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp index f713858ab..8097ed332 100644 --- a/Minecraft.World/Level/Storage/SparseLightStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "SparseLightStorage.h" // Note: See header for an overview of this class diff --git a/Minecraft.World/Level/Storage/SparseLightStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h similarity index 99% rename from Minecraft.World/Level/Storage/SparseLightStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h index 7077e3fb9..49c554309 100644 --- a/Minecraft.World/Level/Storage/SparseLightStorage.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h @@ -1,6 +1,6 @@ #pragma once #if !defined(__linux__) -#include "../../Platform/x64headers/xmcore.h" +#include "../../../../../x64headers/xmcore.h" #endif // 4J added - Storage for block & sky light data. Lighting data is normally diff --git a/Minecraft.World/Level/WaterLevelChunk.cpp b/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp similarity index 93% rename from Minecraft.World/Level/WaterLevelChunk.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp index 27a64e93e..31f58748a 100644 --- a/Minecraft.World/Level/WaterLevelChunk.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Util/Arrays.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/Arrays.h" +#include "../net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" #include "WaterLevelChunk.h" -#include "../Headers/net.minecraft.world.level.biome.h" +#include "../biome/net.minecraft.world.level.biome.h" WaterLevelChunk::WaterLevelChunk(Level* level, byteArray blocks, int x, int z) : LevelChunk(level, blocks, x, z) { diff --git a/Minecraft.World/Level/WaterLevelChunk.h b/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.h similarity index 97% rename from Minecraft.World/Level/WaterLevelChunk.h rename to Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.h index f153318a4..f7e8f71fd 100644 --- a/Minecraft.World/Level/WaterLevelChunk.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.h @@ -1,6 +1,6 @@ #pragma once #include "LevelChunk.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Level; diff --git a/Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h b/Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h new file mode 100644 index 000000000..d98bbe5cf --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h @@ -0,0 +1,8 @@ +#pragma once + +#include "BlockReplacements.h" +#include "ChunkSource.h" +#include "DataLayer.h" +#include "EmptyLevelChunk.h" +#include "LevelChunk.h" +#include "ReadOnlyChunkCache.h" diff --git a/Minecraft.World/Level/Storage/ChunkStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorage.h similarity index 100% rename from Minecraft.World/Level/Storage/ChunkStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorage.h diff --git a/Minecraft.World/Level/Storage/ChunkStorageProfileDecorator.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp similarity index 95% rename from Minecraft.World/Level/Storage/ChunkStorageProfileDecorator.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp index 48f93c1a5..aea3a296c 100644 --- a/Minecraft.World/Level/Storage/ChunkStorageProfileDecorator.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Platform/System.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/System.h" #include "ChunkStorageProfileDecorator.h" ChunkStorageProfilerDecorator::ChunkStorageProfilerDecorator( diff --git a/Minecraft.World/Level/Storage/ChunkStorageProfileDecorator.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.h similarity index 100% rename from Minecraft.World/Level/Storage/ChunkStorageProfileDecorator.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.h diff --git a/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp similarity index 98% rename from Minecraft.World/Level/Storage/McRegionChunkStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp index 27808d7af..4727c9f97 100644 --- a/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp @@ -2,11 +2,11 @@ #include #include -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" -#include "../../Util/ThreadName.h" -#include "../LevelData.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" +#include "../../../../../../ConsoleHelpers/ThreadName.h" +#include "../../storage/LevelData.h" #include "McRegionChunkStorage.h" std::mutex McRegionChunkStorage::cs_memory; diff --git a/Minecraft.World/Level/Storage/McRegionChunkStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h similarity index 95% rename from Minecraft.World/Level/Storage/McRegionChunkStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h index f651f95e5..de8002814 100644 --- a/Minecraft.World/Level/Storage/McRegionChunkStorage.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h @@ -5,7 +5,7 @@ #include "ChunkStorage.h" #include "../LevelChunk.h" #include "RegionFileCache.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "OldChunkStorage.h" class ConsoleSaveFile; diff --git a/Minecraft.World/Level/Storage/MemoryChunkStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/MemoryChunkStorage.cpp similarity index 76% rename from Minecraft.World/Level/Storage/MemoryChunkStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/MemoryChunkStorage.cpp index f5bb9977d..f3cfd2330 100644 --- a/Minecraft.World/Level/Storage/MemoryChunkStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/MemoryChunkStorage.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.chunk.h" #include "MemoryChunkStorage.h" LevelChunk* MemoryChunkStorage::load(Level* level, int x, diff --git a/Minecraft.World/Level/Storage/MemoryChunkStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/MemoryChunkStorage.h similarity index 100% rename from Minecraft.World/Level/Storage/MemoryChunkStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/MemoryChunkStorage.h diff --git a/Minecraft.World/IO/NBT/NbtSlotFile.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp similarity index 98% rename from Minecraft.World/IO/NBT/NbtSlotFile.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp index 07eaf0307..fbf26d18a 100644 --- a/Minecraft.World/IO/NBT/NbtSlotFile.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../Files/File.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/File.h" #include "NbtSlotFile.h" namespace { diff --git a/Minecraft.World/IO/NBT/NbtSlotFile.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h similarity index 84% rename from Minecraft.World/IO/NBT/NbtSlotFile.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h index 9f7a88788..a2f2413b6 100644 --- a/Minecraft.World/IO/NBT/NbtSlotFile.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h @@ -1,9 +1,9 @@ #pragma once #include -#include "CompoundTag.h" -#include "../../Level/Storage/ZonedChunkStorage.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../com/mojang/nbt/CompoundTag.h" +#include "ZonedChunkStorage.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" class NbtSlotFile { private: diff --git a/Minecraft.World/Level/Storage/OldChunkStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp similarity index 97% rename from Minecraft.World/Level/Storage/OldChunkStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp index 70ace0f3a..d3fad50ea 100644 --- a/Minecraft.World/Level/Storage/OldChunkStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include -#include "../../IO/Files/File.h" -#include "../../IO/Streams/InputOutputStream.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../IO/Files/FileHeader.h" +#include "../../../../../../ConsoleJavaLibs/File.h" +#include "../../../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../entity/net.minecraft.world.entity.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.chunk.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../storage/net.minecraft.world.level.storage.h" +#include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h" #include "OldChunkStorage.h" thread_local OldChunkStorage::ThreadStorage* OldChunkStorage::m_tlsStorage = diff --git a/Minecraft.World/Level/Storage/OldChunkStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h similarity index 91% rename from Minecraft.World/Level/Storage/OldChunkStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h index c451d6ffd..67d19e2c1 100644 --- a/Minecraft.World/Level/Storage/OldChunkStorage.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h @@ -1,9 +1,9 @@ #pragma once #include "ChunkStorage.h" #include "../LevelChunk.h" -#include "../../IO/Files/File.h" -#include "../../IO/NBT/CompoundTag.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../ConsoleJavaLibs/File.h" +#include "../../../../../../com/mojang/nbt/CompoundTag.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" #include class Level; diff --git a/Minecraft.World/Level/Storage/RegionFile.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp similarity index 98% rename from Minecraft.World/Level/Storage/RegionFile.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp index 043bc1ec0..da27e6071 100644 --- a/Minecraft.World/Level/Storage/RegionFile.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Platform/System.h" -#include "../../IO/Streams/InputOutputStream.h" -#include "../../IO/Files/File.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/System.h" +#include "../../../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "../../../../../../ConsoleJavaLibs/File.h" #include "RegionFile.h" -#include "../../IO/Files/ConsoleSaveFile.h" +#include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h" byteArray RegionFile::emptySector(SECTOR_BYTES); diff --git a/Minecraft.World/Level/Storage/RegionFile.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h similarity index 94% rename from Minecraft.World/Level/Storage/RegionFile.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h index f22b2337a..619326b34 100644 --- a/Minecraft.World/Level/Storage/RegionFile.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h @@ -1,6 +1,6 @@ #pragma once -#include "../../IO/Streams/Compression.h" -#include "../../IO/Streams/InputOutputStream.h" +#include "../../../../../../Header Files/compression.h" +#include "../../../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" class FileEntry; class ConsoleSaveFile; diff --git a/Minecraft.World/Level/Storage/RegionFileCache.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp similarity index 94% rename from Minecraft.World/Level/Storage/RegionFileCache.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp index 710302033..c9fbda872 100644 --- a/Minecraft.World/Level/Storage/RegionFileCache.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Files/File.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/File.h" #include "RegionFileCache.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" RegionFileCache RegionFileCache::s_defaultCache; diff --git a/Minecraft.World/Level/Storage/RegionFileCache.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h similarity index 96% rename from Minecraft.World/Level/Storage/RegionFileCache.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h index 3f29e132a..804667bc0 100644 --- a/Minecraft.World/Level/Storage/RegionFileCache.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h @@ -1,7 +1,7 @@ #pragma once #include "RegionFile.h" -#include "../../Util/Reference.h" -#include "../../IO/Files/File.h" +#include "../../../../../../ConsoleJavaLibs/Reference.h" +#include "../../../../../../ConsoleJavaLibs/File.h" class RegionFileCache { friend class ConsoleSaveFileOriginal; diff --git a/Minecraft.World/Level/Storage/ZoneFile.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp similarity index 94% rename from Minecraft.World/Level/Storage/ZoneFile.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp index b89fc2c49..d64964314 100644 --- a/Minecraft.World/Level/Storage/ZoneFile.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/ByteBuffer.h" -#include "../../IO/Files/File.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/ByteBuffer.h" +#include "../../../../../../ConsoleJavaLibs/File.h" #include "ZoneFile.h" namespace { diff --git a/Minecraft.World/Level/Storage/ZoneFile.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.h similarity index 91% rename from Minecraft.World/Level/Storage/ZoneFile.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.h index 412b1508c..8f3f46b94 100644 --- a/Minecraft.World/Level/Storage/ZoneFile.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.h @@ -2,8 +2,8 @@ #include #include "ZonedChunkStorage.h" -#include "../../IO/NBT/NbtSlotFile.h" -#include "ZoneIO.h" +#include "NbtSlotFile.h" +#include "ZoneIo.h" class ZoneFile { public: diff --git a/Minecraft.World/Level/Storage/ZoneIO.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp similarity index 91% rename from Minecraft.World/Level/Storage/ZoneIO.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp index 2cdcdf3d7..6559faff4 100644 --- a/Minecraft.World/Level/Storage/ZoneIO.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Streams/ByteBuffer.h" -#include "ZoneIO.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/ByteBuffer.h" +#include "ZoneIo.h" namespace { bool SeekFile(std::FILE* file, int64_t offset) { diff --git a/Minecraft.World/Level/Storage/ZoneIO.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.h similarity index 100% rename from Minecraft.World/Level/Storage/ZoneIO.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.h diff --git a/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp similarity index 95% rename from Minecraft.World/Level/Storage/ZonedChunkStorage.cpp rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp index 92b41eb56..230d472f7 100644 --- a/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include -#include "../../IO/Files/File.h" -#include "../../IO/Streams/ByteBuffer.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" +#include "../../../../../../ConsoleJavaLibs/File.h" +#include "../../../../../../ConsoleJavaLibs/ByteBuffer.h" +#include "../../../entity/net.minecraft.world.entity.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../net.minecraft.world.level.chunk.h" #include "ZonedChunkStorage.h" #include "ZoneFile.h" diff --git a/Minecraft.World/Level/Storage/ZonedChunkStorage.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h similarity index 95% rename from Minecraft.World/Level/Storage/ZonedChunkStorage.h rename to Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h index 4cf3b0e34..b928af665 100644 --- a/Minecraft.World/Level/Storage/ZonedChunkStorage.h +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h @@ -1,5 +1,5 @@ #pragma once -#include "../../IO/Files/File.h" +#include "../../../../../../ConsoleJavaLibs/File.h" #include "ChunkStorage.h" #include "../LevelChunk.h" diff --git a/Minecraft.World/net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h b/Minecraft.World/net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h new file mode 100644 index 000000000..114264ecc --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/chunk/storage/net.minecraft.world.level.chunk.storage.h @@ -0,0 +1,13 @@ +#pragma once + +#include "ChunkStorage.h" +#include "ChunkStorageProfileDecorator.h" +#include "MemoryChunkStorage.h" +#include "McRegionChunkStorage.h" +#include "NbtSlotFile.h" +#include "OldChunkStorage.h" +#include "RegionFile.h" +#include "RegionFileCache.h" +#include "ZonedChunkStorage.h" +#include "ZoneFile.h" +#include "ZoneIo.h" \ No newline at end of file diff --git a/Minecraft.World/Level/Dimensions/Dimension.cpp b/Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp similarity index 91% rename from Minecraft.World/Level/Dimensions/Dimension.cpp rename to Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp index 881405671..179f11c43 100644 --- a/Minecraft.World/Level/Dimensions/Dimension.cpp +++ b/Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.levelgen.flat.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../levelgen/flat/net.minecraft.world.level.levelgen.flat.h" +#include "../levelgen/net.minecraft.world.level.levelgen.h" +#include "../net.minecraft.world.level.h" +#include "../storage/net.minecraft.world.level.storage.h" #include "Dimension.h" -#include "../../WorldGen/Biomes/BiomeSource.h" -#include "../../WorldGen/Biomes/FixedBiomeSource.h" -#include "../Storage/OldChunkStorage.h" +#include "../biome/BiomeSource.h" +#include "../biome/FixedBiomeSource.h" +#include "../chunk/storage/OldChunkStorage.h" #include "HellDimension.h" #include "NormalDimension.h" #include "TheEndDimension.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Platform/Common/Colours/ColourTable.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/Common/Source Files/Colours/ColourTable.h" const float Dimension::MOON_BRIGHTNESS_PER_PHASE[8] = { 1.0f, 0.75f, 0.5f, 0.25f, 0, 0.25f, 0.5f, 0.75f}; diff --git a/Minecraft.World/Level/Dimensions/Dimension.h b/Minecraft.World/net/minecraft/world/level/dimension/Dimension.h similarity index 94% rename from Minecraft.World/Level/Dimensions/Dimension.h rename to Minecraft.World/net/minecraft/world/level/dimension/Dimension.h index 0aea9e38c..97f1f20cd 100644 --- a/Minecraft.World/Level/Dimensions/Dimension.h +++ b/Minecraft.World/net/minecraft/world/level/dimension/Dimension.h @@ -5,9 +5,9 @@ class ChunkStorage; class Level; class LevelType; -#include "../../Blocks/Material.h" -#include "../../Util/Vec3.h" -#include "../../Util/Pos.h" +#include "../material/Material.h" +#include "../../phys/Vec3.h" +#include "../../../Pos.h" class Dimension { public: diff --git a/Minecraft.World/Level/Dimensions/HellDimension.cpp b/Minecraft.World/net/minecraft/world/level/dimension/HellDimension.cpp similarity index 81% rename from Minecraft.World/Level/Dimensions/HellDimension.cpp rename to Minecraft.World/net/minecraft/world/level/dimension/HellDimension.cpp index 87d8ae155..538b247f5 100644 --- a/Minecraft.World/Level/Dimensions/HellDimension.cpp +++ b/Minecraft.World/net/minecraft/world/level/dimension/HellDimension.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../storage/net.minecraft.world.level.storage.h" #include "HellDimension.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Platform/Common/Colours/ColourTable.h" +#include "../levelgen/net.minecraft.world.level.levelgen.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/Common/Source Files/Colours/ColourTable.h" void HellDimension::init() { biomeSource = new FixedBiomeSource(Biome::hell, 1, 0); diff --git a/Minecraft.World/Level/Dimensions/HellDimension.h b/Minecraft.World/net/minecraft/world/level/dimension/HellDimension.h similarity index 100% rename from Minecraft.World/Level/Dimensions/HellDimension.h rename to Minecraft.World/net/minecraft/world/level/dimension/HellDimension.h diff --git a/Minecraft.World/Level/Dimensions/NormalDimension.h b/Minecraft.World/net/minecraft/world/level/dimension/NormalDimension.h similarity index 100% rename from Minecraft.World/Level/Dimensions/NormalDimension.h rename to Minecraft.World/net/minecraft/world/level/dimension/NormalDimension.h diff --git a/Minecraft.World/Level/Dimensions/TheEndDimension.cpp b/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp similarity index 80% rename from Minecraft.World/Level/Dimensions/TheEndDimension.cpp rename to Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp index ed6bf28bf..0b8236a67 100644 --- a/Minecraft.World/Level/Dimensions/TheEndDimension.cpp +++ b/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "TheEndDimension.h" -#include "../../WorldGen/Biomes/FixedBiomeSource.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Platform/Common/Colours/ColourTable.h" +#include "../biome/FixedBiomeSource.h" +#include "../levelgen/net.minecraft.world.level.levelgen.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/Common/Source Files/Colours/ColourTable.h" void TheEndDimension::init() { biomeSource = new FixedBiomeSource(Biome::sky, 0.5f, 0); diff --git a/Minecraft.World/Level/Dimensions/TheEndDimension.h b/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.h similarity index 100% rename from Minecraft.World/Level/Dimensions/TheEndDimension.h rename to Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.h diff --git a/Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h b/Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h new file mode 100644 index 000000000..0c9f41c2a --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h @@ -0,0 +1,6 @@ +#pragma once + +#include "Dimension.h" +#include "HellDimension.h" +#include "NormalDimension.h" +#include "TheEndDimension.h" \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Features/CanyonFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp similarity index 96% rename from Minecraft.World/WorldGen/Features/CanyonFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp index cd502aafb..ca1e67af2 100644 --- a/Minecraft.World/WorldGen/Features/CanyonFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "CanyonFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../biome/net.minecraft.world.level.biome.h" void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, diff --git a/Minecraft.World/WorldGen/Features/CanyonFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/CanyonFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.h diff --git a/Minecraft.World/Level/CustomLevelSource.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp similarity index 97% rename from Minecraft.World/Level/CustomLevelSource.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp index 7df8394ac..3f9a55b7f 100644 --- a/Minecraft.World/Level/CustomLevelSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.level.levelgen.h" -#include "../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../Headers/net.minecraft.world.level.levelgen.synth.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.storage.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.levelgen.h" +#include "feature/net.minecraft.world.level.levelgen.feature.h" +#include "structure/net.minecraft.world.level.levelgen.structure.h" +#include "synth/net.minecraft.world.level.levelgen.synth.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../storage/net.minecraft.world.level.storage.h" +#include "../../entity/net.minecraft.world.entity.h" #include "CustomLevelSource.h" const double CustomLevelSource::SNOW_SCALE = 0.3; diff --git a/Minecraft.World/Level/CustomLevelSource.h b/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.h similarity index 98% rename from Minecraft.World/Level/CustomLevelSource.h rename to Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.h index 65a38fadf..226c0a0ca 100644 --- a/Minecraft.World/Level/CustomLevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.h @@ -1,6 +1,6 @@ #pragma once -#include "ChunkSource.h" +#include "../chunk/ChunkSource.h" #ifndef _CONTENT_PACKAGE #define _OVERRIDE_HEIGHTMAP diff --git a/Minecraft.World/WorldGen/Features/DungeonFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp similarity index 97% rename from Minecraft.World/WorldGen/Features/DungeonFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp index e7f88585d..ce4e57587 100644 --- a/Minecraft.World/WorldGen/Features/DungeonFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "DungeonFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../tile/net.minecraft.world.level.tile.h" void DungeonFeature::addRoom(int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) { diff --git a/Minecraft.World/WorldGen/Features/DungeonFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/DungeonFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.h diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp similarity index 89% rename from Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp index 5b4f429b8..3fe83f6e7 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Headers/net.minecraft.world.level.levelgen.synth.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.levelgen.h" +#include "feature/net.minecraft.world.level.levelgen.feature.h" +#include "structure/net.minecraft.world.level.levelgen.structure.h" +#include "synth/net.minecraft.world.level.levelgen.synth.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../storage/net.minecraft.world.level.storage.h" #include "FlatLevelSource.h" // FlatLevelSource::villageFeature = new VillageFeature(1); diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.h b/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.h similarity index 97% rename from Minecraft.World/WorldGen/Sources/FlatLevelSource.h rename to Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.h index 7c2bdb908..18773c802 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Level/ChunkSource.h" +#include "../chunk/ChunkSource.h" class ProgressListener; class LargeFeature; diff --git a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp similarity index 97% rename from Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp index 9bec242f3..69dc6e181 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../storage/net.minecraft.world.level.storage.h" #include "HellFlatLevelSource.h" HellFlatLevelSource::HellFlatLevelSource(Level* level, int64_t seed) { diff --git a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h b/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.h similarity index 76% rename from Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h rename to Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.h index 1e19ca85c..af987c683 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.h @@ -1,14 +1,14 @@ #pragma once -#include "../../Level/ChunkSource.h" -#include "../Noise/PerlinNoise.h" -#include "../Features/LargeFeature.h" -#include "../Features/LargeHellCaveFeature.h" -#include "../../Level/LevelChunk.h" -#include "../Features/HellFireFeature.h" -#include "../Features/LightGemFeature.h" -#include "../Features/HellPortalFeature.h" -#include "../Features/FlowerFeature.h" -#include "../Features/HellSpringFeature.h" +#include "../chunk/ChunkSource.h" +#include "synth/PerlinNoise.h" +#include "LargeFeature.h" +#include "LargeHellCaveFeature.h" +#include "../chunk/LevelChunk.h" +#include "feature/HellFireFeature.h" +#include "feature/LightGemFeature.h" +#include "feature/HellPortalFeature.h" +#include "feature/FlowerFeature.h" +#include "feature/HellSpringFeature.h" class ProgressListener; diff --git a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp similarity index 98% rename from Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp index 316b6a023..9e318477d 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../Biomes/BiomeSource.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "feature/net.minecraft.world.level.levelgen.feature.h" +#include "../storage/net.minecraft.world.level.storage.h" +#include "../biome/BiomeSource.h" #include "HellRandomLevelSource.h" HellRandomLevelSource::HellRandomLevelSource(Level* level, int64_t seed) { diff --git a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h b/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h similarity index 79% rename from Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h rename to Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h index a055ba0a0..5da7d9a0e 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h @@ -1,15 +1,15 @@ #pragma once -#include "../../Level/ChunkSource.h" -#include "../Noise/PerlinNoise.h" -#include "../Features/LargeFeature.h" -#include "../Features/LargeHellCaveFeature.h" -#include "../../Level/LevelChunk.h" -#include "../Features/HellFireFeature.h" -#include "../Features/LightGemFeature.h" -#include "../Features/HellPortalFeature.h" -#include "../Features/FlowerFeature.h" -#include "../Features/HellSpringFeature.h" -#include "../Features/NetherBridgeFeature.h" +#include "../chunk/ChunkSource.h" +#include "synth/PerlinNoise.h" +#include "LargeFeature.h" +#include "LargeHellCaveFeature.h" +#include "../chunk/LevelChunk.h" +#include "feature/HellFireFeature.h" +#include "feature/LightGemFeature.h" +#include "feature/HellPortalFeature.h" +#include "feature/FlowerFeature.h" +#include "feature/HellSpringFeature.h" +#include "structure/NetherBridgeFeature.h" class ProgressListener; diff --git a/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp similarity index 97% rename from Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp index 8fccdf9d5..5b3edaa38 100644 --- a/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../biome/net.minecraft.world.level.biome.h" #include "LargeCaveFeature.h" void LargeCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, diff --git a/Minecraft.World/WorldGen/Features/LargeCaveFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/LargeCaveFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.h diff --git a/Minecraft.World/WorldGen/Features/LargeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/LargeFeature.cpp similarity index 90% rename from Minecraft.World/WorldGen/Features/LargeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/LargeFeature.cpp index 2a129e31d..c3426d14e 100644 --- a/Minecraft.World/WorldGen/Features/LargeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/LargeFeature.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "LargeFeature.h" const std::wstring LargeFeature::STRONGHOLD = L"StrongHold"; diff --git a/Minecraft.World/WorldGen/Features/LargeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/LargeFeature.h similarity index 93% rename from Minecraft.World/WorldGen/Features/LargeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/LargeFeature.h index f48b26b24..cfdc16255 100644 --- a/Minecraft.World/WorldGen/Features/LargeFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/LargeFeature.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Level/ChunkSource.h" +#include "../chunk/ChunkSource.h" class Level; diff --git a/Minecraft.World/WorldGen/Features/LargeHellCaveFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp similarity index 97% rename from Minecraft.World/WorldGen/Features/LargeHellCaveFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp index 4078d9729..3fcd2f4d2 100644 --- a/Minecraft.World/WorldGen/Features/LargeHellCaveFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "LargeHellCaveFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../tile/net.minecraft.world.level.tile.h" void LargeHellCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, diff --git a/Minecraft.World/WorldGen/Features/LargeHellCaveFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/LargeHellCaveFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.h diff --git a/Minecraft.World/Level/RandomLevelSource.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp similarity index 98% rename from Minecraft.World/Level/RandomLevelSource.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp index 85144a1a1..d1ee6b2f3 100644 --- a/Minecraft.World/Level/RandomLevelSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.level.levelgen.h" -#include "../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../Headers/net.minecraft.world.level.levelgen.synth.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.storage.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.levelgen.h" +#include "feature/net.minecraft.world.level.levelgen.feature.h" +#include "structure/net.minecraft.world.level.levelgen.structure.h" +#include "synth/net.minecraft.world.level.levelgen.synth.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../storage/net.minecraft.world.level.storage.h" +#include "../../entity/net.minecraft.world.entity.h" #include "RandomLevelSource.h" const double RandomLevelSource::SNOW_SCALE = 0.3; diff --git a/Minecraft.World/Level/RandomLevelSource.h b/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.h similarity index 98% rename from Minecraft.World/Level/RandomLevelSource.h rename to Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.h index 9c23ab8dc..7373d96c0 100644 --- a/Minecraft.World/Level/RandomLevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.h @@ -1,6 +1,6 @@ #pragma once -#include "ChunkSource.h" +#include "../chunk/ChunkSource.h" class ProgressListener; class LargeFeature; diff --git a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp similarity index 96% rename from Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp index 5170267bf..5a0c935f6 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Headers/net.minecraft.world.level.levelgen.synth.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.storage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.levelgen.h" +#include "feature/net.minecraft.world.level.levelgen.feature.h" +#include "structure/net.minecraft.world.level.levelgen.structure.h" +#include "synth/net.minecraft.world.level.levelgen.synth.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../storage/net.minecraft.world.level.storage.h" #include "TheEndLevelRandomLevelSource.h" TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level* level, diff --git a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h b/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.h similarity index 98% rename from Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h rename to Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.h index 617b30a68..b154c8d75 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Level/ChunkSource.h" +#include "../chunk/ChunkSource.h" class PerlinNoise; class TheEndLevelRandomLevelSource : public ChunkSource { diff --git a/Minecraft.World/WorldGen/Features/TownFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/TownFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/TownFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/TownFeature.h diff --git a/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BasicTreeFeature.cpp similarity index 99% rename from Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/BasicTreeFeature.cpp index 8dc6e212b..59e988dbb 100644 --- a/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BasicTreeFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "BasicTreeFeature.h" uint8_t BasicTree::axisConversionArray[] = {2, 0, 0, 1, 2, 1}; diff --git a/Minecraft.World/WorldGen/Features/BasicTreeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BasicTreeFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/BasicTreeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/BasicTreeFeature.h diff --git a/Minecraft.World/WorldGen/Features/BirchFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BirchFeature.cpp similarity index 94% rename from Minecraft.World/WorldGen/Features/BirchFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/BirchFeature.cpp index 63dc21c46..0dc4c10ae 100644 --- a/Minecraft.World/WorldGen/Features/BirchFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BirchFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "BirchFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" BirchFeature::BirchFeature(bool doUpdate) : Feature(doUpdate) {} diff --git a/Minecraft.World/WorldGen/Features/BirchFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BirchFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/BirchFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/BirchFeature.h diff --git a/Minecraft.World/WorldGen/Features/BonusChestFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BonusChestFeature.cpp similarity index 92% rename from Minecraft.World/WorldGen/Features/BonusChestFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/BonusChestFeature.cpp index 1e2b488c5..c105fb715 100644 --- a/Minecraft.World/WorldGen/Features/BonusChestFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BonusChestFeature.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "BonusChestFeature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Util/WeighedTreasure.h" -#include "../Structures/StructurePiece.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../../util/WeighedTreasure.h" +#include "../structure/StructurePiece.h" BonusChestFeature::BonusChestFeature(WeighedTreasureArray treasureList, int numRolls) diff --git a/Minecraft.World/WorldGen/Features/BonusChestFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/BonusChestFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/BonusChestFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/BonusChestFeature.h diff --git a/Minecraft.World/WorldGen/Features/CactusFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CactusFeature.cpp similarity index 83% rename from Minecraft.World/WorldGen/Features/CactusFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/CactusFeature.cpp index 62a97d1d5..57e0dcc3d 100644 --- a/Minecraft.World/WorldGen/Features/CactusFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CactusFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "CactusFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" bool CactusFeature::place(Level* level, Random* random, int x, int y, int z) { for (int i = 0; i < 10; i++) { diff --git a/Minecraft.World/WorldGen/Features/CactusFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CactusFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/CactusFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/CactusFeature.h diff --git a/Minecraft.World/WorldGen/Features/CaveFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp similarity index 96% rename from Minecraft.World/WorldGen/Features/CaveFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp index 006bc7a18..780c22c5e 100644 --- a/Minecraft.World/WorldGen/Features/CaveFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "CaveFeature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" bool CaveFeature::place(Level* level, Random* random, int x, int y, int z) { float dir = random->nextFloat() * PI; diff --git a/Minecraft.World/WorldGen/Features/CaveFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.h similarity index 81% rename from Minecraft.World/WorldGen/Features/CaveFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.h index f00c62352..f6577ec8c 100644 --- a/Minecraft.World/WorldGen/Features/CaveFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.h @@ -1,6 +1,6 @@ #pragma once #include "Feature.h" -#include "../../Blocks/Material.h" +#include "../../material/Material.h" class Level; diff --git a/Minecraft.World/WorldGen/Features/ClayFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ClayFeature.cpp similarity index 80% rename from Minecraft.World/WorldGen/Features/ClayFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/ClayFeature.cpp index 06f643b30..e20b4dd77 100644 --- a/Minecraft.World/WorldGen/Features/ClayFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ClayFeature.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../material/net.minecraft.world.level.material.h" #include "ClayFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" ClayFeature::ClayFeature(int radius) { this->tile = Tile::clay_Id; diff --git a/Minecraft.World/WorldGen/Features/ClayFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ClayFeature.h similarity index 86% rename from Minecraft.World/WorldGen/Features/ClayFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/ClayFeature.h index 973657c8d..10c5f1b5a 100644 --- a/Minecraft.World/WorldGen/Features/ClayFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ClayFeature.h @@ -1,6 +1,6 @@ #pragma once #include "Feature.h" -#include "../../Blocks/Material.h" +#include "../../material/Material.h" class Level; diff --git a/Minecraft.World/WorldGen/Features/DeadBushFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/DeadBushFeature.cpp similarity index 84% rename from Minecraft.World/WorldGen/Features/DeadBushFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/DeadBushFeature.cpp index 4fbf97f56..a4261afa0 100644 --- a/Minecraft.World/WorldGen/Features/DeadBushFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/DeadBushFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "DeadBushFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" DeadBushFeature::DeadBushFeature(int tile) { this->tile = tile; } diff --git a/Minecraft.World/WorldGen/Features/DeadBushFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/DeadBushFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/DeadBushFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/DeadBushFeature.h diff --git a/Minecraft.World/WorldGen/Features/DesertWellFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/DesertWellFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/DesertWellFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/DesertWellFeature.cpp index 16821ae19..149fbbdc5 100644 --- a/Minecraft.World/WorldGen/Features/DesertWellFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/DesertWellFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "DesertWellFeature.h" bool DesertWellFeature::place(Level* level, Random* random, int x, int y, diff --git a/Minecraft.World/WorldGen/Features/DesertWellFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/DesertWellFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/DesertWellFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/DesertWellFeature.h diff --git a/Minecraft.World/WorldGen/Features/EndPodiumFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.cpp similarity index 91% rename from Minecraft.World/WorldGen/Features/EndPodiumFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.cpp index 3c9a4bf34..a24590b2b 100644 --- a/Minecraft.World/WorldGen/Features/EndPodiumFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../../entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "EndPodiumFeature.h" EndPodiumFeature::EndPodiumFeature(int tile) { diff --git a/Minecraft.World/WorldGen/Features/EndPodiumFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/EndPodiumFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/EndPodiumFeature.h diff --git a/Minecraft.World/WorldGen/Features/Feature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/Feature.cpp similarity index 81% rename from Minecraft.World/WorldGen/Features/Feature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/Feature.cpp index a6edfbe66..168966ef8 100644 --- a/Minecraft.World/WorldGen/Features/Feature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/Feature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "Feature.h" Feature::Feature() { this->doUpdate = false; } diff --git a/Minecraft.World/WorldGen/Features/Feature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/Feature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/Feature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/Feature.h diff --git a/Minecraft.World/WorldGen/Features/FlowerFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/FlowerFeature.cpp similarity index 86% rename from Minecraft.World/WorldGen/Features/FlowerFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/FlowerFeature.cpp index f59bcbd5b..358cc6651 100644 --- a/Minecraft.World/WorldGen/Features/FlowerFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/FlowerFeature.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" #include "FlowerFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" FlowerFeature::FlowerFeature(int tile) { this->tile = tile; } diff --git a/Minecraft.World/WorldGen/Features/FlowerFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/FlowerFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/FlowerFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/FlowerFeature.h diff --git a/Minecraft.World/WorldGen/Features/GroundBushFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/GroundBushFeature.cpp similarity index 90% rename from Minecraft.World/WorldGen/Features/GroundBushFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/GroundBushFeature.cpp index 912fdb414..3452178c9 100644 --- a/Minecraft.World/WorldGen/Features/GroundBushFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/GroundBushFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "GroundBushFeature.h" GroundBushFeature::GroundBushFeature(int trunkType, int leafType) { diff --git a/Minecraft.World/WorldGen/Features/GroundBushFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/GroundBushFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/GroundBushFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/GroundBushFeature.h diff --git a/Minecraft.World/WorldGen/Features/HellFireFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellFireFeature.cpp similarity index 79% rename from Minecraft.World/WorldGen/Features/HellFireFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HellFireFeature.cpp index 4af1e30e8..e4ae8155b 100644 --- a/Minecraft.World/WorldGen/Features/HellFireFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellFireFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "HellFireFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" bool HellFireFeature::place(Level* level, Random* random, int x, int y, int z) { for (int i = 0; i < 64; i++) { diff --git a/Minecraft.World/WorldGen/Features/HellFireFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellFireFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/HellFireFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HellFireFeature.h diff --git a/Minecraft.World/WorldGen/Features/HellPortalFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellPortalFeature.cpp similarity index 89% rename from Minecraft.World/WorldGen/Features/HellPortalFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HellPortalFeature.cpp index 9238b4f8d..f0f3bdd0b 100644 --- a/Minecraft.World/WorldGen/Features/HellPortalFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellPortalFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "HellPortalFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" bool HellPortalFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/HellPortalFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellPortalFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/HellPortalFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HellPortalFeature.h diff --git a/Minecraft.World/WorldGen/Features/HellSpringFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellSpringFeature.cpp similarity index 90% rename from Minecraft.World/WorldGen/Features/HellSpringFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HellSpringFeature.cpp index 2bae1dd4c..5b7164d17 100644 --- a/Minecraft.World/WorldGen/Features/HellSpringFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellSpringFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "HellSpringFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../tile/net.minecraft.world.level.tile.h" HellSpringFeature::HellSpringFeature(int tile, bool insideRock) { this->tile = tile; diff --git a/Minecraft.World/WorldGen/Features/HellSpringFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HellSpringFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/HellSpringFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HellSpringFeature.h diff --git a/Minecraft.World/WorldGen/Features/HouseFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HouseFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/HouseFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HouseFeature.cpp index 48e71c7fd..b91ec81c0 100644 --- a/Minecraft.World/WorldGen/Features/HouseFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HouseFeature.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" #include "HouseFeature.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../../entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../item/net.minecraft.world.item.h" bool HouseFeature::place(Level* level, Random* random, int x, int y, int z) { while (y > 0 && !level->getMaterial(x, y - 1, z)->blocksMotion()) y--; diff --git a/Minecraft.World/WorldGen/Features/HouseFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HouseFeature.h similarity index 81% rename from Minecraft.World/WorldGen/Features/HouseFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HouseFeature.h index 1c9f9f36c..d16795b4e 100644 --- a/Minecraft.World/WorldGen/Features/HouseFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HouseFeature.h @@ -1,6 +1,6 @@ #pragma once #include "Feature.h" -#include "../../Blocks/Material.h" +#include "../../material/Material.h" class HouseFeature : public Feature { public: diff --git a/Minecraft.World/WorldGen/Features/HugeMushroomFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HugeMushroomFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/HugeMushroomFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HugeMushroomFeature.cpp index fc7321ff4..7b9812533 100644 --- a/Minecraft.World/WorldGen/Features/HugeMushroomFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HugeMushroomFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "HugeMushroomFeature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" HugeMushroomFeature::HugeMushroomFeature(int forcedType) : Feature(true) { this->forcedType = forcedType; diff --git a/Minecraft.World/WorldGen/Features/HugeMushroomFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/HugeMushroomFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/HugeMushroomFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/HugeMushroomFeature.h diff --git a/Minecraft.World/WorldGen/Features/LakeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LakeFeature.cpp similarity index 96% rename from Minecraft.World/WorldGen/Features/LakeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/LakeFeature.cpp index 685aebda5..20c1c3495 100644 --- a/Minecraft.World/WorldGen/Features/LakeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LakeFeature.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "LakeFeature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../biome/net.minecraft.world.level.biome.h" LakeFeature::LakeFeature(int tile) { this->tile = tile; } diff --git a/Minecraft.World/WorldGen/Features/LakeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LakeFeature.h similarity index 84% rename from Minecraft.World/WorldGen/Features/LakeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/LakeFeature.h index 197eea9e2..f466c2f3e 100644 --- a/Minecraft.World/WorldGen/Features/LakeFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LakeFeature.h @@ -1,6 +1,6 @@ #pragma once #include "Feature.h" -#include "../../Blocks/Material.h" +#include "../../material/Material.h" class LakeFeature : public Feature { private: diff --git a/Minecraft.World/WorldGen/Features/LightGemFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LightGemFeature.cpp similarity index 89% rename from Minecraft.World/WorldGen/Features/LightGemFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/LightGemFeature.cpp index d8ee13904..b055bd456 100644 --- a/Minecraft.World/WorldGen/Features/LightGemFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LightGemFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "LightGemFeature.h" bool LightGemFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/LightGemFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/LightGemFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/LightGemFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/LightGemFeature.h diff --git a/Minecraft.World/WorldGen/Features/MegaTreeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp similarity index 98% rename from Minecraft.World/WorldGen/Features/MegaTreeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp index 1dfaf4991..8e52bdfc1 100644 --- a/Minecraft.World/WorldGen/Features/MegaTreeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "MegaTreeFeature.h" MegaTreeFeature::MegaTreeFeature(bool doUpdate, int baseHeight, int trunkType, diff --git a/Minecraft.World/WorldGen/Features/MegaTreeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/MegaTreeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.h diff --git a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.cpp similarity index 93% rename from Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.cpp index b6545c4db..876791016 100644 --- a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Util/WeighedTreasure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../material/net.minecraft.world.level.material.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../../util/WeighedTreasure.h" #include "MonsterRoomFeature.h" WeighedTreasure* MonsterRoomFeature::monsterRoomTreasure diff --git a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.h similarity index 91% rename from Minecraft.World/WorldGen/Features/MonsterRoomFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.h index 36488997c..2a796e519 100644 --- a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.h @@ -1,6 +1,6 @@ #pragma once #include "Feature.h" -#include "../../Blocks/Material.h" +#include "../../material/Material.h" class WeighedTreasure; diff --git a/Minecraft.World/WorldGen/Features/NetherSphereFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/NetherSphereFeature.cpp similarity index 90% rename from Minecraft.World/WorldGen/Features/NetherSphereFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/NetherSphereFeature.cpp index 3d855b923..e9bfc3da6 100644 --- a/Minecraft.World/WorldGen/Features/NetherSphereFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/NetherSphereFeature.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "NetherSphereFeature.h" NetherSphere::NetherSphere(Level* level) : Entity(level) { diff --git a/Minecraft.World/WorldGen/Features/NetherSphereFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/NetherSphereFeature.h similarity index 90% rename from Minecraft.World/WorldGen/Features/NetherSphereFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/NetherSphereFeature.h index c1b16a16b..95e116226 100644 --- a/Minecraft.World/WorldGen/Features/NetherSphereFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/NetherSphereFeature.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Entities/Entity.h" +#include "../../../entity/Entity.h" class NetherSphere : public Entity { public: diff --git a/Minecraft.World/WorldGen/Features/OreFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp similarity index 97% rename from Minecraft.World/WorldGen/Features/OreFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp index d3fd028ac..d0d50f83e 100644 --- a/Minecraft.World/WorldGen/Features/OreFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "OreFeature.h" void OreFeature::_init(int tile, int count, int targetTile) { diff --git a/Minecraft.World/WorldGen/Features/OreFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/OreFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.h diff --git a/Minecraft.World/WorldGen/Features/PineFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/PineFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/PineFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/PineFeature.cpp index fec11fc17..bf7309668 100644 --- a/Minecraft.World/WorldGen/Features/PineFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/PineFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "PineFeature.h" bool PineFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/PineFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/PineFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/PineFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/PineFeature.h diff --git a/Minecraft.World/WorldGen/Features/PumpkinFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/PumpkinFeature.cpp similarity index 82% rename from Minecraft.World/WorldGen/Features/PumpkinFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/PumpkinFeature.cpp index 905f2ded8..f15815371 100644 --- a/Minecraft.World/WorldGen/Features/PumpkinFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/PumpkinFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "PumpkinFeature.h" bool PumpkinFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/PumpkinFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/PumpkinFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/PumpkinFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/PumpkinFeature.h diff --git a/Minecraft.World/WorldGen/Features/ReedsFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ReedsFeature.cpp similarity index 91% rename from Minecraft.World/WorldGen/Features/ReedsFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/ReedsFeature.cpp index 744953e03..a8846c391 100644 --- a/Minecraft.World/WorldGen/Features/ReedsFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ReedsFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "ReedsFeature.h" bool ReedsFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/ReedsFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ReedsFeature.h similarity index 81% rename from Minecraft.World/WorldGen/Features/ReedsFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/ReedsFeature.h index d49aafa35..ed720f58c 100644 --- a/Minecraft.World/WorldGen/Features/ReedsFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/ReedsFeature.h @@ -1,6 +1,6 @@ #pragma once #include "Feature.h" -#include "../../Blocks/Material.h" +#include "../../material/Material.h" class ReedsFeature : public Feature { public: diff --git a/Minecraft.World/WorldGen/Features/SandFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SandFeature.cpp similarity index 92% rename from Minecraft.World/WorldGen/Features/SandFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SandFeature.cpp index 00e3df65d..75d21c35c 100644 --- a/Minecraft.World/WorldGen/Features/SandFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SandFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "SandFeature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" SandFeature::SandFeature(int radius, int tile) { this->tile = tile; diff --git a/Minecraft.World/WorldGen/Features/SandFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SandFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/SandFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SandFeature.h diff --git a/Minecraft.World/WorldGen/Features/SpikeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpikeFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/SpikeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SpikeFeature.cpp index 69925079f..2a9213620 100644 --- a/Minecraft.World/WorldGen/Features/SpikeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpikeFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.boss.enderdragon.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../../entity/boss/enderdragon/net.minecraft.world.entity.boss.enderdragon.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "SpikeFeature.h" SpikeFeature::SpikeFeature(int tile) { diff --git a/Minecraft.World/WorldGen/Features/SpikeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpikeFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/SpikeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SpikeFeature.h diff --git a/Minecraft.World/WorldGen/Features/SpringFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpringFeature.cpp similarity index 92% rename from Minecraft.World/WorldGen/Features/SpringFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SpringFeature.cpp index 34906fd7e..57ed3809d 100644 --- a/Minecraft.World/WorldGen/Features/SpringFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpringFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "SpringFeature.h" SpringFeature::SpringFeature(int tile) { this->tile = tile; } diff --git a/Minecraft.World/WorldGen/Features/SpringFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpringFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/SpringFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SpringFeature.h diff --git a/Minecraft.World/WorldGen/Features/SpruceFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpruceFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/SpruceFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SpruceFeature.cpp index dba9aa12d..0aa4e531a 100644 --- a/Minecraft.World/WorldGen/Features/SpruceFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpruceFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "SpruceFeature.h" SpruceFeature::SpruceFeature(bool doUpdate) : Feature(doUpdate) {} diff --git a/Minecraft.World/WorldGen/Features/SpruceFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SpruceFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/SpruceFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SpruceFeature.h diff --git a/Minecraft.World/WorldGen/Features/SwampTreeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/SwampTreeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp index 31f1c621d..483007727 100644 --- a/Minecraft.World/WorldGen/Features/SwampTreeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "SwampTreeFeature.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Util/JavaMath.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" bool SwampTreeFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/Minecraft.World/WorldGen/Features/SwampTreeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/SwampTreeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.h diff --git a/Minecraft.World/WorldGen/Features/TallGrassFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/TallGrassFeature.cpp similarity index 85% rename from Minecraft.World/WorldGen/Features/TallGrassFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/TallGrassFeature.cpp index 1d848d5a5..7759847ee 100644 --- a/Minecraft.World/WorldGen/Features/TallGrassFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/TallGrassFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "TallGrassFeature.h" TallGrassFeature::TallGrassFeature(int tile, int type) { diff --git a/Minecraft.World/WorldGen/Features/TallGrassFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/TallGrassFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/TallGrassFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/TallGrassFeature.h diff --git a/Minecraft.World/WorldGen/Features/TreeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/TreeFeature.cpp similarity index 98% rename from Minecraft.World/WorldGen/Features/TreeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/TreeFeature.cpp index 13d3e8ecd..0f26410ee 100644 --- a/Minecraft.World/WorldGen/Features/TreeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/TreeFeature.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "TreeFeature.h" TreeFeature::TreeFeature(bool doUpdate) diff --git a/Minecraft.World/WorldGen/Features/TreeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/TreeFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/TreeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/TreeFeature.h diff --git a/Minecraft.World/WorldGen/Features/VinesFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/feature/VinesFeature.cpp similarity index 82% rename from Minecraft.World/WorldGen/Features/VinesFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/VinesFeature.cpp index 074c9e3f2..99b41cbe6 100644 --- a/Minecraft.World/WorldGen/Features/VinesFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/VinesFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../../../net.minecraft.h" #include "VinesFeature.h" VinesFeature::VinesFeature() {} diff --git a/Minecraft.World/WorldGen/Features/VinesFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/VinesFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/VinesFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/feature/VinesFeature.h diff --git a/Minecraft.World/net/minecraft/world/level/levelgen/feature/net.minecraft.world.level.levelgen.feature.h b/Minecraft.World/net/minecraft/world/level/levelgen/feature/net.minecraft.world.level.levelgen.feature.h new file mode 100644 index 000000000..46dea209b --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/levelgen/feature/net.minecraft.world.level.levelgen.feature.h @@ -0,0 +1,37 @@ +#pragma once + +#include "BasicTreeFeature.h" +#include "BirchFeature.h" +#include "CactusFeature.h" +#include "CaveFeature.h" +#include "ClayFeature.h" +#include "DeadBushFeature.h" +#include "Feature.h" +#include "FlowerFeature.h" +#include "HellFireFeature.h" +#include "HellPortalFeature.h" +#include "HellSpringFeature.h" +#include "HouseFeature.h" +#include "LakeFeature.h" +#include "LightGemFeature.h" +#include "MonsterRoomFeature.h" +#include "OreFeature.h" +#include "PineFeature.h" +#include "PumpkinFeature.h" +#include "ReedsFeature.h" +#include "SpringFeature.h" +#include "SpruceFeature.h" +#include "TallGrassFeature.h" +#include "TreeFeature.h" + +#include "HugeMushroomFeature.h" +#include "SandFeature.h" +#include "SwampTreeFeature.h" +#include "BonusChestFeature.h" +#include "SpikeFeature.h" +#include "EndPodiumFeature.h" + +#include "DesertWellFeature.h" +#include "MegaTreeFeature.h" +#include "VinesFeature.h" +#include "GroundBushFeature.h" \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.cpp similarity index 92% rename from Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.cpp index 9971645cc..419936550 100644 --- a/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/StringHelpers.h" -#include "../../Headers/net.minecraft.world.level.levelgen.flat.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleHelpers/StringHelpers.h" +#include "net.minecraft.world.level.levelgen.flat.h" +#include "../../tile/net.minecraft.world.level.tile.h" #include "FlatGeneratorInfo.h" const std::wstring FlatGeneratorInfo::STRUCTURE_VILLAGE = L"village"; diff --git a/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.h b/Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.h similarity index 100% rename from Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.h rename to Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.h diff --git a/Minecraft.World/WorldGen/Flat/FlatLayerInfo.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatLayerInfo.cpp similarity index 95% rename from Minecraft.World/WorldGen/Flat/FlatLayerInfo.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatLayerInfo.cpp index 0cf9bda2e..756797d8a 100644 --- a/Minecraft.World/WorldGen/Flat/FlatLayerInfo.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatLayerInfo.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "FlatLayerInfo.h" diff --git a/Minecraft.World/WorldGen/Flat/FlatLayerInfo.h b/Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatLayerInfo.h similarity index 100% rename from Minecraft.World/WorldGen/Flat/FlatLayerInfo.h rename to Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatLayerInfo.h diff --git a/Minecraft.World/net/minecraft/world/level/levelgen/flat/net.minecraft.world.level.levelgen.flat.h b/Minecraft.World/net/minecraft/world/level/levelgen/flat/net.minecraft.world.level.levelgen.flat.h new file mode 100644 index 000000000..92b8023c6 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/levelgen/flat/net.minecraft.world.level.levelgen.flat.h @@ -0,0 +1,4 @@ +#pragma once + +#include "FlatGeneratorInfo.h" +#include "FlatLayerInfo.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/world/level/levelgen/net.minecraft.world.level.levelgen.h b/Minecraft.World/net/minecraft/world/level/levelgen/net.minecraft.world.level.levelgen.h new file mode 100644 index 000000000..ea17a33c2 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/levelgen/net.minecraft.world.level.levelgen.h @@ -0,0 +1,15 @@ +#pragma once + +#include "CanyonFeature.h" +#include "DungeonFeature.h" +#include "HellRandomLevelSource.h" +#include "HellFlatLevelSource.h" +#include "LargeCaveFeature.h" +#include "LargeFeature.h" +#include "LargeHellCaveFeature.h" +#include "RandomLevelSource.h" +#include "FlatLevelSource.h" +#include "TownFeature.h" +#include "TheEndLevelRandomLevelSource.h" + +#include "CustomLevelSource.h" \ No newline at end of file diff --git a/Minecraft.World/Level/BlockGenMethods.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BlockGenMethods.cpp similarity index 97% rename from Minecraft.World/Level/BlockGenMethods.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/BlockGenMethods.cpp index 4c47ecdfe..2f47b5aff 100644 --- a/Minecraft.World/Level/BlockGenMethods.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BlockGenMethods.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../net.minecraft.h" +#include "../../net.minecraft.world.level.h" #include "BlockGenMethods.h" void BlockGenMethods::generateBox(Level* level, byteArray blocks, int sx, diff --git a/Minecraft.World/Level/BlockGenMethods.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BlockGenMethods.h similarity index 94% rename from Minecraft.World/Level/BlockGenMethods.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/BlockGenMethods.h index 5d84207b8..2e62430dd 100644 --- a/Minecraft.World/Level/BlockGenMethods.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BlockGenMethods.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../Util/ArrayWithLength.h" +#include "../../../../../../ConsoleHelpers/ArrayWithLength.h" class BlockGenMethods { public: diff --git a/Minecraft.World/Util/BoundingBox.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp similarity index 97% rename from Minecraft.World/Util/BoundingBox.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp index ebb442316..7a78a04ae 100644 --- a/Minecraft.World/Util/BoundingBox.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "BoundingBox.h" -#include "Direction.h" -#include "JavaMath.h" +#include "../../../../Direction.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" BoundingBox::BoundingBox() { // 4J added initialisers diff --git a/Minecraft.World/Util/BoundingBox.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.h similarity index 94% rename from Minecraft.World/Util/BoundingBox.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.h index 11ba91ddf..9d57f09f0 100644 --- a/Minecraft.World/Util/BoundingBox.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.h @@ -1,6 +1,6 @@ #pragma once -#include "ArrayWithLength.h" +#include "../../../../../../ConsoleHelpers/ArrayWithLength.h" class BoundingBox { public: diff --git a/Minecraft.World/WorldGen/Features/MineShaftFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp similarity index 85% rename from Minecraft.World/WorldGen/Features/MineShaftFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp index 74a3c9c5f..595ec0e45 100644 --- a/Minecraft.World/WorldGen/Features/MineShaftFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Util/JavaMath.h" -#include "../../Util/Mth.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../../util/Mth.h" const std::wstring MineShaftFeature::OPTION_CHANCE = L"chance"; diff --git a/Minecraft.World/WorldGen/Features/MineShaftFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.h similarity index 100% rename from Minecraft.World/WorldGen/Features/MineShaftFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.h diff --git a/Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp similarity index 98% rename from Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp index 216958a2c..37b947ca0 100644 --- a/Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Util/JavaMath.h" -#include "../../Util/WeighedTreasure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../entity/item/net.minecraft.world.entity.item.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../../util/WeighedTreasure.h" #include "MineShaftPieces.h" WeighedTreasureArray MineShaftPieces::smallTreasureItems; diff --git a/Minecraft.World/WorldGen/Structures/MineShaftPieces.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/MineShaftPieces.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.h diff --git a/Minecraft.World/WorldGen/Structures/MineShaftStart.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftStart.cpp similarity index 84% rename from Minecraft.World/WorldGen/Structures/MineShaftStart.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftStart.cpp index 465a30804..eadba49dc 100644 --- a/Minecraft.World/WorldGen/Structures/MineShaftStart.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftStart.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.levelgen.structure.h" MineShaftStart::MineShaftStart() { // for reflection diff --git a/Minecraft.World/WorldGen/Structures/MineShaftStart.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftStart.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/MineShaftStart.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftStart.h diff --git a/Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgeFeature.cpp similarity index 92% rename from Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgeFeature.cpp index ceeff64de..8edcf49b1 100644 --- a/Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgeFeature.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../Biomes/Biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/Biome.h" #include "NetherBridgeFeature.h" -#include "../Structures/NetherBridgePieces.h" -#include "../../Blocks/MobSpawner.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "NetherBridgePieces.h" +#include "../../MobSpawner.h" +#include "../../../entity/monster/net.minecraft.world.entity.monster.h" +#include "../../net.minecraft.world.level.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" NetherBridgeFeature::NetherBridgeFeature() : StructureFeature() { bridgeEnemies.push_back(new Biome::MobSpawnerData(eTYPE_BLAZE, 10, 2, 3)); diff --git a/Minecraft.World/WorldGen/Features/NetherBridgeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgeFeature.h similarity index 93% rename from Minecraft.World/WorldGen/Features/NetherBridgeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgeFeature.h index 560c74b19..25956a2b9 100644 --- a/Minecraft.World/WorldGen/Features/NetherBridgeFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgeFeature.h @@ -1,7 +1,7 @@ #pragma once #include "StructureFeature.h" -#include "../Structures/StructureStart.h" -#include "../Biomes/Biome.h" +#include "StructureStart.h" +#include "../../biome/Biome.h" class Random; class NetherBridgeFeature : public StructureFeature { diff --git a/Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgePieces.cpp similarity index 99% rename from Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgePieces.cpp index 47e003124..e57a4dd3d 100644 --- a/Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgePieces.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Util/WeighedTreasure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../net.minecraft.world.level.levelgen.h" +#include "../../storage/net.minecraft.world.level.storage.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../../../util/WeighedTreasure.h" #include "NetherBridgePieces.h" -#include "../../Util/Direction.h" +#include "../../../../Direction.h" void NetherBridgePieces::loadStatic() { StructureFeatureIO::setPieceId(eStructurePiece_BridgeCrossing, diff --git a/Minecraft.World/WorldGen/Structures/NetherBridgePieces.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgePieces.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/NetherBridgePieces.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/NetherBridgePieces.h diff --git a/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/RandomScatteredLargeFeature.cpp similarity index 94% rename from Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/RandomScatteredLargeFeature.cpp index e8e9c7d2a..2cd240be8 100644 --- a/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/RandomScatteredLargeFeature.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../Structures/ScatteredFeaturePieces.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "ScatteredFeaturePieces.h" #include "RandomScatteredLargeFeature.h" const std::wstring RandomScatteredLargeFeature::OPTION_SPACING = L"distance"; diff --git a/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/RandomScatteredLargeFeature.h similarity index 96% rename from Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/RandomScatteredLargeFeature.h index 565d9763d..41f07fec0 100644 --- a/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/RandomScatteredLargeFeature.h @@ -1,7 +1,7 @@ #pragma once #include "StructureFeature.h" -#include "../Structures/StructureStart.h" +#include "StructureStart.h" class RandomScatteredLargeFeature : public StructureFeature { public: diff --git a/Minecraft.World/WorldGen/Structures/ScatteredFeaturePieces.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePieces.cpp similarity index 98% rename from Minecraft.World/WorldGen/Structures/ScatteredFeaturePieces.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePieces.cpp index aea34d0cd..5bdced3dc 100644 --- a/Minecraft.World/WorldGen/Structures/ScatteredFeaturePieces.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePieces.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.entity.monster.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Util/WeighedTreasure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../net.minecraft.h" +#include "../../../entity/monster/net.minecraft.world.entity.monster.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../../../util/WeighedTreasure.h" #include "ScatteredFeaturePieces.h" void ScatteredFeaturePieces::loadStatic() { diff --git a/Minecraft.World/WorldGen/Structures/ScatteredFeaturePieces.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePieces.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/ScatteredFeaturePieces.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/ScatteredFeaturePieces.h diff --git a/Minecraft.World/Level/Dimensions/SkyIslandDimension.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp similarity index 82% rename from Minecraft.World/Level/Dimensions/SkyIslandDimension.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp index 56b7d1b76..fe3ac136c 100644 --- a/Minecraft.World/Level/Dimensions/SkyIslandDimension.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "SkyIslandDimension.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" +#include "../../net.minecraft.world.level.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.level.levelgen.h" void SkyIslandDimension::init() { biomeSource = new FixedBiomeSource(Biome::sky, 0.5f, 0); diff --git a/Minecraft.World/WorldGen/Features/StrongholdFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/StrongholdFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp index 29ec6c3a9..23060c63d 100644 --- a/Minecraft.World/WorldGen/Features/StrongholdFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "StrongholdFeature.h" -#include "../Structures/StrongholdPieces.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Util/Mth.h" -#include "../../IO/Files/FileHeader.h" -#include "../../Util/JavaMath.h" +#include "StrongholdPieces.h" +#include "../../net.minecraft.world.level.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" +#include "../../../../util/Mth.h" +#include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" const std::wstring StrongholdFeature::OPTION_DISTANCE = L"distance"; const std::wstring StrongholdFeature::OPTION_COUNT = L"count"; diff --git a/Minecraft.World/WorldGen/Features/StrongholdFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.h similarity index 95% rename from Minecraft.World/WorldGen/Features/StrongholdFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.h index 7c2114572..83847734f 100644 --- a/Minecraft.World/WorldGen/Features/StrongholdFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.h @@ -3,9 +3,9 @@ class Biome; #include "StructureFeature.h" -#include "../Structures/StructureStart.h" +#include "StructureStart.h" -#include "../../Level/ChunkPos.h" +#include "../../ChunkPos.h" // 4J Stu Added // We can get away with a few more attempts on new-gen consoles diff --git a/Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdPieces.cpp similarity index 99% rename from Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdPieces.cpp index dd35a16d8..0807bc1c3 100644 --- a/Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdPieces.cpp @@ -1,15 +1,15 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "StrongholdPieces.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Util/WeighedTreasure.h" -#include "../../IO/Files/FileHeader.h" -#include "../../Util/Facing.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../storage/net.minecraft.world.level.storage.h" +#include "../net.minecraft.world.level.levelgen.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../../util/WeighedTreasure.h" +#include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h" +#include "../../../../Facing.h" int StrongholdPieces::totalWeight = 0; std::list StrongholdPieces::currentPieces; diff --git a/Minecraft.World/WorldGen/Structures/StrongholdPieces.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdPieces.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/StrongholdPieces.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdPieces.h diff --git a/Minecraft.World/WorldGen/Features/StructureFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.cpp similarity index 97% rename from Minecraft.World/WorldGen/Features/StructureFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.cpp index 749990f5b..87a5be4e0 100644 --- a/Minecraft.World/WorldGen/Features/StructureFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "StructureFeature.h" -#include "../Structures/StructureStart.h" -#include "../Structures/StructurePiece.h" -#include "../../Level/ChunkPos.h" -#include "../../Util/BoundingBox.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Level/LevelData.h" +#include "StructureStart.h" +#include "StructurePiece.h" +#include "../../ChunkPos.h" +#include "BoundingBox.h" +#include "../../net.minecraft.world.level.h" +#include "../../storage/LevelData.h" StructureFeature::StructureFeature() { #ifdef ENABLE_STRUCTURE_SAVING diff --git a/Minecraft.World/WorldGen/Features/StructureFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h similarity index 96% rename from Minecraft.World/WorldGen/Features/StructureFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h index c00efbd20..3ad27f63b 100644 --- a/Minecraft.World/WorldGen/Features/StructureFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h @@ -1,6 +1,6 @@ #pragma once -#include "LargeFeature.h" -#include "../StructureFeatureSavedData.h" +#include "../LargeFeature.h" +#include "StructureFeatureSavedData.h" class StructureStart; diff --git a/Minecraft.World/WorldGen/StructureFeatureIO.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.cpp similarity index 96% rename from Minecraft.World/WorldGen/StructureFeatureIO.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.cpp index 7a35abb98..f303546d7 100644 --- a/Minecraft.World/WorldGen/StructureFeatureIO.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.levelgen.structure.h" #include "StructureFeatureIO.h" std::unordered_map diff --git a/Minecraft.World/WorldGen/StructureFeatureIO.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.h similarity index 100% rename from Minecraft.World/WorldGen/StructureFeatureIO.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.h diff --git a/Minecraft.World/WorldGen/StructureFeatureSavedData.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureSavedData.cpp similarity index 96% rename from Minecraft.World/WorldGen/StructureFeatureSavedData.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureSavedData.cpp index 32d3b10fd..e4b657c20 100644 --- a/Minecraft.World/WorldGen/StructureFeatureSavedData.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureSavedData.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "StructureFeatureSavedData.h" diff --git a/Minecraft.World/WorldGen/StructureFeatureSavedData.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureSavedData.h similarity index 92% rename from Minecraft.World/WorldGen/StructureFeatureSavedData.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureSavedData.h index 6dec5e561..595e1c5dd 100644 --- a/Minecraft.World/WorldGen/StructureFeatureSavedData.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureSavedData.h @@ -1,6 +1,6 @@ #pragma once -#include "../Level/Storage/SavedData.h" +#include "../../saveddata/SavedData.h" class StructureFeatureSavedData : public SavedData { private: diff --git a/Minecraft.World/WorldGen/Structures/StructurePiece.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp similarity index 97% rename from Minecraft.World/WorldGen/Structures/StructurePiece.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp index e8bc97499..ed90d75ac 100644 --- a/Minecraft.World/WorldGen/Structures/StructurePiece.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Util/WeighedTreasure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../net.minecraft.world.level.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../../material/net.minecraft.world.level.material.h" +#include "../../tile/entity/net.minecraft.world.level.tile.entity.h" +#include "../../../entity/net.minecraft.world.entity.h" +#include "../../../../util/WeighedTreasure.h" #include "StructurePiece.h" -#include "../../Util/BoundingBox.h" -#include "../../Util/Direction.h" -#include "../../Util/JavaMath.h" -#include "../../Util/Facing.h" -#include "../../Items/DoorItem.h" +#include "BoundingBox.h" +#include "../../../../Direction.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../../Facing.h" +#include "../../../item/DoorItem.h" /** * diff --git a/Minecraft.World/WorldGen/Structures/StructurePiece.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h similarity index 98% rename from Minecraft.World/WorldGen/Structures/StructurePiece.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h index 100919a17..f571d9d78 100644 --- a/Minecraft.World/WorldGen/Structures/StructurePiece.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Util/WeighedRandom.h" -#include "../../Util/BoundingBox.h" -#include "../StructureFeatureIO.h" +#include "../../../../util/WeighedRandom.h" +#include "BoundingBox.h" +#include "StructureFeatureIO.h" class Level; class Random; diff --git a/Minecraft.World/WorldGen/Structures/StructureStart.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureStart.cpp similarity index 95% rename from Minecraft.World/WorldGen/Structures/StructureStart.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureStart.cpp index 17457f0e7..099733c0e 100644 --- a/Minecraft.World/WorldGen/Structures/StructureStart.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureStart.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "net.minecraft.world.level.levelgen.structure.h" #include "StructureStart.h" #include "StructurePiece.h" -#include "../../Util/BoundingBox.h" +#include "BoundingBox.h" StructureStart::StructureStart() { chunkX = chunkZ = 0; diff --git a/Minecraft.World/WorldGen/Structures/StructureStart.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureStart.h similarity index 96% rename from Minecraft.World/WorldGen/Structures/StructureStart.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureStart.h index 11e682228..e2f9baf56 100644 --- a/Minecraft.World/WorldGen/Structures/StructureStart.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureStart.h @@ -2,7 +2,7 @@ class StructurePiece; class BoundingBox; -#include "../StructureFeatureIO.h" +#include "StructureFeatureIO.h" class StructureStart { public: diff --git a/Minecraft.World/WorldGen/Features/VillageFeature.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillageFeature.cpp similarity index 95% rename from Minecraft.World/WorldGen/Features/VillageFeature.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/VillageFeature.cpp index 1bb95f735..18303d3a7 100644 --- a/Minecraft.World/WorldGen/Features/VillageFeature.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillageFeature.cpp @@ -1,9 +1,9 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "VillageFeature.h" -#include "../Structures/VillagePieces.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "VillagePieces.h" +#include "../../net.minecraft.world.level.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" const std::wstring VillageFeature::OPTION_SIZE_MODIFIER = L"size"; const std::wstring VillageFeature::OPTION_SPACING = L"distance"; diff --git a/Minecraft.World/WorldGen/Features/VillageFeature.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillageFeature.h similarity index 97% rename from Minecraft.World/WorldGen/Features/VillageFeature.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/VillageFeature.h index 97b21a781..a89bf7ef4 100644 --- a/Minecraft.World/WorldGen/Features/VillageFeature.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillageFeature.h @@ -1,6 +1,6 @@ #pragma once #include "StructureFeature.h" -#include "../Structures/StructureStart.h" +#include "StructureStart.h" class Biome; class VillageFeature : public StructureFeature { diff --git a/Minecraft.World/WorldGen/Structures/VillagePieces.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp similarity index 99% rename from Minecraft.World/WorldGen/Structures/VillagePieces.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp index 2b9f3dcaa..3ab843dbb 100644 --- a/Minecraft.World/WorldGen/Structures/VillagePieces.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp @@ -1,19 +1,19 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.levelgen.h" -#include "../../Headers/net.minecraft.world.level.levelgen.structure.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/net.minecraft.world.entity.npc.h" -#include "../../Util/WeighedTreasure.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../net.minecraft.h" +#include "../../net.minecraft.world.level.h" +#include "../../storage/net.minecraft.world.level.storage.h" +#include "../../tile/net.minecraft.world.level.tile.h" +#include "../net.minecraft.world.level.levelgen.h" +#include "net.minecraft.world.level.levelgen.structure.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" +#include "../../../entity/npc/net.minecraft.world.entity.npc.h" +#include "../../../../util/WeighedTreasure.h" #include "VillagePieces.h" -#include "../Features/VillageFeature.h" -#include "../../Util/Direction.h" -#include "../../Util/JavaMath.h" -#include "../Biomes/BiomeSource.h" +#include "VillageFeature.h" +#include "../../../../Direction.h" +#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../biome/BiomeSource.h" WeighedTreasureArray VillagePieces::Smithy::treasureItems; diff --git a/Minecraft.World/WorldGen/Structures/VillagePieces.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.h similarity index 100% rename from Minecraft.World/WorldGen/Structures/VillagePieces.h rename to Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.h diff --git a/Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h b/Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h new file mode 100644 index 000000000..e7dae5ead --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/levelgen/structure/net.minecraft.world.level.levelgen.structure.h @@ -0,0 +1,20 @@ +#pragma once + +#include "BlockGenMethods.h" +#include "BoundingBox.h" +#include "MineShaftFeature.h" +#include "MineShaftPieces.h" +#include "MineShaftStart.h" +#include "NetherBridgeFeature.h" +#include "NetherBridgePieces.h" +#include "StrongholdFeature.h" +#include "StrongholdPieces.h" +#include "StructureFeature.h" +#include "StructureFeatureIO.h" +#include "StructureFeatureSavedData.h" +#include "StructurePiece.h" +#include "StructureStart.h" +#include "VillageFeature.h" +#include "VillagePieces.h" +#include "RandomScatteredLargeFeature.h" +#include "ScatteredFeaturePieces.h" \ No newline at end of file diff --git a/Minecraft.World/Util/Distort.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Distort.cpp similarity index 82% rename from Minecraft.World/Util/Distort.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Distort.cpp index 31917e09f..5353abe45 100644 --- a/Minecraft.World/Util/Distort.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Distort.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Distort.h" Distort::Distort(Synth* source, Synth* distort) { diff --git a/Minecraft.World/Util/Distort.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Distort.h similarity index 84% rename from Minecraft.World/Util/Distort.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Distort.h index 3dfaac7cc..ada214263 100644 --- a/Minecraft.World/Util/Distort.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Distort.h @@ -1,5 +1,5 @@ #pragma once -#include "../WorldGen/Noise/Synth.h" +#include "Synth.h" class Distort : public Synth { private: diff --git a/Minecraft.World/Util/Emboss.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Emboss.cpp similarity index 78% rename from Minecraft.World/Util/Emboss.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Emboss.cpp index ddd31f8a2..c7ef816ec 100644 --- a/Minecraft.World/Util/Emboss.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Emboss.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Emboss.h" Emboss::Emboss(Synth* synth) { this->synth = synth; } diff --git a/Minecraft.World/Util/Emboss.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Emboss.h similarity index 81% rename from Minecraft.World/Util/Emboss.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Emboss.h index a62e244f4..a69f0632a 100644 --- a/Minecraft.World/Util/Emboss.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Emboss.h @@ -1,5 +1,5 @@ #pragma once -#include "../WorldGen/Noise/Synth.h" +#include "Synth.h" class Emboss : public Synth { private: diff --git a/Minecraft.World/WorldGen/Noise/FastNoise.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/FastNoise.cpp similarity index 98% rename from Minecraft.World/WorldGen/Noise/FastNoise.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/FastNoise.cpp index 1b44de282..49cb1144c 100644 --- a/Minecraft.World/WorldGen/Noise/FastNoise.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/FastNoise.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "FastNoise.h" FastNoise::FastNoise(int levels) { diff --git a/Minecraft.World/WorldGen/Noise/FastNoise.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/FastNoise.h similarity index 100% rename from Minecraft.World/WorldGen/Noise/FastNoise.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/FastNoise.h diff --git a/Minecraft.World/WorldGen/Noise/ImprovedNoise.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/ImprovedNoise.cpp similarity index 99% rename from Minecraft.World/WorldGen/Noise/ImprovedNoise.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/ImprovedNoise.cpp index ffc16f4fa..4ece4a30b 100644 --- a/Minecraft.World/WorldGen/Noise/ImprovedNoise.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/ImprovedNoise.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "ImprovedNoise.h" ImprovedNoise::ImprovedNoise() { diff --git a/Minecraft.World/WorldGen/Noise/ImprovedNoise.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/ImprovedNoise.h similarity index 100% rename from Minecraft.World/WorldGen/Noise/ImprovedNoise.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/ImprovedNoise.h diff --git a/Minecraft.World/WorldGen/Noise/PerlinNoise.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp similarity index 96% rename from Minecraft.World/WorldGen/Noise/PerlinNoise.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp index 2f4db10ae..7ef6d9b9f 100644 --- a/Minecraft.World/WorldGen/Noise/PerlinNoise.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "PerlinNoise.h" -#include "../../Util/Mth.h" +#include "../../../../util/Mth.h" PerlinNoise::PerlinNoise(int levels) { Random random; diff --git a/Minecraft.World/WorldGen/Noise/PerlinNoise.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.h similarity index 100% rename from Minecraft.World/WorldGen/Noise/PerlinNoise.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.h diff --git a/Minecraft.World/WorldGen/Noise/PerlinSimplexNoise.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp similarity index 98% rename from Minecraft.World/WorldGen/Noise/PerlinSimplexNoise.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp index 40d2f10f3..73743c5c0 100644 --- a/Minecraft.World/WorldGen/Noise/PerlinSimplexNoise.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "PerlinSimplexNoise.h" PerlinSimplexNoise::PerlinSimplexNoise(int levels) { diff --git a/Minecraft.World/WorldGen/Noise/PerlinSimplexNoise.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.h similarity index 100% rename from Minecraft.World/WorldGen/Noise/PerlinSimplexNoise.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.h diff --git a/Minecraft.World/Util/Rotate.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Rotate.cpp similarity index 83% rename from Minecraft.World/Util/Rotate.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Rotate.cpp index 2b4d10bce..4490f5268 100644 --- a/Minecraft.World/Util/Rotate.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Rotate.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Rotate.h" Rotate::Rotate(Synth* synth, float angle) { diff --git a/Minecraft.World/Util/Rotate.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Rotate.h similarity index 84% rename from Minecraft.World/Util/Rotate.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Rotate.h index 02a7806e5..daffc56ee 100644 --- a/Minecraft.World/Util/Rotate.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Rotate.h @@ -1,5 +1,5 @@ #pragma once -#include "../WorldGen/Noise/Synth.h" +#include "Synth.h" class Rotate : public Synth { private: diff --git a/Minecraft.World/Util/Scale.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Scale.cpp similarity index 84% rename from Minecraft.World/Util/Scale.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Scale.cpp index 45c55054d..582536e6a 100644 --- a/Minecraft.World/Util/Scale.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Scale.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Scale.h" Scale::Scale(Synth* synth, double xScale, double yScale) { diff --git a/Minecraft.World/Util/Scale.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Scale.h similarity index 85% rename from Minecraft.World/Util/Scale.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Scale.h index dce37b00e..d7d306581 100644 --- a/Minecraft.World/Util/Scale.h +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Scale.h @@ -1,5 +1,5 @@ #pragma once -#include "../WorldGen/Noise/Synth.h" +#include "Synth.h" class Scale : public Synth { private: diff --git a/Minecraft.World/WorldGen/Noise/SimplexNoise.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/SimplexNoise.cpp similarity index 99% rename from Minecraft.World/WorldGen/Noise/SimplexNoise.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/SimplexNoise.cpp index e505d3622..2911b0c07 100644 --- a/Minecraft.World/WorldGen/Noise/SimplexNoise.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/SimplexNoise.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "SimplexNoise.h" int SimplexNoise::grad3[12][3] = { diff --git a/Minecraft.World/WorldGen/Noise/SimplexNoise.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/SimplexNoise.h similarity index 100% rename from Minecraft.World/WorldGen/Noise/SimplexNoise.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/SimplexNoise.h diff --git a/Minecraft.World/WorldGen/Noise/Synth.cpp b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Synth.cpp similarity index 85% rename from Minecraft.World/WorldGen/Noise/Synth.cpp rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Synth.cpp index aa1ebc6d5..0eacc8099 100644 --- a/Minecraft.World/WorldGen/Noise/Synth.cpp +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Synth.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "Synth.h" doubleArray Synth::create(int width, int height) { diff --git a/Minecraft.World/WorldGen/Noise/Synth.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/Synth.h similarity index 100% rename from Minecraft.World/WorldGen/Noise/Synth.h rename to Minecraft.World/net/minecraft/world/level/levelgen/synth/Synth.h diff --git a/Minecraft.World/net/minecraft/world/level/levelgen/synth/net.minecraft.world.level.levelgen.synth.h b/Minecraft.World/net/minecraft/world/level/levelgen/synth/net.minecraft.world.level.levelgen.synth.h new file mode 100644 index 000000000..a0f5bf1fa --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/levelgen/synth/net.minecraft.world.level.levelgen.synth.h @@ -0,0 +1,12 @@ +#pragma once + +#include "Distort.h" +#include "Emboss.h" +#include "FastNoise.h" +#include "ImprovedNoise.h" +#include "PerlinNoise.h" +#include "PerlinSimplexNoise.h" +#include "Rotate.h" +#include "Scale.h" +#include "SimplexNoise.h" +#include "Synth.h" \ No newline at end of file diff --git a/Minecraft.World/Blocks/DecorationMaterial.h b/Minecraft.World/net/minecraft/world/level/material/DecorationMaterial.h similarity index 100% rename from Minecraft.World/Blocks/DecorationMaterial.h rename to Minecraft.World/net/minecraft/world/level/material/DecorationMaterial.h diff --git a/Minecraft.World/Blocks/GasMaterial.h b/Minecraft.World/net/minecraft/world/level/material/GasMaterial.h similarity index 100% rename from Minecraft.World/Blocks/GasMaterial.h rename to Minecraft.World/net/minecraft/world/level/material/GasMaterial.h diff --git a/Minecraft.World/Blocks/LiquidMaterial.h b/Minecraft.World/net/minecraft/world/level/material/LiquidMaterial.h similarity index 100% rename from Minecraft.World/Blocks/LiquidMaterial.h rename to Minecraft.World/net/minecraft/world/level/material/LiquidMaterial.h diff --git a/Minecraft.World/Blocks/Material.cpp b/Minecraft.World/net/minecraft/world/level/material/Material.cpp similarity index 99% rename from Minecraft.World/Blocks/Material.cpp rename to Minecraft.World/net/minecraft/world/level/material/Material.cpp index d80d9ae91..5b5a63f73 100644 --- a/Minecraft.World/Blocks/Material.cpp +++ b/Minecraft.World/net/minecraft/world/level/material/Material.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "Material.h" #include "DecorationMaterial.h" #include "GasMaterial.h" diff --git a/Minecraft.World/Blocks/Material.h b/Minecraft.World/net/minecraft/world/level/material/Material.h similarity index 100% rename from Minecraft.World/Blocks/Material.h rename to Minecraft.World/net/minecraft/world/level/material/Material.h diff --git a/Minecraft.World/Blocks/MaterialColor.cpp b/Minecraft.World/net/minecraft/world/level/material/MaterialColor.cpp similarity index 97% rename from Minecraft.World/Blocks/MaterialColor.cpp rename to Minecraft.World/net/minecraft/world/level/material/MaterialColor.cpp index 2b4fd5e34..fcf15b261 100644 --- a/Minecraft.World/Blocks/MaterialColor.cpp +++ b/Minecraft.World/net/minecraft/world/level/material/MaterialColor.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "MaterialColor.h" MaterialColor** MaterialColor::colors; diff --git a/Minecraft.World/Blocks/MaterialColor.h b/Minecraft.World/net/minecraft/world/level/material/MaterialColor.h similarity index 100% rename from Minecraft.World/Blocks/MaterialColor.h rename to Minecraft.World/net/minecraft/world/level/material/MaterialColor.h diff --git a/Minecraft.World/Blocks/PortalMaterial.h b/Minecraft.World/net/minecraft/world/level/material/PortalMaterial.h similarity index 100% rename from Minecraft.World/Blocks/PortalMaterial.h rename to Minecraft.World/net/minecraft/world/level/material/PortalMaterial.h diff --git a/Minecraft.World/Blocks/WebMaterial.h b/Minecraft.World/net/minecraft/world/level/material/WebMaterial.h similarity index 100% rename from Minecraft.World/Blocks/WebMaterial.h rename to Minecraft.World/net/minecraft/world/level/material/WebMaterial.h diff --git a/Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h b/Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h new file mode 100644 index 000000000..173ac53a1 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h @@ -0,0 +1,8 @@ +#pragma once + +#include "DecorationMaterial.h" +#include "GasMaterial.h" +#include "LiquidMaterial.h" +#include "Material.h" +#include "MaterialColor.h" +#include "PortalMaterial.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h b/Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h new file mode 100644 index 000000000..e69d423b4 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h @@ -0,0 +1,26 @@ +#pragma once + +#include "BaseMobSpawner.h" +#include "BlockDestructionProgress.h" +#include "ChunkPos.h" +#include "Coord.h" +#include "Explosion.h" +#include "FoliageColor.h" +#include "GameRules.h" +#include "GrassColor.h" +#include "LevelConflictException.h" +#include "LevelListener.h" +#include "LevelSource.h" +#include "LightLayer.h" +#include "MobSpawner.h" +#include "PortalForcer.h" +#include "Region.h" +#include "TickNextTickData.h" +#include "TileEventData.h" +#include "TilePos.h" +#include "WaterColor.h" +#include "Level.h" +#include "LevelType.h" +#include "LevelSettings.h" + +#include "Calendar.h" \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddIslandLayer.cpp similarity index 92% rename from Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/AddIslandLayer.cpp index deee6c325..5cd12e760 100644 --- a/Minecraft.World/WorldGen/Layers/AddIslandLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddIslandLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../biome/net.minecraft.world.level.biome.h" AddIslandLayer::AddIslandLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/AddIslandLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddIslandLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/AddIslandLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/AddIslandLayer.h diff --git a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddMushroomIslandLayer.cpp similarity index 87% rename from Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/AddMushroomIslandLayer.cpp index f1cf6cafb..a7733b917 100644 --- a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddMushroomIslandLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../biome/net.minecraft.world.level.biome.h" AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent) diff --git a/Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddMushroomIslandLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/AddMushroomIslandLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/AddMushroomIslandLayer.h diff --git a/Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddSnowLayer.cpp similarity index 84% rename from Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/AddSnowLayer.cpp index d8491787b..7726a00e7 100644 --- a/Minecraft.World/WorldGen/Layers/AddSnowLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddSnowLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../biome/net.minecraft.world.level.biome.h" AddSnowLayer::AddSnowLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/AddSnowLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/AddSnowLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/AddSnowLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/AddSnowLayer.h diff --git a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeInitLayer.cpp similarity index 89% rename from Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeInitLayer.cpp index 005a9b25b..b9cc9be6e 100644 --- a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeInitLayer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../net.minecraft.world.level.h" #include "BiomeInitLayer.h" BiomeInitLayer::BiomeInitLayer(int64_t seed, std::shared_ptr parent, diff --git a/Minecraft.World/WorldGen/Layers/BiomeInitLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeInitLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/BiomeInitLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeInitLayer.h diff --git a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp similarity index 91% rename from Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp index eb0dc5cd1..413f2e701 100644 --- a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../net.minecraft.world.level.h" #include "BiomeOverrideLayer.h" BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.h diff --git a/Minecraft.World/WorldGen/Layers/DownfallLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallLayer.cpp similarity index 71% rename from Minecraft.World/WorldGen/Layers/DownfallLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallLayer.cpp index b89d2491c..973db7a67 100644 --- a/Minecraft.World/WorldGen/Layers/DownfallLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" DownfallLayer::DownfallLayer(std::shared_ptr parent) : Layer(0) { this->parent = parent; diff --git a/Minecraft.World/WorldGen/Layers/DownfallLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/DownfallLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallLayer.h diff --git a/Minecraft.World/WorldGen/Layers/DownfallMixerLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallMixerLayer.cpp similarity index 79% rename from Minecraft.World/WorldGen/Layers/DownfallMixerLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallMixerLayer.cpp index af2734425..8a3f94ce2 100644 --- a/Minecraft.World/WorldGen/Layers/DownfallMixerLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallMixerLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" DownfallMixerLayer::DownfallMixerLayer(std::shared_ptr downfall, std::shared_ptr parent, int layer) diff --git a/Minecraft.World/WorldGen/Layers/DownfallMixerLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallMixerLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/DownfallMixerLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/DownfallMixerLayer.h diff --git a/Minecraft.World/WorldGen/Layers/FlatLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/FlatLayer.cpp similarity index 75% rename from Minecraft.World/WorldGen/Layers/FlatLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/FlatLayer.cpp index 6685eb518..c87f07287 100644 --- a/Minecraft.World/WorldGen/Layers/FlatLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/FlatLayer.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" FlatLayer::FlatLayer(int val) : Layer(0) { this->val = val; } diff --git a/Minecraft.World/WorldGen/Layers/FlatLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/FlatLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/FlatLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/FlatLayer.h diff --git a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp similarity index 93% rename from Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp index 005c77408..dff37e1ad 100644 --- a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Platform/System.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../ConsoleJavaLibs/System.h" +#include "net.minecraft.world.level.newbiome.layer.h" FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/FuzzyZoomLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.h diff --git a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/GrowMushroomIslandLayer.cpp similarity index 87% rename from Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/GrowMushroomIslandLayer.cpp index 0b45d2785..13d89575a 100644 --- a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/GrowMushroomIslandLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../biome/net.minecraft.world.level.biome.h" GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent) diff --git a/Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/GrowMushroomIslandLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/GrowMushroomIslandLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/GrowMushroomIslandLayer.h diff --git a/Minecraft.World/WorldGen/Layers/IslandLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/IslandLayer.cpp similarity index 83% rename from Minecraft.World/WorldGen/Layers/IslandLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/IslandLayer.cpp index fea672e79..23c5b84b5 100644 --- a/Minecraft.World/WorldGen/Layers/IslandLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/IslandLayer.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" IslandLayer::IslandLayer(int64_t seedMixup) : Layer(seedMixup) {} diff --git a/Minecraft.World/WorldGen/Layers/IslandLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/IslandLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/IslandLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/IslandLayer.h diff --git a/Minecraft.World/WorldGen/Layers/Layer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/Layer.cpp similarity index 97% rename from Minecraft.World/WorldGen/Layers/Layer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/Layer.cpp index cd97198b9..46435f591 100644 --- a/Minecraft.World/WorldGen/Layers/Layer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/Layer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../net.minecraft.world.level.h" #include "BiomeOverrideLayer.h" LayerArray Layer::getDefaultLayers(int64_t seed, LevelType* levelType) { diff --git a/Minecraft.World/WorldGen/Layers/Layer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/Layer.h similarity index 89% rename from Minecraft.World/WorldGen/Layers/Layer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/Layer.h index 84b34fc9c..ade815820 100644 --- a/Minecraft.World/WorldGen/Layers/Layer.h +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/Layer.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Util/ArrayWithLength.h" +#include "../../../../../../ConsoleHelpers/ArrayWithLength.h" class LevelType; diff --git a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RegionHillsLayer.cpp similarity index 94% rename from Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RegionHillsLayer.cpp index e1d922325..199ddf1df 100644 --- a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RegionHillsLayer.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" #include "RegionHillsLayer.h" RegionHillsLayer::RegionHillsLayer(int64_t seed, std::shared_ptr parent) diff --git a/Minecraft.World/WorldGen/Layers/RegionHillsLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RegionHillsLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/RegionHillsLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RegionHillsLayer.h diff --git a/Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverInitLayer.cpp similarity index 83% rename from Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverInitLayer.cpp index 7ccf2cc4a..d009b03d3 100644 --- a/Minecraft.World/WorldGen/Layers/RiverInitLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverInitLayer.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" RiverInitLayer::RiverInitLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { diff --git a/Minecraft.World/WorldGen/Layers/RiverInitLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverInitLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/RiverInitLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverInitLayer.h diff --git a/Minecraft.World/WorldGen/Layers/RiverLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverLayer.cpp similarity index 85% rename from Minecraft.World/WorldGen/Layers/RiverLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverLayer.cpp index fcd93e3af..e690dae7a 100644 --- a/Minecraft.World/WorldGen/Layers/RiverLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" RiverLayer::RiverLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/RiverLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/RiverLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverLayer.h diff --git a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverMixerLayer.cpp similarity index 90% rename from Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverMixerLayer.cpp index c2dc12e10..4b022dad6 100644 --- a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverMixerLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" RiverMixerLayer::RiverMixerLayer(int64_t seed, std::shared_ptr biomes, std::shared_ptr rivers) diff --git a/Minecraft.World/WorldGen/Layers/RiverMixerLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverMixerLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/RiverMixerLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/RiverMixerLayer.h diff --git a/Minecraft.World/WorldGen/Layers/ShoreLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/ShoreLayer.cpp similarity index 94% rename from Minecraft.World/WorldGen/Layers/ShoreLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/ShoreLayer.cpp index a4bfc420c..ca273653e 100644 --- a/Minecraft.World/WorldGen/Layers/ShoreLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/ShoreLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../biome/net.minecraft.world.level.biome.h" ShoreLayer::ShoreLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { diff --git a/Minecraft.World/WorldGen/Layers/ShoreLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/ShoreLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/ShoreLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/ShoreLayer.h diff --git a/Minecraft.World/WorldGen/Layers/SmoothLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothLayer.cpp similarity index 91% rename from Minecraft.World/WorldGen/Layers/SmoothLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothLayer.cpp index b76dd3bce..976a92b27 100644 --- a/Minecraft.World/WorldGen/Layers/SmoothLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothLayer.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" SmoothLayer::SmoothLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/SmoothLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/SmoothLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothLayer.h diff --git a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp similarity index 92% rename from Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp index e8b2d0f09..db751befe 100644 --- a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Platform/System.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../ConsoleJavaLibs/System.h" SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, std::shared_ptr parent) diff --git a/Minecraft.World/WorldGen/Layers/SmoothZoomLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/SmoothZoomLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.h diff --git a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.cpp similarity index 88% rename from Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.cpp index f886716df..34091ca46 100644 --- a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" #include "SwampRiversLayer.h" SwampRiversLayer::SwampRiversLayer(int64_t seed, std::shared_ptr parent) diff --git a/Minecraft.World/WorldGen/Layers/SwampRiversLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/SwampRiversLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.h diff --git a/Minecraft.World/WorldGen/Layers/TemperatureLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureLayer.cpp similarity index 71% rename from Minecraft.World/WorldGen/Layers/TemperatureLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureLayer.cpp index cc5a05c23..bb259eebe 100644 --- a/Minecraft.World/WorldGen/Layers/TemperatureLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" TemperatureLayer::TemperatureLayer(std::shared_ptr parent) : Layer(0) { this->parent = parent; diff --git a/Minecraft.World/WorldGen/Layers/TemperatureLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/TemperatureLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureLayer.h diff --git a/Minecraft.World/WorldGen/Layers/TemperatureMixerLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureMixerLayer.cpp similarity index 81% rename from Minecraft.World/WorldGen/Layers/TemperatureMixerLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureMixerLayer.cpp index f8350b6fd..793e1aa63 100644 --- a/Minecraft.World/WorldGen/Layers/TemperatureMixerLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureMixerLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.biome.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../biome/net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.newbiome.layer.h" TemperatureMixerLayer::TemperatureMixerLayer(std::shared_ptr temp, std::shared_ptr parent, diff --git a/Minecraft.World/WorldGen/Layers/TemperatureMixerLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureMixerLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/TemperatureMixerLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/TemperatureMixerLayer.h diff --git a/Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp similarity index 96% rename from Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp index 0dafbd6d9..f5b55018d 100644 --- a/Minecraft.World/WorldGen/Layers/VoronoiZoom.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Platform/System.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../ConsoleJavaLibs/System.h" VoronoiZoom::VoronoiZoom(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/VoronoiZoom.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/VoronoiZoom.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.h diff --git a/Minecraft.World/WorldGen/Layers/ZoomLayer.cpp b/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp similarity index 94% rename from Minecraft.World/WorldGen/Layers/ZoomLayer.cpp rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp index 673cec962..a02577d67 100644 --- a/Minecraft.World/WorldGen/Layers/ZoomLayer.cpp +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.newbiome.layer.h" -#include "../../Platform/System.h" +#include "../../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" +#include "../../../../../../ConsoleJavaLibs/System.h" ZoomLayer::ZoomLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/Minecraft.World/WorldGen/Layers/ZoomLayer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.h similarity index 100% rename from Minecraft.World/WorldGen/Layers/ZoomLayer.h rename to Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.h diff --git a/Minecraft.World/net/minecraft/world/level/newbiome/layer/net.minecraft.world.level.newbiome.layer.h b/Minecraft.World/net/minecraft/world/level/newbiome/layer/net.minecraft.world.level.newbiome.layer.h new file mode 100644 index 000000000..f3f866343 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/newbiome/layer/net.minecraft.world.level.newbiome.layer.h @@ -0,0 +1,27 @@ +#pragma once + +#include "AddIslandLayer.h" +#include "AddMushroomIslandLayer.h" +#include "AddSnowLayer.h" +#include "BiomeInitLayer.h" +#include "DownfallLayer.h" +#include "DownfallMixerLayer.h" +#include "FlatLayer.h" +#include "FuzzyZoomLayer.h" +#include "IslandLayer.h" +#include "Layer.h" +#include "RiverInitLayer.h" +#include "RiverLayer.h" +#include "RiverMixerLayer.h" +#include "ShoreLayer.h" +#include "SmoothLayer.h" +#include "SmoothZoomLayer.h" +#include "TemperatureLayer.h" +#include "TemperatureMixerLayer.h" +#include "VoronoiZoom.h" +#include "ZoomLayer.h" +#include "GrowMushroomIslandLayer.h" // 4J added + +// 1.1. +#include "RegionHillsLayer.h" +#include "SwampRiversLayer.h" diff --git a/Minecraft.World/Util/BinaryHeap.cpp b/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp similarity index 96% rename from Minecraft.World/Util/BinaryHeap.cpp rename to Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp index 8f08f0a90..4b44508e8 100644 --- a/Minecraft.World/Util/BinaryHeap.cpp +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../AI/Navigation/Node.h" -#include "../Platform/System.h" +#include "../../../../../Header Files/stdafx.h" +#include "Node.h" +#include "../../../../../ConsoleJavaLibs/System.h" #include "BinaryHeap.h" #include diff --git a/Minecraft.World/Util/BinaryHeap.h b/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h similarity index 79% rename from Minecraft.World/Util/BinaryHeap.h rename to Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h index f632934ec..9ddc11da2 100644 --- a/Minecraft.World/Util/BinaryHeap.h +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h @@ -1,8 +1,8 @@ #pragma once -#include "../Platform/stdafx.h" -#include "../AI/Navigation/Node.h" -#include "../Platform/System.h" +#include "../../../../../Header Files/stdafx.h" +#include "Node.h" +#include "../../../../../ConsoleJavaLibs/System.h" class BinaryHeap { private: diff --git a/Minecraft.World/AI/Navigation/Node.cpp b/Minecraft.World/net/minecraft/world/level/pathfinder/Node.cpp similarity index 90% rename from Minecraft.World/AI/Navigation/Node.cpp rename to Minecraft.World/net/minecraft/world/level/pathfinder/Node.cpp index 7a06742e4..a7f5f643f 100644 --- a/Minecraft.World/AI/Navigation/Node.cpp +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/Node.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "net.minecraft.world.level.pathfinder.h" // 4J - added for common ctor code // Do all the default initialisations done in the java class diff --git a/Minecraft.World/AI/Navigation/Node.h b/Minecraft.World/net/minecraft/world/level/pathfinder/Node.h similarity index 100% rename from Minecraft.World/AI/Navigation/Node.h rename to Minecraft.World/net/minecraft/world/level/pathfinder/Node.h diff --git a/Minecraft.World/AI/Navigation/Path.cpp b/Minecraft.World/net/minecraft/world/level/pathfinder/Path.cpp similarity index 93% rename from Minecraft.World/AI/Navigation/Path.cpp rename to Minecraft.World/net/minecraft/world/level/pathfinder/Path.cpp index bd05f06ff..224878579 100644 --- a/Minecraft.World/AI/Navigation/Path.cpp +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/Path.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.pathfinder.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "net.minecraft.world.level.pathfinder.h" #include "Path.h" Path::~Path() { diff --git a/Minecraft.World/AI/Navigation/Path.h b/Minecraft.World/net/minecraft/world/level/pathfinder/Path.h similarity index 100% rename from Minecraft.World/AI/Navigation/Path.h rename to Minecraft.World/net/minecraft/world/level/pathfinder/Path.h diff --git a/Minecraft.World/AI/Navigation/PathFinder.cpp b/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp similarity index 96% rename from Minecraft.World/AI/Navigation/PathFinder.cpp rename to Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp index 3ceb018a0..ee5830d91 100644 --- a/Minecraft.World/AI/Navigation/PathFinder.cpp +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Util/BinaryHeap.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../net.minecraft.world.level.h" +#include "../material/net.minecraft.world.level.material.h" +#include "../tile/net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "BinaryHeap.h" #include "Node.h" #include "Path.h" #include "PathFinder.h" diff --git a/Minecraft.World/AI/Navigation/PathFinder.h b/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h similarity index 96% rename from Minecraft.World/AI/Navigation/PathFinder.h rename to Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h index 6d02f67ae..34ca9c220 100644 --- a/Minecraft.World/AI/Navigation/PathFinder.h +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h @@ -1,5 +1,5 @@ #pragma once -#include "../../Util/JavaIntHash.h" +#include "../../../../../ConsoleJavaLibs/JavaIntHash.h" class LevelSource; diff --git a/Minecraft.World/net/minecraft/world/level/pathfinder/net.minecraft.world.level.pathfinder.h b/Minecraft.World/net/minecraft/world/level/pathfinder/net.minecraft.world.level.pathfinder.h new file mode 100644 index 000000000..acfbbea89 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/pathfinder/net.minecraft.world.level.pathfinder.h @@ -0,0 +1,6 @@ +#pragma once + +#include "BinaryHeap.h" +#include "Node.h" +#include "Path.h" +#include "PathFinder.h" diff --git a/Minecraft.World/Level/Redstone.cpp b/Minecraft.World/net/minecraft/world/level/redstone/Redstone.cpp similarity index 76% rename from Minecraft.World/Level/Redstone.cpp rename to Minecraft.World/net/minecraft/world/level/redstone/Redstone.cpp index 6a78dfc88..cc071871c 100644 --- a/Minecraft.World/Level/Redstone.cpp +++ b/Minecraft.World/net/minecraft/world/level/redstone/Redstone.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "Redstone.h" diff --git a/Minecraft.World/Level/Redstone.h b/Minecraft.World/net/minecraft/world/level/redstone/Redstone.h similarity index 100% rename from Minecraft.World/Level/Redstone.h rename to Minecraft.World/net/minecraft/world/level/redstone/Redstone.h diff --git a/Minecraft.World/net/minecraft/world/level/redstone/net.minecraft.world.level.redstone.h b/Minecraft.World/net/minecraft/world/level/redstone/net.minecraft.world.level.redstone.h new file mode 100644 index 000000000..8e30ebfc8 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/redstone/net.minecraft.world.level.redstone.h @@ -0,0 +1,3 @@ +#pragma once + +#include "Redstone.h" \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/MapItemSavedData.cpp b/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp similarity index 97% rename from Minecraft.World/Level/Storage/MapItemSavedData.cpp rename to Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp index fc1afa910..efd89eb2b 100644 --- a/Minecraft.World/Level/Storage/MapItemSavedData.cpp +++ b/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp @@ -1,14 +1,14 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" #include "MapItemSavedData.h" -#include "../../../Minecraft.Client/Network/PlayerList.h" -#include "../../../Minecraft.Client/MinecraftServer.h" -#include "../../../Minecraft.Client/Player/ServerPlayer.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../../Minecraft.Client/Network/PlayerConnection.h" +#include "../../../Minecraft.Client/net/minecraft/server/PlayerList.h" +#include "../../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" +#include "../net.minecraft.world.level.h" +#include "../storage/net.minecraft.world.level.storage.h" +#include "../../../Minecraft.Client/net/minecraft/server/network/PlayerConnection.h" const int MapItemSavedData::END_PORTAL_DECORATION_KEY = -1; diff --git a/Minecraft.World/Level/Storage/MapItemSavedData.h b/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.h similarity index 98% rename from Minecraft.World/Level/Storage/MapItemSavedData.h rename to Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.h index 6642e4828..07eef8184 100644 --- a/Minecraft.World/Level/Storage/MapItemSavedData.h +++ b/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Player/Player.h" +#include "../../entity/player/Player.h" #include "SavedData.h" class MapItemSavedData : public SavedData { diff --git a/Minecraft.World/Level/Storage/SavedData.cpp b/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.cpp similarity index 84% rename from Minecraft.World/Level/Storage/SavedData.cpp rename to Minecraft.World/net/minecraft/world/level/saveddata/SavedData.cpp index 1cb534ffb..b31b0be7e 100644 --- a/Minecraft.World/Level/Storage/SavedData.cpp +++ b/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "SavedData.h" SavedData::SavedData(const std::wstring& id) : id(id) { dirty = false; } diff --git a/Minecraft.World/Level/Storage/SavedData.h b/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h similarity index 89% rename from Minecraft.World/Level/Storage/SavedData.h rename to Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h index 3c62bd4e8..da3876015 100644 --- a/Minecraft.World/Level/Storage/SavedData.h +++ b/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Util/Class.h" +#include "../../../../../ConsoleJavaLibs/Class.h" class CompoundTag; diff --git a/Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h b/Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h new file mode 100644 index 000000000..11878d9e8 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h @@ -0,0 +1,4 @@ +#pragma once + +#include "SavedData.h" +#include "MapItemSavedData.h" \ No newline at end of file diff --git a/Minecraft.World/Level/DerivedLevelData.cpp b/Minecraft.World/net/minecraft/world/level/storage/DerivedLevelData.cpp similarity index 98% rename from Minecraft.World/Level/DerivedLevelData.cpp rename to Minecraft.World/net/minecraft/world/level/storage/DerivedLevelData.cpp index fef8fefa1..e89e4acf3 100644 --- a/Minecraft.World/Level/DerivedLevelData.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/DerivedLevelData.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "DerivedLevelData.h" diff --git a/Minecraft.World/Level/DerivedLevelData.h b/Minecraft.World/net/minecraft/world/level/storage/DerivedLevelData.h similarity index 100% rename from Minecraft.World/Level/DerivedLevelData.h rename to Minecraft.World/net/minecraft/world/level/storage/DerivedLevelData.h diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp similarity index 97% rename from Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp rename to Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp index fbb42ec8d..882f29360 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp @@ -1,16 +1,16 @@ -#include "../../Platform/stdafx.h" -#include "../../Platform/System.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../IO/Files/File.h" -#include "../../IO/Streams/DataInputStream.h" -#include "../../IO/Files/FileInputStream.h" -#include "../LevelData.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/System.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../../ConsoleJavaLibs/File.h" +#include "../../../../../ConsoleJavaLibs/InputOutputStream/DataInputStream.h" +#include "../../../../../ConsoleJavaLibs/InputOutputStream/FileInputStream.h" +#include "LevelData.h" #include "DirectoryLevelStorage.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" const std::wstring DirectoryLevelStorage::sc_szPlayerDir(L"players/"); diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorage.h b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h similarity index 97% rename from Minecraft.World/Level/Storage/DirectoryLevelStorage.h rename to Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h index bb579c9bf..3bca465b4 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.h +++ b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h @@ -25,11 +25,11 @@ // The save file version in which we added the End dimension map mappings #define END_DIMENSION_MAP_MAPPINGS_SAVE_VERSION 5 -#include "../../IO/Files/File.h" +#include "../../../../../ConsoleJavaLibs/File.h" #include "LevelStorage.h" #include "PlayerIO.h" -#include "../../IO/Files/ConsoleSavePath.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSavePath.h" class ConsoleSaveFile; // 4J Stu - Added this which we will write out as a file. Map id's are stored in diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp similarity index 91% rename from Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp rename to Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp index 32294eb7d..79be0d2dc 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../IO/Files/File.h" -#include "../LevelData.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/File.h" +#include "LevelData.h" #include "LevelSummary.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "DirectoryLevelStorage.h" #include "DirectoryLevelStorageSource.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" -#include "../../IO/Files/ConsoleSaveFileOriginal.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h" class LevelStorage; diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h similarity index 96% rename from Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h rename to Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h index 25c9fc8a4..ed0e7e147 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h +++ b/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h @@ -1,7 +1,7 @@ #pragma once #include "LevelStorageSource.h" -#include "../../IO/Files/File.h" +#include "../../../../../ConsoleJavaLibs/File.h" class ProgressListener; class LevelData; diff --git a/Minecraft.World/Level/LevelData.cpp b/Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp similarity index 98% rename from Minecraft.World/Level/LevelData.cpp rename to Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp index 9750e06e8..b79676e02 100644 --- a/Minecraft.World/Level/LevelData.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Platform/System.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/System.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "LevelData.h" -#include "Storage/LevelType.h" -#include "Storage/LevelSettings.h" +#include "../LevelType.h" +#include "../LevelSettings.h" LevelData::LevelData() {} diff --git a/Minecraft.World/Level/LevelData.h b/Minecraft.World/net/minecraft/world/level/storage/LevelData.h similarity index 99% rename from Minecraft.World/Level/LevelData.h rename to Minecraft.World/net/minecraft/world/level/storage/LevelData.h index 56101dc37..ff11166f3 100644 --- a/Minecraft.World/Level/LevelData.h +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelData.h @@ -1,6 +1,6 @@ #pragma once -#include "GameRules.h" +#include "../GameRules.h" class Player; class CompoundTag; diff --git a/Minecraft.World/Level/Storage/LevelStorage.cpp b/Minecraft.World/net/minecraft/world/level/storage/LevelStorage.cpp similarity index 75% rename from Minecraft.World/Level/Storage/LevelStorage.cpp rename to Minecraft.World/net/minecraft/world/level/storage/LevelStorage.cpp index 7f05a12c0..3e494ac9d 100644 --- a/Minecraft.World/Level/Storage/LevelStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelStorage.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "LevelStorage.h" diff --git a/Minecraft.World/Level/Storage/LevelStorage.h b/Minecraft.World/net/minecraft/world/level/storage/LevelStorage.h similarity index 93% rename from Minecraft.World/Level/Storage/LevelStorage.h rename to Minecraft.World/net/minecraft/world/level/storage/LevelStorage.h index a8a2f0cc0..bfbe31fc7 100644 --- a/Minecraft.World/Level/Storage/LevelStorage.h +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelStorage.h @@ -1,6 +1,6 @@ #pragma once -#include "../../IO/Files/ConsoleSavePath.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSavePath.h" class PlayerIO; class Dimension; diff --git a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp b/Minecraft.World/net/minecraft/world/level/storage/LevelStorageProfilerDecorator.cpp similarity index 78% rename from Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp rename to Minecraft.World/net/minecraft/world/level/storage/LevelStorageProfilerDecorator.cpp index 05fdd2427..d0e11ff52 100644 --- a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelStorageProfilerDecorator.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../dimension/net.minecraft.world.level.dimension.h" #include "LevelStorageProfilerDecorator.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" LevelStorageProfilerDecorator::LevelStorageProfilerDecorator( LevelStorage* capsulated) diff --git a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.h b/Minecraft.World/net/minecraft/world/level/storage/LevelStorageProfilerDecorator.h similarity index 100% rename from Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.h rename to Minecraft.World/net/minecraft/world/level/storage/LevelStorageProfilerDecorator.h diff --git a/Minecraft.World/Level/Storage/LevelStorageSource.h b/Minecraft.World/net/minecraft/world/level/storage/LevelStorageSource.h similarity index 97% rename from Minecraft.World/Level/Storage/LevelStorageSource.h rename to Minecraft.World/net/minecraft/world/level/storage/LevelStorageSource.h index 8d3e84da6..a42b80590 100644 --- a/Minecraft.World/Level/Storage/LevelStorageSource.h +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelStorageSource.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" class LevelSummary; class ProgressListener; diff --git a/Minecraft.World/Level/Storage/LevelSummary.cpp b/Minecraft.World/net/minecraft/world/level/storage/LevelSummary.cpp similarity index 96% rename from Minecraft.World/Level/Storage/LevelSummary.cpp rename to Minecraft.World/net/minecraft/world/level/storage/LevelSummary.cpp index 59a7f31bd..a4deabdeb 100644 --- a/Minecraft.World/Level/Storage/LevelSummary.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/LevelSummary.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "LevelSummary.h" LevelSummary::LevelSummary(const std::wstring& levelId, diff --git a/Minecraft.World/Level/Storage/LevelSummary.h b/Minecraft.World/net/minecraft/world/level/storage/LevelSummary.h similarity index 100% rename from Minecraft.World/Level/Storage/LevelSummary.h rename to Minecraft.World/net/minecraft/world/level/storage/LevelSummary.h diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp similarity index 90% rename from Minecraft.World/Level/Storage/McRegionLevelStorage.cpp rename to Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp index e7247f0f5..c88a27306 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" -#include "../LevelData.h" -#include "../../IO/Files/File.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" +#include "LevelData.h" +#include "../../../../../ConsoleJavaLibs/File.h" #include "McRegionLevelStorage.h" McRegionLevelStorage::McRegionLevelStorage(ConsoleSaveFile* saveFile, File dir, diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorage.h b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.h similarity index 100% rename from Minecraft.World/Level/Storage/McRegionLevelStorage.h rename to Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.h diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp similarity index 88% rename from Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp rename to Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp index a456c6ec6..923c8d212 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp @@ -1,15 +1,15 @@ -#include "../../Platform/stdafx.h" -#include "../../Util/JavaMath.h" -#include "../../Util/ProgressListener.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.chunk.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../util/ProgressListener.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../chunk/net.minecraft.world.level.chunk.h" #include "LevelSummary.h" #include "McRegionLevelStorage.h" -#include "../../IO/Files/File.h" -#include "../LevelData.h" +#include "../../../../../ConsoleJavaLibs/File.h" +#include "LevelData.h" #include "McRegionLevelStorageSource.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" McRegionLevelStorageSource::McRegionLevelStorageSource(File dir) : DirectoryLevelStorageSource(dir) {} diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.h b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h similarity index 91% rename from Minecraft.World/Level/Storage/McRegionLevelStorageSource.h rename to Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h index 1b69720e8..09bb38a72 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.h +++ b/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h @@ -1,8 +1,8 @@ #pragma once #include "DirectoryLevelStorageSource.h" -#include "../../IO/Files/FileFilter.h" -#include "../../IO/Files/FilenameFilter.h" +#include "../../../../../ConsoleJavaLibs/FileFilter.h" +#include "../../../../../ConsoleJavaLibs/FilenameFilter.h" class ProgressListener; class LevelStorage; diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorage.cpp b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp similarity index 69% rename from Minecraft.World/Level/Storage/MemoryLevelStorage.cpp rename to Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp index cea06ca68..f46b86bc5 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "MemoryLevelStorage.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" MemoryLevelStorage::MemoryLevelStorage() {} diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorage.h b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h similarity index 65% rename from Minecraft.World/Level/Storage/MemoryLevelStorage.h rename to Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h index 95577dbaf..6f2b93c11 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorage.h +++ b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h @@ -3,14 +3,14 @@ #include "LevelStorage.h" #include "PlayerIO.h" -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" -#include "../../IO/Files/ConsoleSaveFile.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h" class MemoryLevelStorage : public LevelStorage, public PlayerIO { public: diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorageSource.cpp similarity index 92% rename from Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp rename to Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorageSource.cpp index c172511ec..0c1f48ac5 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorageSource.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" +#include "../../../../../Header Files/stdafx.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" #include "MemoryLevelStorage.h" #include "LevelSummary.h" #include "MemoryLevelStorageSource.h" diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.h b/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorageSource.h similarity index 100% rename from Minecraft.World/Level/Storage/MemoryLevelStorageSource.h rename to Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorageSource.h diff --git a/Minecraft.World/Level/Storage/MockedLevelStorage.cpp b/Minecraft.World/net/minecraft/world/level/storage/MockedLevelStorage.cpp similarity index 66% rename from Minecraft.World/Level/Storage/MockedLevelStorage.cpp rename to Minecraft.World/net/minecraft/world/level/storage/MockedLevelStorage.cpp index 2da239af1..403f3a2bc 100644 --- a/Minecraft.World/Level/Storage/MockedLevelStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/MockedLevelStorage.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.chunk.storage.h" -#include "../../Headers/net.minecraft.world.level.dimension.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" +#include "../dimension/net.minecraft.world.level.dimension.h" #include "MockedLevelStorage.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" LevelData* MockedLevelStorage::prepareLevel() { return nullptr; } diff --git a/Minecraft.World/Level/Storage/MockedLevelStorage.h b/Minecraft.World/net/minecraft/world/level/storage/MockedLevelStorage.h similarity index 89% rename from Minecraft.World/Level/Storage/MockedLevelStorage.h rename to Minecraft.World/net/minecraft/world/level/storage/MockedLevelStorage.h index 324410fb7..4e44b3fd8 100644 --- a/Minecraft.World/Level/Storage/MockedLevelStorage.h +++ b/Minecraft.World/net/minecraft/world/level/storage/MockedLevelStorage.h @@ -2,7 +2,7 @@ #include "LevelStorage.h" -#include "../../IO/Files/ConsoleSavePath.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSavePath.h" class MockedLevelStorage : public LevelStorage { public: diff --git a/Minecraft.World/Level/Storage/PlayerIO.h b/Minecraft.World/net/minecraft/world/level/storage/PlayerIO.h similarity index 100% rename from Minecraft.World/Level/Storage/PlayerIO.h rename to Minecraft.World/net/minecraft/world/level/storage/PlayerIO.h diff --git a/Minecraft.World/Level/Storage/SavedDataStorage.cpp b/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp similarity index 94% rename from Minecraft.World/Level/Storage/SavedDataStorage.cpp rename to Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp index 47f47d4ff..30ae16d4f 100644 --- a/Minecraft.World/Level/Storage/SavedDataStorage.cpp +++ b/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.saveddata.h" -#include "../../Headers/net.minecraft.world.level.storage.h" -#include "../../Headers/net.minecraft.world.entity.ai.village.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../IO/Files/File.h" +#include "../../../../../Header Files/stdafx.h" +#include "../saveddata/net.minecraft.world.level.saveddata.h" +#include "net.minecraft.world.level.storage.h" +#include "../../entity/ai/village/net.minecraft.world.entity.ai.village.h" +#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../../ConsoleJavaLibs/File.h" #include "SavedDataStorage.h" -#include "../../IO/Files/ConsoleSaveFileIO.h" +#include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" SavedDataStorage::SavedDataStorage(LevelStorage* levelStorage) { /* diff --git a/Minecraft.World/Level/Storage/SavedDataStorage.h b/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.h similarity index 96% rename from Minecraft.World/Level/Storage/SavedDataStorage.h rename to Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.h index f214d47f2..cbb87f8b2 100644 --- a/Minecraft.World/Level/Storage/SavedDataStorage.h +++ b/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.h @@ -1,7 +1,7 @@ #pragma once class ConsoleSaveFile; -#include "SavedData.h" +#include "../saveddata/SavedData.h" class SavedDataStorage { private: diff --git a/Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h b/Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h new file mode 100644 index 000000000..1ba7b8e8b --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h @@ -0,0 +1,17 @@ +#pragma once + +#include "DirectoryLevelStorage.h" +#include "DirectoryLevelStorageSource.h" +#include "LevelData.h" +#include "LevelStorage.h" +#include "LevelStorageProfilerDecorator.h" +#include "LevelStorageSource.h" +#include "LevelSummary.h" +#include "McRegionLevelStorage.h" +#include "McRegionLevelStorageSource.h" +// #include "MemoryLevelStorage.h" // 4J removed as unused +// #include "MemoryLevelStorageSource.h" // 4J removed as +// unused +#include "MockedLevelStorage.h" +#include "PlayerIO.h" +#include "SavedDataStorage.h" diff --git a/Minecraft.World/Blocks/AirTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/AirTile.cpp similarity index 61% rename from Minecraft.World/Blocks/AirTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/AirTile.cpp index ccad24637..ff10c8b82 100644 --- a/Minecraft.World/Blocks/AirTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/AirTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "AirTile.h" AirTile::AirTile(int id) : Tile(id, Material::air) {} diff --git a/Minecraft.World/Blocks/AirTile.h b/Minecraft.World/net/minecraft/world/level/tile/AirTile.h similarity index 77% rename from Minecraft.World/Blocks/AirTile.h rename to Minecraft.World/net/minecraft/world/level/tile/AirTile.h index c50484e95..a628bfbf7 100644 --- a/Minecraft.World/Blocks/AirTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/AirTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "Material.h" +#include "../material/Material.h" class AirTile : public Tile { friend class Tile; diff --git a/Minecraft.World/Blocks/AnvilTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/AnvilTile.cpp similarity index 90% rename from Minecraft.World/Blocks/AnvilTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/AnvilTile.cpp index 7e4f025c1..04dd3d24b 100644 --- a/Minecraft.World/Blocks/AnvilTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/AnvilTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "AnvilTile.h" const unsigned int AnvilTile::ANVIL_NAMES[ANVIL_NAMES_LENGTH] = { diff --git a/Minecraft.World/Blocks/AnvilTile.h b/Minecraft.World/net/minecraft/world/level/tile/AnvilTile.h similarity index 100% rename from Minecraft.World/Blocks/AnvilTile.h rename to Minecraft.World/net/minecraft/world/level/tile/AnvilTile.h diff --git a/Minecraft.World/Blocks/BaseEntityTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BaseEntityTile.cpp similarity index 84% rename from Minecraft.World/Blocks/BaseEntityTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BaseEntityTile.cpp index c3344201f..3fcc70c67 100644 --- a/Minecraft.World/Blocks/BaseEntityTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BaseEntityTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "TileEntities/TileEntity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "entity/TileEntity.h" #include "BaseEntityTile.h" BaseEntityTile::BaseEntityTile(int id, Material* material, diff --git a/Minecraft.World/Blocks/BaseEntityTile.h b/Minecraft.World/net/minecraft/world/level/tile/BaseEntityTile.h similarity index 92% rename from Minecraft.World/Blocks/BaseEntityTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BaseEntityTile.h index efb07a99c..e8fe9a49b 100644 --- a/Minecraft.World/Blocks/BaseEntityTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/BaseEntityTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "TileEntities/EntityTile.h" +#include "EntityTile.h" class TileEntity; diff --git a/Minecraft.World/Blocks/BasePressurePlateTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BasePressurePlateTile.cpp similarity index 93% rename from Minecraft.World/Blocks/BasePressurePlateTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BasePressurePlateTile.cpp index 212fbb914..8e5571c84 100644 --- a/Minecraft.World/Blocks/BasePressurePlateTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BasePressurePlateTile.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "BasePressurePlateTile.h" #include -#include "Util/AABB.h" +#include "../../phys/AABB.h" BasePressurePlateTile::BasePressurePlateTile(int id, const std::wstring& tex, Material* material) diff --git a/Minecraft.World/Blocks/BasePressurePlateTile.h b/Minecraft.World/net/minecraft/world/level/tile/BasePressurePlateTile.h similarity index 100% rename from Minecraft.World/Blocks/BasePressurePlateTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BasePressurePlateTile.h diff --git a/Minecraft.World/Blocks/BaseRailTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp similarity index 98% rename from Minecraft.World/Blocks/BaseRailTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp index 26085e720..5b7f16893 100644 --- a/Minecraft.World/Blocks/BaseRailTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" #include "BaseRailTile.h" #include diff --git a/Minecraft.World/Blocks/BaseRailTile.h b/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.h similarity index 97% rename from Minecraft.World/Blocks/BaseRailTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.h index 23a7b45af..d0527a1ce 100644 --- a/Minecraft.World/Blocks/BaseRailTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.h @@ -1,7 +1,7 @@ #pragma once #include "Tile.h" -#include "../Level/TilePos.h" -#include "../Util/Definitions.h" +#include "../TilePos.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class HitResult; diff --git a/Minecraft.World/Blocks/BeaconTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BeaconTile.cpp similarity index 88% rename from Minecraft.World/Blocks/BeaconTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BeaconTile.cpp index 5ed7c98e5..237c00ab7 100644 --- a/Minecraft.World/Blocks/BeaconTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BeaconTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "entity/net.minecraft.world.level.tile.entity.h" #include "BeaconTile.h" BeaconTile::BeaconTile(int id) : BaseEntityTile(id, Material::glass, false) { diff --git a/Minecraft.World/Blocks/BeaconTile.h b/Minecraft.World/net/minecraft/world/level/tile/BeaconTile.h similarity index 100% rename from Minecraft.World/Blocks/BeaconTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BeaconTile.h diff --git a/Minecraft.World/Blocks/BedTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BedTile.cpp similarity index 96% rename from Minecraft.World/Blocks/BedTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BedTile.cpp index 2db5bdac6..50cc4e900 100644 --- a/Minecraft.World/Blocks/BedTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BedTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Level/Dimensions/Dimension.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../dimension/Dimension.h" +#include "../../../net.minecraft.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" #include "BedTile.h" int BedTile::HEAD_DIRECTION_OFFSETS[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}}; diff --git a/Minecraft.World/Blocks/BedTile.h b/Minecraft.World/net/minecraft/world/level/tile/BedTile.h similarity index 100% rename from Minecraft.World/Blocks/BedTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BedTile.h diff --git a/Minecraft.World/Blocks/BookshelfTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BookshelfTile.cpp similarity index 77% rename from Minecraft.World/Blocks/BookshelfTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BookshelfTile.cpp index 461fd23fe..ebeeab986 100644 --- a/Minecraft.World/Blocks/BookshelfTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BookshelfTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "BookshelfTile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../net.minecraft.h" BookshelfTile::BookshelfTile(int id) : Tile(id, Material::wood) {} diff --git a/Minecraft.World/Blocks/BookshelfTile.h b/Minecraft.World/net/minecraft/world/level/tile/BookshelfTile.h similarity index 89% rename from Minecraft.World/Blocks/BookshelfTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BookshelfTile.h index a5c91f319..969ae8a83 100644 --- a/Minecraft.World/Blocks/BookshelfTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/BookshelfTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "Material.h" +#include "../material/Material.h" class Random; diff --git a/Minecraft.World/Blocks/BrewingStandTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp similarity index 93% rename from Minecraft.World/Blocks/BrewingStandTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp index d901e8472..8644e786c 100644 --- a/Minecraft.World/Blocks/BrewingStandTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "BrewingStandTile.h" -#include "TileEntities/BrewingStandTileEntity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.inventory.h" +#include "entity/BrewingStandTileEntity.h" +#include "../net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../net.minecraft.world.h" +#include "../../inventory/net.minecraft.world.inventory.h" BrewingStandTile::BrewingStandTile(int id) : BaseEntityTile(id, Material::metal, false) { diff --git a/Minecraft.World/Blocks/BrewingStandTile.h b/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.h similarity index 100% rename from Minecraft.World/Blocks/BrewingStandTile.h rename to Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.h diff --git a/Minecraft.World/Blocks/ButtonTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ButtonTile.cpp similarity index 96% rename from Minecraft.World/Blocks/ButtonTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ButtonTile.cpp index b77abf25d..fd625b758 100644 --- a/Minecraft.World/Blocks/ButtonTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ButtonTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../../net.minecraft.h" #include "ButtonTile.h" #include -#include "../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" ButtonTile::ButtonTile(int id, bool sensitive) : Tile(id, Material::decoration, false) { diff --git a/Minecraft.World/Blocks/ButtonTile.h b/Minecraft.World/net/minecraft/world/level/tile/ButtonTile.h similarity index 98% rename from Minecraft.World/Blocks/ButtonTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ButtonTile.h index 570dc1be0..7ab9b2819 100644 --- a/Minecraft.World/Blocks/ButtonTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/ButtonTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Player; class Random; diff --git a/Minecraft.World/Blocks/CactusTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CactusTile.cpp similarity index 87% rename from Minecraft.World/Blocks/CactusTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CactusTile.cpp index 8ce97f40a..9950a3489 100644 --- a/Minecraft.World/Blocks/CactusTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CactusTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.damagesource.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../material/net.minecraft.world.level.material.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../damageSource/net.minecraft.world.damagesource.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "CactusTile.h" CactusTile::CactusTile(int id) : Tile(id, Material::cactus, false) { diff --git a/Minecraft.World/Blocks/CactusTile.h b/Minecraft.World/net/minecraft/world/level/tile/CactusTile.h similarity index 93% rename from Minecraft.World/Blocks/CactusTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CactusTile.h index c35dc18a2..b2df17eff 100644 --- a/Minecraft.World/Blocks/CactusTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/CactusTile.h @@ -1,7 +1,7 @@ #pragma once #include "Tile.h" -#include "Material.h" -#include "../Util/Definitions.h" +#include "../material/Material.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class Level; diff --git a/Minecraft.World/Blocks/CakeTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CakeTile.cpp similarity index 90% rename from Minecraft.World/Blocks/CakeTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CakeTile.cpp index 83b2749f7..a3464c3d9 100644 --- a/Minecraft.World/Blocks/CakeTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CakeTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../food/net.minecraft.world.food.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "CakeTile.h" CakeTile::CakeTile(int id) : Tile(id, Material::cake, false) { diff --git a/Minecraft.World/Blocks/CakeTile.h b/Minecraft.World/net/minecraft/world/level/tile/CakeTile.h similarity index 95% rename from Minecraft.World/Blocks/CakeTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CakeTile.h index b2f2a3655..3932cc847 100644 --- a/Minecraft.World/Blocks/CakeTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/CakeTile.h @@ -1,7 +1,7 @@ #pragma once #include "Tile.h" -#include "Material.h" -#include "../Util/Definitions.h" +#include "../material/Material.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Player; class Random; diff --git a/Minecraft.World/Blocks/CarrotTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CarrotTile.cpp similarity index 82% rename from Minecraft.World/Blocks/CarrotTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CarrotTile.cpp index c5e118d5d..3f7e71e9b 100644 --- a/Minecraft.World/Blocks/CarrotTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CarrotTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../item/net.minecraft.world.item.h" #include "CarrotTile.h" CarrotTile::CarrotTile(int id) : CropTile(id) {} diff --git a/Minecraft.World/Blocks/CarrotTile.h b/Minecraft.World/net/minecraft/world/level/tile/CarrotTile.h similarity index 100% rename from Minecraft.World/Blocks/CarrotTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CarrotTile.h diff --git a/Minecraft.World/Blocks/CauldronTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp similarity index 93% rename from Minecraft.World/Blocks/CauldronTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp index 5aeacabf6..b5bac92fd 100644 --- a/Minecraft.World/Blocks/CauldronTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "CauldronTile.h" -#include "../Util/Facing.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.h" -#include "../../Minecraft.Client/Player/ServerPlayer.h" +#include "../../../Facing.h" +#include "../net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.world.h" +#include "../../Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" const std::wstring CauldronTile::TEXTURE_INSIDE = L"cauldron_inner"; const std::wstring CauldronTile::TEXTURE_BOTTOM = L"cauldron_bottom"; diff --git a/Minecraft.World/Blocks/CauldronTile.h b/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.h similarity index 100% rename from Minecraft.World/Blocks/CauldronTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CauldronTile.h diff --git a/Minecraft.World/Blocks/ChestTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp similarity index 96% rename from Minecraft.World/Blocks/ChestTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp index aaf41500f..ae213494c 100644 --- a/Minecraft.World/Blocks/ChestTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../phys/net.minecraft.world.phys.h" #include "ChestTile.h" -#include "../Util/Facing.h" +#include "../../../Facing.h" ChestTile::ChestTile(int id, int type) : BaseEntityTile(id, Material::wood, false) { diff --git a/Minecraft.World/Blocks/ChestTile.h b/Minecraft.World/net/minecraft/world/level/tile/ChestTile.h similarity index 98% rename from Minecraft.World/Blocks/ChestTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ChestTile.h index ace667ca9..f9b998fb2 100644 --- a/Minecraft.World/Blocks/ChestTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/ChestTile.h @@ -1,6 +1,6 @@ #pragma once #include "BaseEntityTile.h" -#include "Material.h" +#include "../material/Material.h" class Player; class Random; diff --git a/Minecraft.World/Blocks/ClayTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ClayTile.cpp similarity index 71% rename from Minecraft.World/Blocks/ClayTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ClayTile.cpp index b52ecefdb..c2a6ff020 100644 --- a/Minecraft.World/Blocks/ClayTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ClayTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ClayTile.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../item/net.minecraft.world.item.h" ClayTile::ClayTile(int id) : Tile(id, Material::clay) {} diff --git a/Minecraft.World/Blocks/ClayTile.h b/Minecraft.World/net/minecraft/world/level/tile/ClayTile.h similarity index 87% rename from Minecraft.World/Blocks/ClayTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ClayTile.h index 8395fa325..83855f0c6 100644 --- a/Minecraft.World/Blocks/ClayTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/ClayTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "Material.h" +#include "../material/Material.h" class Random; diff --git a/Minecraft.World/Blocks/CocoaTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CocoaTile.cpp similarity index 94% rename from Minecraft.World/Blocks/CocoaTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CocoaTile.cpp index 7c06ba874..2ab3a4081 100644 --- a/Minecraft.World/Blocks/CocoaTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CocoaTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "CocoaTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" const std::wstring CocoaTile::TEXTURE_AGES[] = {L"cocoa_0", L"cocoa_1", L"cocoa_2"}; diff --git a/Minecraft.World/Blocks/CocoaTile.h b/Minecraft.World/net/minecraft/world/level/tile/CocoaTile.h similarity index 100% rename from Minecraft.World/Blocks/CocoaTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CocoaTile.h diff --git a/Minecraft.World/Blocks/ColoredTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ColoredTile.cpp similarity index 83% rename from Minecraft.World/Blocks/ColoredTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ColoredTile.cpp index 3f2be2ebd..506a9d99f 100644 --- a/Minecraft.World/Blocks/ColoredTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ColoredTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../item/net.minecraft.world.item.h" #include "ColoredTile.h" ColoredTile::ColoredTile(int id, Material* material) : Tile(id, material) {} diff --git a/Minecraft.World/Blocks/ColoredTile.h b/Minecraft.World/net/minecraft/world/level/tile/ColoredTile.h similarity index 100% rename from Minecraft.World/Blocks/ColoredTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ColoredTile.h diff --git a/Minecraft.World/Blocks/CommandBlock.cpp b/Minecraft.World/net/minecraft/world/level/tile/CommandBlock.cpp similarity index 93% rename from Minecraft.World/Blocks/CommandBlock.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CommandBlock.cpp index 3666dd549..e3bf2f200 100644 --- a/Minecraft.World/Blocks/CommandBlock.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CommandBlock.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "entity/net.minecraft.world.level.tile.entity.h" #include "CommandBlock.h" CommandBlock::CommandBlock(int id) diff --git a/Minecraft.World/Blocks/CommandBlock.h b/Minecraft.World/net/minecraft/world/level/tile/CommandBlock.h similarity index 100% rename from Minecraft.World/Blocks/CommandBlock.h rename to Minecraft.World/net/minecraft/world/level/tile/CommandBlock.h diff --git a/Minecraft.World/Blocks/ComparatorTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ComparatorTile.cpp similarity index 95% rename from Minecraft.World/Blocks/ComparatorTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ComparatorTile.cpp index a236a93a5..7958c2388 100644 --- a/Minecraft.World/Blocks/ComparatorTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ComparatorTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "net.minecraft.world.level.tile.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../../net.minecraft.h" #include "ComparatorTile.h" ComparatorTile::ComparatorTile(int id, bool on) : DiodeTile(id, on) { diff --git a/Minecraft.World/Blocks/ComparatorTile.h b/Minecraft.World/net/minecraft/world/level/tile/ComparatorTile.h similarity index 98% rename from Minecraft.World/Blocks/ComparatorTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ComparatorTile.h index 55d0712bf..135b71a47 100644 --- a/Minecraft.World/Blocks/ComparatorTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/ComparatorTile.h @@ -1,7 +1,7 @@ #pragma once #include "DiodeTile.h" -#include "TileEntities/EntityTile.h" +#include "EntityTile.h" class ComparatorTileEntity; diff --git a/Minecraft.World/Blocks/CoralTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CoralTile.cpp similarity index 92% rename from Minecraft.World/Blocks/CoralTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CoralTile.cpp index 15e1ba607..2277ebf79 100644 --- a/Minecraft.World/Blocks/CoralTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CoralTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "CoralTile.h" CoralTile::CoralTile(int id) diff --git a/Minecraft.World/Blocks/CoralTile.h b/Minecraft.World/net/minecraft/world/level/tile/CoralTile.h similarity index 90% rename from Minecraft.World/Blocks/CoralTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CoralTile.h index 54564c96e..7e965bda8 100644 --- a/Minecraft.World/Blocks/CoralTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/CoralTile.h @@ -1,6 +1,6 @@ #pragma once #include "HalfTransparentTile.h" -#include "Material.h" +#include "../material/Material.h" class CoralTile : public HalfTransparentTile { public: diff --git a/Minecraft.World/Blocks/CropTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/CropTile.cpp similarity index 94% rename from Minecraft.World/Blocks/CropTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/CropTile.cpp index 736404696..e38d3f4a9 100644 --- a/Minecraft.World/Blocks/CropTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/CropTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.h" #include "CropTile.h" CropTile::CropTile(int id) : Bush(id) { diff --git a/Minecraft.World/Blocks/CropTile.h b/Minecraft.World/net/minecraft/world/level/tile/CropTile.h similarity index 97% rename from Minecraft.World/Blocks/CropTile.h rename to Minecraft.World/net/minecraft/world/level/tile/CropTile.h index 02e9fe38f..61e83513c 100644 --- a/Minecraft.World/Blocks/CropTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/CropTile.h @@ -1,6 +1,6 @@ #pragma once #include "PlantTile.h" -#include "Material.h" +#include "../material/Material.h" class Random; class Level; diff --git a/Minecraft.World/Blocks/DaylightDetectorTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp similarity index 87% rename from Minecraft.World/Blocks/DaylightDetectorTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp index f001325b8..a1b3a7b81 100644 --- a/Minecraft.World/Blocks/DaylightDetectorTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.h" -#include "../Util/JavaMath.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../net.minecraft.world.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" #include "DaylightDetectorTile.h" DaylightDetectorTile::DaylightDetectorTile(int id) diff --git a/Minecraft.World/Blocks/DaylightDetectorTile.h b/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.h similarity index 100% rename from Minecraft.World/Blocks/DaylightDetectorTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.h diff --git a/Minecraft.World/Blocks/DeadBushTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DeadBushTile.cpp similarity index 81% rename from Minecraft.World/Blocks/DeadBushTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DeadBushTile.cpp index 288f0ac1e..9f2ae079c 100644 --- a/Minecraft.World/Blocks/DeadBushTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DeadBushTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" #include "DeadBushTile.h" DeadBushTile::DeadBushTile(int id) : Bush(id, Material::replaceable_plant) { diff --git a/Minecraft.World/Blocks/DeadBushTile.h b/Minecraft.World/net/minecraft/world/level/tile/DeadBushTile.h similarity index 100% rename from Minecraft.World/Blocks/DeadBushTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DeadBushTile.h diff --git a/Minecraft.World/Blocks/DetectorRailTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DetectorRailTile.cpp similarity index 90% rename from Minecraft.World/Blocks/DetectorRailTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DetectorRailTile.cpp index 722e0eef4..ad13b3944 100644 --- a/Minecraft.World/Blocks/DetectorRailTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DetectorRailTile.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../net.minecraft.world.h" #include "DetectorRailTile.h" -#include "../Headers/net.minecraft.h" +#include "../../../net.minecraft.h" DetectorRailTile::DetectorRailTile(int id) : BaseRailTile(id, true) { setTicking(true); diff --git a/Minecraft.World/Blocks/DetectorRailTile.h b/Minecraft.World/net/minecraft/world/level/tile/DetectorRailTile.h similarity index 100% rename from Minecraft.World/Blocks/DetectorRailTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DetectorRailTile.h diff --git a/Minecraft.World/Blocks/DiodeTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DiodeTile.cpp similarity index 96% rename from Minecraft.World/Blocks/DiodeTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DiodeTile.cpp index 3d5753752..474608bdf 100644 --- a/Minecraft.World/Blocks/DiodeTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DiodeTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../net.minecraft.world.h" #include "DiodeTile.h" DiodeTile::DiodeTile(int id, bool on) diff --git a/Minecraft.World/Blocks/DiodeTile.h b/Minecraft.World/net/minecraft/world/level/tile/DiodeTile.h similarity index 100% rename from Minecraft.World/Blocks/DiodeTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DiodeTile.h diff --git a/Minecraft.World/Blocks/DirectionalTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DirectionalTile.cpp similarity index 82% rename from Minecraft.World/Blocks/DirectionalTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DirectionalTile.cpp index 6b4735d30..fc5a8e1c1 100644 --- a/Minecraft.World/Blocks/DirectionalTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DirectionalTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "DirectionalTile.h" diff --git a/Minecraft.World/Blocks/DirectionalTile.h b/Minecraft.World/net/minecraft/world/level/tile/DirectionalTile.h similarity index 100% rename from Minecraft.World/Blocks/DirectionalTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DirectionalTile.h diff --git a/Minecraft.World/Blocks/DirtTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DirtTile.cpp similarity index 62% rename from Minecraft.World/Blocks/DirtTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DirtTile.cpp index adffc8c64..515d88e6f 100644 --- a/Minecraft.World/Blocks/DirtTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DirtTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "DirtTile.h" DirtTile::DirtTile(int id) : Tile(id, Material::dirt) {} \ No newline at end of file diff --git a/Minecraft.World/Blocks/DirtTile.h b/Minecraft.World/net/minecraft/world/level/tile/DirtTile.h similarity index 100% rename from Minecraft.World/Blocks/DirtTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DirtTile.h diff --git a/Minecraft.World/Blocks/DispenserTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DispenserTile.cpp similarity index 92% rename from Minecraft.World/Blocks/DispenserTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DispenserTile.cpp index bb29a41dd..532fbaabc 100644 --- a/Minecraft.World/Blocks/DispenserTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DispenserTile.cpp @@ -1,16 +1,16 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../net.minecraft.world.h" #include "DispenserTile.h" -#include "../Headers/net.minecraft.h" -#include "../Entities/Mob.h" +#include "../../../net.minecraft.h" +#include "../../entity/Mob.h" BehaviorRegistry DispenserTile::REGISTRY = BehaviorRegistry(new DefaultDispenseItemBehavior()); diff --git a/Minecraft.World/Blocks/DispenserTile.h b/Minecraft.World/net/minecraft/world/level/tile/DispenserTile.h similarity index 97% rename from Minecraft.World/Blocks/DispenserTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DispenserTile.h index de051f1f7..95c3ee0ad 100644 --- a/Minecraft.World/Blocks/DispenserTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/DispenserTile.h @@ -1,6 +1,6 @@ #pragma once #include "BaseEntityTile.h" -#include "../Headers/net.minecraft.core.h" +#include "../../../core/net.minecraft.core.h" class Player; class Mob; diff --git a/Minecraft.World/Blocks/DoorTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DoorTile.cpp similarity index 96% rename from Minecraft.World/Blocks/DoorTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DoorTile.cpp index 5e3faf703..3f5bc1d00 100644 --- a/Minecraft.World/Blocks/DoorTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DoorTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" #include "DoorTile.h" -#include "../Level/Events/LevelEvent.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "LevelEvent.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" const std::wstring DoorTile::TEXTURES[] = { L"doorWood_lower", L"doorWood_upper", L"doorIron_lower", L"doorIron_upper"}; diff --git a/Minecraft.World/Blocks/DoorTile.h b/Minecraft.World/net/minecraft/world/level/tile/DoorTile.h similarity index 98% rename from Minecraft.World/Blocks/DoorTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DoorTile.h index 3f844a27d..245a7f1b4 100644 --- a/Minecraft.World/Blocks/DoorTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/DoorTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Player; class HitResult; diff --git a/Minecraft.World/Blocks/DropperTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/DropperTile.cpp similarity index 87% rename from Minecraft.World/Blocks/DropperTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/DropperTile.cpp index 906a6e380..11559852f 100644 --- a/Minecraft.World/Blocks/DropperTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/DropperTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.core.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" +#include "../../../core/net.minecraft.core.h" #include "DropperTile.h" DropperTile::DropperTile(int id) : DispenserTile(id) { diff --git a/Minecraft.World/Blocks/DropperTile.h b/Minecraft.World/net/minecraft/world/level/tile/DropperTile.h similarity index 100% rename from Minecraft.World/Blocks/DropperTile.h rename to Minecraft.World/net/minecraft/world/level/tile/DropperTile.h diff --git a/Minecraft.World/Blocks/EggTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/EggTile.cpp similarity index 96% rename from Minecraft.World/Blocks/EggTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/EggTile.cpp index 67fd2e1e9..39494bcda 100644 --- a/Minecraft.World/Blocks/EggTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/EggTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "EggTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.entity.item.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" EggTile::EggTile(int id) : Tile(id, Material::egg, false) {} diff --git a/Minecraft.World/Blocks/EggTile.h b/Minecraft.World/net/minecraft/world/level/tile/EggTile.h similarity index 100% rename from Minecraft.World/Blocks/EggTile.h rename to Minecraft.World/net/minecraft/world/level/tile/EggTile.h diff --git a/Minecraft.World/Blocks/EnchantmentTableTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/EnchantmentTableTile.cpp similarity index 94% rename from Minecraft.World/Blocks/EnchantmentTableTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/EnchantmentTableTile.cpp index 9cd0c39be..5e8fee7b5 100644 --- a/Minecraft.World/Blocks/EnchantmentTableTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/EnchantmentTableTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "EnchantmentTableTile.h" -#include "TileEntities/EnchantmentTableTileEntity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "entity/EnchantmentTableTileEntity.h" +#include "../net.minecraft.world.level.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" const std::wstring EnchantmentTableTile::TEXTURE_SIDE = L"enchantment_side"; const std::wstring EnchantmentTableTile::TEXTURE_TOP = L"enchantment_top"; diff --git a/Minecraft.World/Blocks/EnchantmentTableTile.h b/Minecraft.World/net/minecraft/world/level/tile/EnchantmentTableTile.h similarity index 100% rename from Minecraft.World/Blocks/EnchantmentTableTile.h rename to Minecraft.World/net/minecraft/world/level/tile/EnchantmentTableTile.h diff --git a/Minecraft.World/Blocks/EnderChestTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/EnderChestTile.cpp similarity index 90% rename from Minecraft.World/Blocks/EnderChestTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/EnderChestTile.cpp index 36c4185bf..39e4f2b04 100644 --- a/Minecraft.World/Blocks/EnderChestTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/EnderChestTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "EnderChestTile.h" EnderChestTile::EnderChestTile(int id) diff --git a/Minecraft.World/Blocks/EnderChestTile.h b/Minecraft.World/net/minecraft/world/level/tile/EnderChestTile.h similarity index 100% rename from Minecraft.World/Blocks/EnderChestTile.h rename to Minecraft.World/net/minecraft/world/level/tile/EnderChestTile.h diff --git a/Minecraft.World/Blocks/TileEntities/EntityTile.h b/Minecraft.World/net/minecraft/world/level/tile/EntityTile.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/EntityTile.h rename to Minecraft.World/net/minecraft/world/level/tile/EntityTile.h diff --git a/Minecraft.World/Blocks/FarmTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/FarmTile.cpp similarity index 94% rename from Minecraft.World/Blocks/FarmTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/FarmTile.cpp index 732103c05..19b18ae8e 100644 --- a/Minecraft.World/Blocks/FarmTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/FarmTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "FarmTile.h" FarmTile::FarmTile(int id) : Tile(id, Material::dirt, false) { diff --git a/Minecraft.World/Blocks/FarmTile.h b/Minecraft.World/net/minecraft/world/level/tile/FarmTile.h similarity index 95% rename from Minecraft.World/Blocks/FarmTile.h rename to Minecraft.World/net/minecraft/world/level/tile/FarmTile.h index ee7a7e3df..cfa9f9a4f 100644 --- a/Minecraft.World/Blocks/FarmTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/FarmTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class ChunkRebuildData; diff --git a/Minecraft.World/Blocks/FenceGateTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/FenceGateTile.cpp similarity index 95% rename from Minecraft.World/Blocks/FenceGateTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/FenceGateTile.cpp index bdb608dda..5cc32d7af 100644 --- a/Minecraft.World/Blocks/FenceGateTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/FenceGateTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "FenceGateTile.h" -#include "../Util/AABB.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.h" -#include "../Level/Events/LevelEvent.h" -#include "Util/Direction.h" +#include "../../phys/AABB.h" +#include "../net.minecraft.world.level.h" +#include "../../../net.minecraft.h" +#include "LevelEvent.h" +#include "../../../Direction.h" FenceGateTile::FenceGateTile(int id) : DirectionalTile(id, Material::wood, false) {} diff --git a/Minecraft.World/Blocks/FenceGateTile.h b/Minecraft.World/net/minecraft/world/level/tile/FenceGateTile.h similarity index 100% rename from Minecraft.World/Blocks/FenceGateTile.h rename to Minecraft.World/net/minecraft/world/level/tile/FenceGateTile.h diff --git a/Minecraft.World/Blocks/FenceTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp similarity index 95% rename from Minecraft.World/Blocks/FenceTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp index b8084d0d5..4163b0444 100644 --- a/Minecraft.World/Blocks/FenceTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" #include "FenceTile.h" FenceTile::FenceTile(int id, const std::wstring& texture, Material* material) diff --git a/Minecraft.World/Blocks/FenceTile.h b/Minecraft.World/net/minecraft/world/level/tile/FenceTile.h similarity index 95% rename from Minecraft.World/Blocks/FenceTile.h rename to Minecraft.World/net/minecraft/world/level/tile/FenceTile.h index 1645c9bb7..f5dad4016 100644 --- a/Minecraft.World/Blocks/FenceTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/FenceTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class FenceTile : public Tile { private: diff --git a/Minecraft.World/Blocks/FireTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp similarity index 95% rename from Minecraft.World/Blocks/FireTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp index 3ee78cdbb..203cf7394 100644 --- a/Minecraft.World/Blocks/FireTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp @@ -1,17 +1,17 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../net.minecraft.world.h" +#include "net.minecraft.world.level.tile.h" #include "FireTile.h" -#include "../Util/SoundTypes.h" -#include "../../Minecraft.Client/MinecraftServer.h" -#include "../../Minecraft.Client/Network/PlayerList.h" -#include "Util/AABB.h" +#include "../../../../../Header Files/SoundTypes.h" +#include "../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" +#include "../../Minecraft.Client/net/minecraft/server/PlayerList.h" +#include "../../phys/AABB.h" // AP - added for Vita to set Alpha Cut out -#include "../IO/Streams/IntBuffer.h" -#include "../../Minecraft.Client/Rendering/Tesselator.h" +#include "../../../../../ConsoleJavaLibs/IntBuffer.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Tesselator.h" const std::wstring FireTile::TEXTURE_FIRST = L"fire_0"; const std::wstring FireTile::TEXTURE_SECOND = L"fire_1"; diff --git a/Minecraft.World/Blocks/FireTile.h b/Minecraft.World/net/minecraft/world/level/tile/FireTile.h similarity index 97% rename from Minecraft.World/Blocks/FireTile.h rename to Minecraft.World/net/minecraft/world/level/tile/FireTile.h index c93e7e94f..a120d4e03 100644 --- a/Minecraft.World/Blocks/FireTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/FireTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class ChunkRebuildData; diff --git a/Minecraft.World/Blocks/FlowerPotTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/FlowerPotTile.cpp similarity index 95% rename from Minecraft.World/Blocks/FlowerPotTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/FlowerPotTile.cpp index 5c9ff9835..acb790fe2 100644 --- a/Minecraft.World/Blocks/FlowerPotTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/FlowerPotTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" #include "FlowerPotTile.h" FlowerPotTile::FlowerPotTile(int id) : Tile(id, Material::decoration, false) { diff --git a/Minecraft.World/Blocks/FlowerPotTile.h b/Minecraft.World/net/minecraft/world/level/tile/FlowerPotTile.h similarity index 100% rename from Minecraft.World/Blocks/FlowerPotTile.h rename to Minecraft.World/net/minecraft/world/level/tile/FlowerPotTile.h diff --git a/Minecraft.World/Blocks/FurnaceTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/FurnaceTile.cpp similarity index 94% rename from Minecraft.World/Blocks/FurnaceTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/FurnaceTile.cpp index d9dc2092f..f44e4460b 100644 --- a/Minecraft.World/Blocks/FurnaceTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/FurnaceTile.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../net.minecraft.world.h" #include "FurnaceTile.h" -#include "../Entities/Mob.h" -#include "../Util/Facing.h" +#include "../../entity/Mob.h" +#include "../../../Facing.h" bool FurnaceTile::noDrop = false; diff --git a/Minecraft.World/Blocks/FurnaceTile.h b/Minecraft.World/net/minecraft/world/level/tile/FurnaceTile.h similarity index 100% rename from Minecraft.World/Blocks/FurnaceTile.h rename to Minecraft.World/net/minecraft/world/level/tile/FurnaceTile.h diff --git a/Minecraft.World/Blocks/GlassTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/GlassTile.cpp similarity index 89% rename from Minecraft.World/Blocks/GlassTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/GlassTile.cpp index fdc9f0abc..a9fe80f22 100644 --- a/Minecraft.World/Blocks/GlassTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/GlassTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "GlassTile.h" GlassTile::GlassTile(int id, Material* material, bool allowSame) diff --git a/Minecraft.World/Blocks/GlassTile.h b/Minecraft.World/net/minecraft/world/level/tile/GlassTile.h similarity index 100% rename from Minecraft.World/Blocks/GlassTile.h rename to Minecraft.World/net/minecraft/world/level/tile/GlassTile.h diff --git a/Minecraft.World/Blocks/GlowstoneTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/GlowstoneTile.cpp similarity index 84% rename from Minecraft.World/Blocks/GlowstoneTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/GlowstoneTile.cpp index ced4026bd..6c30adfb3 100644 --- a/Minecraft.World/Blocks/GlowstoneTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/GlowstoneTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "GlowstoneTile.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../item/net.minecraft.world.item.h" Glowstonetile::Glowstonetile(int id, Material* material) : Tile(id, material) {} diff --git a/Minecraft.World/Blocks/GlowstoneTile.h b/Minecraft.World/net/minecraft/world/level/tile/GlowstoneTile.h similarity index 100% rename from Minecraft.World/Blocks/GlowstoneTile.h rename to Minecraft.World/net/minecraft/world/level/tile/GlowstoneTile.h diff --git a/Minecraft.World/Blocks/GrassTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp similarity index 90% rename from Minecraft.World/Blocks/GrassTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp index 0781505d4..d0b90c6d4 100644 --- a/Minecraft.World/Blocks/GrassTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp @@ -1,14 +1,14 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" #include "GrassTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" // AP - included for PSVita Alpha cut out optimisation -#include "../IO/Streams/IntBuffer.h" -#include "../../Minecraft.Client/Rendering/Tesselator.h" +#include "../../../../../ConsoleJavaLibs/IntBuffer.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Tesselator.h" GrassTile::GrassTile(int id) : Tile(id, Material::grass) { iconTop = nullptr; diff --git a/Minecraft.World/Blocks/GrassTile.h b/Minecraft.World/net/minecraft/world/level/tile/GrassTile.h similarity index 100% rename from Minecraft.World/Blocks/GrassTile.h rename to Minecraft.World/net/minecraft/world/level/tile/GrassTile.h diff --git a/Minecraft.World/Blocks/GravelTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/GravelTile.cpp similarity index 75% rename from Minecraft.World/Blocks/GravelTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/GravelTile.cpp index c67d89c6b..de74e19a8 100644 --- a/Minecraft.World/Blocks/GravelTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/GravelTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "GravelTile.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../item/net.minecraft.world.item.h" GravelTile::GravelTile(int type) : HeavyTile(type) {} diff --git a/Minecraft.World/Blocks/GravelTile.h b/Minecraft.World/net/minecraft/world/level/tile/GravelTile.h similarity index 100% rename from Minecraft.World/Blocks/GravelTile.h rename to Minecraft.World/net/minecraft/world/level/tile/GravelTile.h diff --git a/Minecraft.World/Blocks/HalfSlabTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp similarity index 93% rename from Minecraft.World/Blocks/HalfSlabTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp index 6e677ebe8..f48a2fb4f 100644 --- a/Minecraft.World/Blocks/HalfSlabTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "HalfSlabTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Util/Facing.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../../Facing.h" HalfSlabTile::HalfSlabTile(int id, bool fullSize, Material* material) : Tile(id, material, fullSize) { diff --git a/Minecraft.World/Blocks/HalfSlabTile.h b/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.h similarity index 100% rename from Minecraft.World/Blocks/HalfSlabTile.h rename to Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.h diff --git a/Minecraft.World/Blocks/HalfTransparentTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/HalfTransparentTile.cpp similarity index 86% rename from Minecraft.World/Blocks/HalfTransparentTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/HalfTransparentTile.cpp index 81a60b33d..3dbb25dd3 100644 --- a/Minecraft.World/Blocks/HalfTransparentTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/HalfTransparentTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" #include "HalfTransparentTile.h" HalfTransparentTile::HalfTransparentTile(int id, const std::wstring& tex, diff --git a/Minecraft.World/Blocks/HalfTransparentTile.h b/Minecraft.World/net/minecraft/world/level/tile/HalfTransparentTile.h similarity index 100% rename from Minecraft.World/Blocks/HalfTransparentTile.h rename to Minecraft.World/net/minecraft/world/level/tile/HalfTransparentTile.h diff --git a/Minecraft.World/Blocks/HayBlockTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/HayBlockTile.cpp similarity index 83% rename from Minecraft.World/Blocks/HayBlockTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/HayBlockTile.cpp index 9ceba51d8..626c30243 100644 --- a/Minecraft.World/Blocks/HayBlockTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/HayBlockTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" #include "HayBlockTile.h" HayBlockTile::HayBlockTile(int id) : RotatedPillarTile(id, Material::grass) {} diff --git a/Minecraft.World/Blocks/HayBlockTile.h b/Minecraft.World/net/minecraft/world/level/tile/HayBlockTile.h similarity index 100% rename from Minecraft.World/Blocks/HayBlockTile.h rename to Minecraft.World/net/minecraft/world/level/tile/HayBlockTile.h diff --git a/Minecraft.World/Blocks/HeavyTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/HeavyTile.cpp similarity index 93% rename from Minecraft.World/Blocks/HeavyTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/HeavyTile.cpp index 9b06fbcd2..4008aec6a 100644 --- a/Minecraft.World/Blocks/HeavyTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/HeavyTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" #include "HeavyTile.h" #include "FireTile.h" diff --git a/Minecraft.World/Blocks/HeavyTile.h b/Minecraft.World/net/minecraft/world/level/tile/HeavyTile.h similarity index 100% rename from Minecraft.World/Blocks/HeavyTile.h rename to Minecraft.World/net/minecraft/world/level/tile/HeavyTile.h diff --git a/Minecraft.World/Blocks/HopperTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp similarity index 94% rename from Minecraft.World/Blocks/HopperTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp index ac6bf32b1..983f91805 100644 --- a/Minecraft.World/Blocks/HopperTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.inventory.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../inventory/net.minecraft.world.inventory.h" +#include "../net.minecraft.world.level.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../net.minecraft.world.h" #include "HopperTile.h" const std::wstring HopperTile::TEXTURE_OUTSIDE = L"hopper_outside"; diff --git a/Minecraft.World/Blocks/HopperTile.h b/Minecraft.World/net/minecraft/world/level/tile/HopperTile.h similarity index 100% rename from Minecraft.World/Blocks/HopperTile.h rename to Minecraft.World/net/minecraft/world/level/tile/HopperTile.h diff --git a/Minecraft.World/Blocks/HugeMushroomTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/HugeMushroomTile.cpp similarity index 95% rename from Minecraft.World/Blocks/HugeMushroomTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/HugeMushroomTile.cpp index 8b727baba..dd4b7f16d 100644 --- a/Minecraft.World/Blocks/HugeMushroomTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/HugeMushroomTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" #include "HugeMushroomTile.h" const std::wstring HugeMushroomTile::TEXTURE_STEM = L"skin_stem"; diff --git a/Minecraft.World/Blocks/HugeMushroomTile.h b/Minecraft.World/net/minecraft/world/level/tile/HugeMushroomTile.h similarity index 100% rename from Minecraft.World/Blocks/HugeMushroomTile.h rename to Minecraft.World/net/minecraft/world/level/tile/HugeMushroomTile.h diff --git a/Minecraft.World/Blocks/IceTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/IceTile.cpp similarity index 86% rename from Minecraft.World/Blocks/IceTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/IceTile.cpp index 7d6e660c5..f478a4f9b 100644 --- a/Minecraft.World/Blocks/IceTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/IceTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.stats.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../../food/net.minecraft.world.food.h" +#include "../../../stats/net.minecraft.stats.h" #include "IceTile.h" IceTile::IceTile(int id) diff --git a/Minecraft.World/Blocks/IceTile.h b/Minecraft.World/net/minecraft/world/level/tile/IceTile.h similarity index 100% rename from Minecraft.World/Blocks/IceTile.h rename to Minecraft.World/net/minecraft/world/level/tile/IceTile.h diff --git a/Minecraft.World/Blocks/JukeboxTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.cpp similarity index 93% rename from Minecraft.World/Blocks/JukeboxTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.cpp index e0615cc61..0879396c5 100644 --- a/Minecraft.World/Blocks/JukeboxTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "JukeboxTile.h" -#include "../Level/Events/LevelEvent.h" +#include "LevelEvent.h" JukeboxTile::Entity::Entity() : TileEntity() { record = nullptr; } diff --git a/Minecraft.World/Blocks/JukeboxTile.h b/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h similarity index 95% rename from Minecraft.World/Blocks/JukeboxTile.h rename to Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h index d3fa9603f..3807a4998 100644 --- a/Minecraft.World/Blocks/JukeboxTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h @@ -1,8 +1,8 @@ #pragma once #include "BaseEntityTile.h" -#include "../IO/NBT/CompoundTag.h" -#include "TileEntities/TileEntity.h" +#include "../../../../../com/mojang/nbt/CompoundTag.h" +#include "entity/TileEntity.h" class CompoundTag; class ChunkRebuildData; diff --git a/Minecraft.World/Blocks/LadderTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/LadderTile.cpp similarity index 96% rename from Minecraft.World/Blocks/LadderTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LadderTile.cpp index f061eceed..de2952e10 100644 --- a/Minecraft.World/Blocks/LadderTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LadderTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "LadderTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" LadderTile::LadderTile(int id) : Tile(id, Material::decoration, false) {} diff --git a/Minecraft.World/Blocks/LadderTile.h b/Minecraft.World/net/minecraft/world/level/tile/LadderTile.h similarity index 95% rename from Minecraft.World/Blocks/LadderTile.h rename to Minecraft.World/net/minecraft/world/level/tile/LadderTile.h index 9bde7712d..327dce1f2 100644 --- a/Minecraft.World/Blocks/LadderTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/LadderTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; diff --git a/Minecraft.World/Blocks/LeafTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/LeafTile.cpp similarity index 97% rename from Minecraft.World/Blocks/LeafTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LeafTile.cpp index ae12b03a2..d71cd7d06 100644 --- a/Minecraft.World/Blocks/LeafTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LeafTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" #include "LeafTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../net.minecraft.world.h" const unsigned int LeafTile::LEAF_NAMES[LEAF_NAMES_LENGTH] = { IDS_TILE_LEAVES_OAK, diff --git a/Minecraft.World/Blocks/LeafTile.h b/Minecraft.World/net/minecraft/world/level/tile/LeafTile.h similarity index 100% rename from Minecraft.World/Blocks/LeafTile.h rename to Minecraft.World/net/minecraft/world/level/tile/LeafTile.h diff --git a/Minecraft.World/Level/Events/LevelEvent.h b/Minecraft.World/net/minecraft/world/level/tile/LevelEvent.h similarity index 100% rename from Minecraft.World/Level/Events/LevelEvent.h rename to Minecraft.World/net/minecraft/world/level/tile/LevelEvent.h diff --git a/Minecraft.World/Blocks/LeverTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/LeverTile.cpp similarity index 97% rename from Minecraft.World/Blocks/LeverTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LeverTile.cpp index 11e8db00f..0f1deb65e 100644 --- a/Minecraft.World/Blocks/LeverTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LeverTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../../net.minecraft.h" #include "LeverTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" LeverTile::LeverTile(int id) : Tile(id, Material::decoration, false) {} diff --git a/Minecraft.World/Blocks/LeverTile.h b/Minecraft.World/net/minecraft/world/level/tile/LeverTile.h similarity index 100% rename from Minecraft.World/Blocks/LeverTile.h rename to Minecraft.World/net/minecraft/world/level/tile/LeverTile.h diff --git a/Minecraft.World/Blocks/LiquidTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp similarity index 96% rename from Minecraft.World/Blocks/LiquidTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp index cda40aa15..077e30e62 100644 --- a/Minecraft.World/Blocks/LiquidTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp @@ -1,15 +1,15 @@ -#include "../Platform/stdafx.h" -#include "../Util/JavaMath.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../net.minecraft.world.level.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../net.minecraft.world.h" #include "LiquidTile.h" #include -#include "../Util/Facing.h" -#include "../Util/SoundTypes.h" -#include "Blocks/Material.h" -#include "Util/AABB.h" +#include "../../../Facing.h" +#include "../../../../../Header Files/SoundTypes.h" +#include "../material/Material.h" +#include "../../phys/AABB.h" const std::wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava"; const std::wstring LiquidTile::TEXTURE_WATER_STILL = L"water"; diff --git a/Minecraft.World/Blocks/LiquidTile.h b/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.h similarity index 98% rename from Minecraft.World/Blocks/LiquidTile.h rename to Minecraft.World/net/minecraft/world/level/tile/LiquidTile.h index 7ffed063a..4b5d96dda 100644 --- a/Minecraft.World/Blocks/LiquidTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.h @@ -1,7 +1,7 @@ #pragma once #include #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class ChunkRebuildData; diff --git a/Minecraft.World/Blocks/LiquidTileDynamic.cpp b/Minecraft.World/net/minecraft/world/level/tile/LiquidTileDynamic.cpp similarity index 98% rename from Minecraft.World/Blocks/LiquidTileDynamic.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LiquidTileDynamic.cpp index a2a3366b1..cc36098b3 100644 --- a/Minecraft.World/Blocks/LiquidTileDynamic.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LiquidTileDynamic.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "LiquidTileDynamic.h" -#include "../Headers/net.minecraft.world.level.dimension.h" +#include "../dimension/net.minecraft.world.level.dimension.h" LiquidTileDynamic::LiquidTileDynamic(int id, Material* material) : LiquidTile(id, material) { diff --git a/Minecraft.World/Blocks/LiquidTileDynamic.h b/Minecraft.World/net/minecraft/world/level/tile/LiquidTileDynamic.h similarity index 100% rename from Minecraft.World/Blocks/LiquidTileDynamic.h rename to Minecraft.World/net/minecraft/world/level/tile/LiquidTileDynamic.h diff --git a/Minecraft.World/Blocks/LiquidTileStatic.cpp b/Minecraft.World/net/minecraft/world/level/tile/LiquidTileStatic.cpp similarity index 96% rename from Minecraft.World/Blocks/LiquidTileStatic.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LiquidTileStatic.cpp index b1b75838b..4cd5d5bc8 100644 --- a/Minecraft.World/Blocks/LiquidTileStatic.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LiquidTileStatic.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "LiquidTileStatic.h" #include "FireTile.h" diff --git a/Minecraft.World/Blocks/LiquidTileStatic.h b/Minecraft.World/net/minecraft/world/level/tile/LiquidTileStatic.h similarity index 100% rename from Minecraft.World/Blocks/LiquidTileStatic.h rename to Minecraft.World/net/minecraft/world/level/tile/LiquidTileStatic.h diff --git a/Minecraft.World/Blocks/LockedChestTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/LockedChestTile.cpp similarity index 81% rename from Minecraft.World/Blocks/LockedChestTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/LockedChestTile.cpp index ff3ede66f..6a1213c3f 100644 --- a/Minecraft.World/Blocks/LockedChestTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/LockedChestTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "LockedChestTile.h" LockedChestTile::LockedChestTile(int id) : Tile(id, Material::wood) {} diff --git a/Minecraft.World/Blocks/LockedChestTile.h b/Minecraft.World/net/minecraft/world/level/tile/LockedChestTile.h similarity index 100% rename from Minecraft.World/Blocks/LockedChestTile.h rename to Minecraft.World/net/minecraft/world/level/tile/LockedChestTile.h diff --git a/Minecraft.World/Blocks/MelonTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/MelonTile.cpp similarity index 83% rename from Minecraft.World/Blocks/MelonTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/MelonTile.cpp index c392b90fa..d4583e8b1 100644 --- a/Minecraft.World/Blocks/MelonTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/MelonTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "MelonTile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" -#include "../Util/Facing.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.h" +#include "../../../Facing.h" MelonTile::MelonTile(int id) : Tile(id, Material::vegetable) { iconTop = nullptr; diff --git a/Minecraft.World/Blocks/MelonTile.h b/Minecraft.World/net/minecraft/world/level/tile/MelonTile.h similarity index 100% rename from Minecraft.World/Blocks/MelonTile.h rename to Minecraft.World/net/minecraft/world/level/tile/MelonTile.h diff --git a/Minecraft.World/Blocks/MetalTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/MetalTile.cpp similarity index 63% rename from Minecraft.World/Blocks/MetalTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/MetalTile.cpp index 53332bbef..c5d5a82aa 100644 --- a/Minecraft.World/Blocks/MetalTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/MetalTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "MetalTile.h" MetalTile::MetalTile(int id) : Tile(id, Material::metal) {} \ No newline at end of file diff --git a/Minecraft.World/Blocks/MetalTile.h b/Minecraft.World/net/minecraft/world/level/tile/MetalTile.h similarity index 100% rename from Minecraft.World/Blocks/MetalTile.h rename to Minecraft.World/net/minecraft/world/level/tile/MetalTile.h diff --git a/Minecraft.World/Blocks/MobSpawnerTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/MobSpawnerTile.cpp similarity index 88% rename from Minecraft.World/Blocks/MobSpawnerTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/MobSpawnerTile.cpp index 85af0b16d..152393047 100644 --- a/Minecraft.World/Blocks/MobSpawnerTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/MobSpawnerTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "entity/net.minecraft.world.level.tile.entity.h" #include "MobSpawnerTile.h" MobSpawnerTile::MobSpawnerTile(int id) diff --git a/Minecraft.World/Blocks/MobSpawnerTile.h b/Minecraft.World/net/minecraft/world/level/tile/MobSpawnerTile.h similarity index 100% rename from Minecraft.World/Blocks/MobSpawnerTile.h rename to Minecraft.World/net/minecraft/world/level/tile/MobSpawnerTile.h diff --git a/Minecraft.World/Blocks/MushroomPlantTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/MushroomPlantTile.cpp similarity index 92% rename from Minecraft.World/Blocks/MushroomPlantTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/MushroomPlantTile.cpp index 7b5e272d2..87fb47a9a 100644 --- a/Minecraft.World/Blocks/MushroomPlantTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/MushroomPlantTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../../net.minecraft.world.h" #include "MushroomPlantTile.h" Mushroom::Mushroom(int id) : Bush(id) { diff --git a/Minecraft.World/Blocks/MushroomPlantTile.h b/Minecraft.World/net/minecraft/world/level/tile/MushroomPlantTile.h similarity index 100% rename from Minecraft.World/Blocks/MushroomPlantTile.h rename to Minecraft.World/net/minecraft/world/level/tile/MushroomPlantTile.h diff --git a/Minecraft.World/Blocks/MycelTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/MycelTile.cpp similarity index 93% rename from Minecraft.World/Blocks/MycelTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/MycelTile.cpp index 842c2a746..a77379874 100644 --- a/Minecraft.World/Blocks/MycelTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/MycelTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "MycelTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" MycelTile::MycelTile(int id) : Tile(id, Material::grass) { iconTop = nullptr; diff --git a/Minecraft.World/Blocks/MycelTile.h b/Minecraft.World/net/minecraft/world/level/tile/MycelTile.h similarity index 100% rename from Minecraft.World/Blocks/MycelTile.h rename to Minecraft.World/net/minecraft/world/level/tile/MycelTile.h diff --git a/Minecraft.World/Blocks/NetherWartTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/NetherWartTile.cpp similarity index 91% rename from Minecraft.World/Blocks/NetherWartTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/NetherWartTile.cpp index 956d40ee9..532196a74 100644 --- a/Minecraft.World/Blocks/NetherWartTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/NetherWartTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "NetherWartTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.h" NetherWartTile::NetherWartTile(int id) : Bush(id) { setTicking(true); diff --git a/Minecraft.World/Blocks/NetherWartTile.h b/Minecraft.World/net/minecraft/world/level/tile/NetherWartTile.h similarity index 100% rename from Minecraft.World/Blocks/NetherWartTile.h rename to Minecraft.World/net/minecraft/world/level/tile/NetherWartTile.h diff --git a/Minecraft.World/Blocks/NetherrackTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/NetherrackTile.cpp similarity index 67% rename from Minecraft.World/Blocks/NetherrackTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/NetherrackTile.cpp index a3f026497..f0d339b4e 100644 --- a/Minecraft.World/Blocks/NetherrackTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/NetherrackTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "NetherrackTile.h" NetherrackTile::NetherrackTile(int id) : Tile(id, Material::stone) {} \ No newline at end of file diff --git a/Minecraft.World/Blocks/NetherrackTile.h b/Minecraft.World/net/minecraft/world/level/tile/NetherrackTile.h similarity index 100% rename from Minecraft.World/Blocks/NetherrackTile.h rename to Minecraft.World/net/minecraft/world/level/tile/NetherrackTile.h diff --git a/Minecraft.World/Blocks/NotGateTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/NotGateTile.cpp similarity index 97% rename from Minecraft.World/Blocks/NotGateTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/NotGateTile.cpp index efaaec30a..8681dd4bd 100644 --- a/Minecraft.World/Blocks/NotGateTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/NotGateTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" #include "NotGateTile.h" -#include "../Util/SoundTypes.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/SoundTypes.h" +#include "../../net.minecraft.world.h" std::unordered_map*> NotGateTile::recentToggles = diff --git a/Minecraft.World/Blocks/NotGateTile.h b/Minecraft.World/net/minecraft/world/level/tile/NotGateTile.h similarity index 100% rename from Minecraft.World/Blocks/NotGateTile.h rename to Minecraft.World/net/minecraft/world/level/tile/NotGateTile.h diff --git a/Minecraft.World/Blocks/NoteBlockTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/NoteBlockTile.cpp similarity index 93% rename from Minecraft.World/Blocks/NoteBlockTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/NoteBlockTile.cpp index 578a4ddd4..ec2a7f62d 100644 --- a/Minecraft.World/Blocks/NoteBlockTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/NoteBlockTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "entity/net.minecraft.world.level.tile.entity.h" #include "NoteBlockTile.h" -#include "../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" NoteBlockTile::NoteBlockTile(int id) : BaseEntityTile(id, Material::wood) {} diff --git a/Minecraft.World/Blocks/NoteBlockTile.h b/Minecraft.World/net/minecraft/world/level/tile/NoteBlockTile.h similarity index 100% rename from Minecraft.World/Blocks/NoteBlockTile.h rename to Minecraft.World/net/minecraft/world/level/tile/NoteBlockTile.h diff --git a/Minecraft.World/Blocks/ObsidianTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ObsidianTile.cpp similarity index 84% rename from Minecraft.World/Blocks/ObsidianTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ObsidianTile.cpp index cf7ce9efc..f18a72251 100644 --- a/Minecraft.World/Blocks/ObsidianTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ObsidianTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ObsidianTile.h" ObsidianTile::ObsidianTile(int id) : StoneTile(id) {} diff --git a/Minecraft.World/Blocks/ObsidianTile.h b/Minecraft.World/net/minecraft/world/level/tile/ObsidianTile.h similarity index 100% rename from Minecraft.World/Blocks/ObsidianTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ObsidianTile.h diff --git a/Minecraft.World/Blocks/OreTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/OreTile.cpp similarity index 93% rename from Minecraft.World/Blocks/OreTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/OreTile.cpp index 1bf41cd11..0282275ac 100644 --- a/Minecraft.World/Blocks/OreTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/OreTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "OreTile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" OreTile::OreTile(int id) : Tile(id, Material::stone) {} diff --git a/Minecraft.World/Blocks/OreTile.h b/Minecraft.World/net/minecraft/world/level/tile/OreTile.h similarity index 100% rename from Minecraft.World/Blocks/OreTile.h rename to Minecraft.World/net/minecraft/world/level/tile/OreTile.h diff --git a/Minecraft.World/Blocks/PlantTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PlantTile.cpp similarity index 93% rename from Minecraft.World/Blocks/PlantTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PlantTile.cpp index 5789a441c..9e9f0f404 100644 --- a/Minecraft.World/Blocks/PlantTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PlantTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "GrassTile.h" #include "PlantTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" void Bush::_init() { setTicking(true); diff --git a/Minecraft.World/Blocks/PlantTile.h b/Minecraft.World/net/minecraft/world/level/tile/PlantTile.h similarity index 91% rename from Minecraft.World/Blocks/PlantTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PlantTile.h index 72c134196..b840efbaa 100644 --- a/Minecraft.World/Blocks/PlantTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/PlantTile.h @@ -1,7 +1,7 @@ #pragma once #include "Tile.h" -#include "Material.h" -#include "../Util/Definitions.h" +#include "../material/Material.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class Level; diff --git a/Minecraft.World/Blocks/PortalTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PortalTile.cpp similarity index 96% rename from Minecraft.World/Blocks/PortalTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PortalTile.cpp index 4a4a9e133..94538e474 100644 --- a/Minecraft.World/Blocks/PortalTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PortalTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../net.minecraft.world.level.h" +#include "../dimension/net.minecraft.world.level.dimension.h" +#include "../../item/net.minecraft.world.item.h" #include "PortalTile.h" #include -#include "Util/AABB.h" +#include "../../phys/AABB.h" #include "FireTile.h" PortalTile::PortalTile(int id) diff --git a/Minecraft.World/Blocks/PortalTile.h b/Minecraft.World/net/minecraft/world/level/tile/PortalTile.h similarity index 96% rename from Minecraft.World/Blocks/PortalTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PortalTile.h index c62fb1033..dcc1b2e0a 100644 --- a/Minecraft.World/Blocks/PortalTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/PortalTile.h @@ -1,7 +1,7 @@ #pragma once #include #include "HalfTransparentTile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; diff --git a/Minecraft.World/Blocks/PotatoTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PotatoTile.cpp similarity index 86% rename from Minecraft.World/Blocks/PotatoTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PotatoTile.cpp index 28ca09e94..2f7f96890 100644 --- a/Minecraft.World/Blocks/PotatoTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PotatoTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" #include "PotatoTile.h" PotatoTile::PotatoTile(int id) : CropTile(id) {} diff --git a/Minecraft.World/Blocks/PotatoTile.h b/Minecraft.World/net/minecraft/world/level/tile/PotatoTile.h similarity index 100% rename from Minecraft.World/Blocks/PotatoTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PotatoTile.h diff --git a/Minecraft.World/Blocks/PoweredMetalTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PoweredMetalTile.cpp similarity index 73% rename from Minecraft.World/Blocks/PoweredMetalTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PoweredMetalTile.cpp index 905774d05..326196ae4 100644 --- a/Minecraft.World/Blocks/PoweredMetalTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PoweredMetalTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../../Header Files/stdafx.h" +#include "../redstone/net.minecraft.world.level.redstone.h" #include "PoweredMetalTile.h" PoweredMetalTile::PoweredMetalTile(int id) : MetalTile(id) {} diff --git a/Minecraft.World/Blocks/PoweredMetalTile.h b/Minecraft.World/net/minecraft/world/level/tile/PoweredMetalTile.h similarity index 100% rename from Minecraft.World/Blocks/PoweredMetalTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PoweredMetalTile.h diff --git a/Minecraft.World/Blocks/PoweredRailTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PoweredRailTile.cpp similarity index 97% rename from Minecraft.World/Blocks/PoweredRailTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PoweredRailTile.cpp index a75fc74b9..e434c9ead 100644 --- a/Minecraft.World/Blocks/PoweredRailTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PoweredRailTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../net.minecraft.world.level.h" #include "PoweredRailTile.h" PoweredRailTile::PoweredRailTile(int id) : BaseRailTile(id, true) {} diff --git a/Minecraft.World/Blocks/PoweredRailTile.h b/Minecraft.World/net/minecraft/world/level/tile/PoweredRailTile.h similarity index 100% rename from Minecraft.World/Blocks/PoweredRailTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PoweredRailTile.h diff --git a/Minecraft.World/Blocks/PressurePlateTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PressurePlateTile.cpp similarity index 90% rename from Minecraft.World/Blocks/PressurePlateTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PressurePlateTile.cpp index c05ef5870..d3c96a1a1 100644 --- a/Minecraft.World/Blocks/PressurePlateTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PressurePlateTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" #include "PressurePlateTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" PressurePlateTile::PressurePlateTile(int id, const std::wstring& tex, Material* material, diff --git a/Minecraft.World/Blocks/PressurePlateTile.h b/Minecraft.World/net/minecraft/world/level/tile/PressurePlateTile.h similarity index 100% rename from Minecraft.World/Blocks/PressurePlateTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PressurePlateTile.h diff --git a/Minecraft.World/Blocks/PumpkinTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/PumpkinTile.cpp similarity index 96% rename from Minecraft.World/Blocks/PumpkinTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/PumpkinTile.cpp index 6ad35cc18..8c7809d88 100644 --- a/Minecraft.World/Blocks/PumpkinTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/PumpkinTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.animal.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/animal/net.minecraft.world.entity.animal.h" +#include "../net.minecraft.world.level.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "PumpkinTile.h" -#include "../Entities/Mob.h" -#include "../Entities/Mobs/SnowMan.h" -#include "../Entities/MobCategory.h" +#include "../../entity/Mob.h" +#include "../../entity/animal/SnowMan.h" +#include "../../entity/MobCategory.h" const std::wstring PumpkinTile::TEXTURE_FACE = L"pumpkin_face"; const std::wstring PumpkinTile::TEXTURE_LANTERN = L"pumpkin_jack"; diff --git a/Minecraft.World/Blocks/PumpkinTile.h b/Minecraft.World/net/minecraft/world/level/tile/PumpkinTile.h similarity index 100% rename from Minecraft.World/Blocks/PumpkinTile.h rename to Minecraft.World/net/minecraft/world/level/tile/PumpkinTile.h diff --git a/Minecraft.World/Blocks/QuartzBlockTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/QuartzBlockTile.cpp similarity index 94% rename from Minecraft.World/Blocks/QuartzBlockTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/QuartzBlockTile.cpp index c5d02b1eb..41ddbb5e7 100644 --- a/Minecraft.World/Blocks/QuartzBlockTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/QuartzBlockTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "QuartzBlockTile.h" // 4J Added -#include "../Level/Level.h" -#include "PistonBaseTile.h" -#include "../Player/Player.h" +#include "../Level.h" +#include "piston/PistonBaseTile.h" +#include "../../entity/player/Player.h" int QuartzBlockTile::BLOCK_NAMES[QUARTZ_BLOCK_NAMES] = { IDS_TILE_QUARTZ_BLOCK, IDS_TILE_QUARTZ_BLOCK_CHISELED, diff --git a/Minecraft.World/Blocks/QuartzBlockTile.h b/Minecraft.World/net/minecraft/world/level/tile/QuartzBlockTile.h similarity index 100% rename from Minecraft.World/Blocks/QuartzBlockTile.h rename to Minecraft.World/net/minecraft/world/level/tile/QuartzBlockTile.h diff --git a/Minecraft.World/Blocks/RailTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/RailTile.cpp similarity index 89% rename from Minecraft.World/Blocks/RailTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/RailTile.cpp index 5d72f9906..cf673e5b6 100644 --- a/Minecraft.World/Blocks/RailTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/RailTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" #include "RailTile.h" RailTile::RailTile(int id) : BaseRailTile(id, false) {} diff --git a/Minecraft.World/Blocks/RailTile.h b/Minecraft.World/net/minecraft/world/level/tile/RailTile.h similarity index 100% rename from Minecraft.World/Blocks/RailTile.h rename to Minecraft.World/net/minecraft/world/level/tile/RailTile.h diff --git a/Minecraft.World/Blocks/RedStoneDustTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp similarity index 96% rename from Minecraft.World/Blocks/RedStoneDustTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp index 8babbeaf9..bfe6c8b93 100644 --- a/Minecraft.World/Blocks/RedStoneDustTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp @@ -1,21 +1,21 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" #include "RedStoneDustTile.h" #include #include -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" -#include "../Util/Direction.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" +#include "../../../Direction.h" #include "DiodeTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" // AP - added for Vita to set Alpha Cut out -#include "../IO/Streams/IntBuffer.h" -#include "../../Minecraft.Client/Rendering/Tesselator.h" +#include "../../../../../ConsoleJavaLibs/IntBuffer.h" +#include "../../Minecraft.Client/net/minecraft/client/renderer/Tesselator.h" const std::wstring RedStoneDustTile::TEXTURE_CROSS = L"_cross"; const std::wstring RedStoneDustTile::TEXTURE_LINE = L"_line"; diff --git a/Minecraft.World/Blocks/RedStoneDustTile.h b/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.h similarity index 97% rename from Minecraft.World/Blocks/RedStoneDustTile.h rename to Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.h index e9656d395..7b8922a42 100644 --- a/Minecraft.World/Blocks/RedStoneDustTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.h @@ -1,7 +1,7 @@ #pragma once #include #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class Level; diff --git a/Minecraft.World/Blocks/RedStoneOreTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/RedStoneOreTile.cpp similarity index 96% rename from Minecraft.World/Blocks/RedStoneOreTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/RedStoneOreTile.cpp index 8e563d117..b3fecfc44 100644 --- a/Minecraft.World/Blocks/RedStoneOreTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/RedStoneOreTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "RedStoneOreTile.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../item/net.minecraft.world.item.h" RedStoneOreTile::RedStoneOreTile(int id, bool lit) : Tile(id, Material::stone) { if (lit) { diff --git a/Minecraft.World/Blocks/RedStoneOreTile.h b/Minecraft.World/net/minecraft/world/level/tile/RedStoneOreTile.h similarity index 100% rename from Minecraft.World/Blocks/RedStoneOreTile.h rename to Minecraft.World/net/minecraft/world/level/tile/RedStoneOreTile.h diff --git a/Minecraft.World/Blocks/RedLightTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/RedlightTile.cpp similarity index 89% rename from Minecraft.World/Blocks/RedLightTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/RedlightTile.cpp index 64322d8f5..9a11aa1e0 100644 --- a/Minecraft.World/Blocks/RedLightTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/RedlightTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.h" -#include "RedLightTile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.h" +#include "RedlightTile.h" RedlightTile::RedlightTile(int id, bool isLit) : Tile(id, Material::buildable_glass) { diff --git a/Minecraft.World/Blocks/RedLightTile.h b/Minecraft.World/net/minecraft/world/level/tile/RedlightTile.h similarity index 100% rename from Minecraft.World/Blocks/RedLightTile.h rename to Minecraft.World/net/minecraft/world/level/tile/RedlightTile.h diff --git a/Minecraft.World/Blocks/ReedTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ReedTile.cpp similarity index 91% rename from Minecraft.World/Blocks/ReedTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ReedTile.cpp index 716cf471e..aba9c321f 100644 --- a/Minecraft.World/Blocks/ReedTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ReedTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "GrassTile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../material/net.minecraft.world.level.material.h" +#include "../../phys/net.minecraft.world.phys.h" #include "ReedTile.h" #include diff --git a/Minecraft.World/Blocks/ReedTile.h b/Minecraft.World/net/minecraft/world/level/tile/ReedTile.h similarity index 95% rename from Minecraft.World/Blocks/ReedTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ReedTile.h index 4fbe21aa3..fb1667066 100644 --- a/Minecraft.World/Blocks/ReedTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/ReedTile.h @@ -2,7 +2,7 @@ #include #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; diff --git a/Minecraft.World/Blocks/RepeaterTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/RepeaterTile.cpp similarity index 93% rename from Minecraft.World/Blocks/RepeaterTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/RepeaterTile.cpp index 5afae29a9..a2d8054cd 100644 --- a/Minecraft.World/Blocks/RepeaterTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/RepeaterTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" #include "RepeaterTile.h" const double RepeaterTile::DELAY_RENDER_OFFSETS[4] = { diff --git a/Minecraft.World/Blocks/RepeaterTile.h b/Minecraft.World/net/minecraft/world/level/tile/RepeaterTile.h similarity index 100% rename from Minecraft.World/Blocks/RepeaterTile.h rename to Minecraft.World/net/minecraft/world/level/tile/RepeaterTile.h diff --git a/Minecraft.World/Blocks/RotatedPillarTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/RotatedPillarTile.cpp similarity index 95% rename from Minecraft.World/Blocks/RotatedPillarTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/RotatedPillarTile.cpp index 4d4b47e54..7c55f68f7 100644 --- a/Minecraft.World/Blocks/RotatedPillarTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/RotatedPillarTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" #include "RotatedPillarTile.h" RotatedPillarTile::RotatedPillarTile(int id, Material* material) diff --git a/Minecraft.World/Blocks/RotatedPillarTile.h b/Minecraft.World/net/minecraft/world/level/tile/RotatedPillarTile.h similarity index 100% rename from Minecraft.World/Blocks/RotatedPillarTile.h rename to Minecraft.World/net/minecraft/world/level/tile/RotatedPillarTile.h diff --git a/Minecraft.World/Blocks/SandStoneTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SandStoneTile.cpp similarity index 88% rename from Minecraft.World/Blocks/SandStoneTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SandStoneTile.cpp index 25bd067eb..e36126463 100644 --- a/Minecraft.World/Blocks/SandStoneTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SandStoneTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../material/net.minecraft.world.level.material.h" +#include "../../net.minecraft.world.h" #include "SandStoneTile.h" const std::wstring SandStoneTile::TEXTURE_TOP = L"sandstone_top"; diff --git a/Minecraft.World/Blocks/SandStoneTile.h b/Minecraft.World/net/minecraft/world/level/tile/SandStoneTile.h similarity index 100% rename from Minecraft.World/Blocks/SandStoneTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SandStoneTile.h diff --git a/Minecraft.World/Blocks/SaplingPlantTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SaplingPlantTile.cpp similarity index 94% rename from Minecraft.World/Blocks/SaplingPlantTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SaplingPlantTile.cpp index c0c1ecdbd..ba9ccd744 100644 --- a/Minecraft.World/Blocks/SaplingPlantTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SaplingPlantTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.levelgen.feature.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" +#include "../../net.minecraft.world.h" #include "SaplingPlantTile.h" diff --git a/Minecraft.World/Blocks/SaplingPlantTile.h b/Minecraft.World/net/minecraft/world/level/tile/SaplingPlantTile.h similarity index 100% rename from Minecraft.World/Blocks/SaplingPlantTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SaplingPlantTile.h diff --git a/Minecraft.World/Blocks/SignTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SignTile.cpp similarity index 93% rename from Minecraft.World/Blocks/SignTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SignTile.cpp index 85c53aaf1..2884fb56c 100644 --- a/Minecraft.World/Blocks/SignTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SignTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "Material.h" -#include "TileEntities/SignTileEntity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../material/Material.h" +#include "entity/SignTileEntity.h" #include "SignTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" #include diff --git a/Minecraft.World/Blocks/SignTile.h b/Minecraft.World/net/minecraft/world/level/tile/SignTile.h similarity index 91% rename from Minecraft.World/Blocks/SignTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SignTile.h index 952b5e1cc..930715b2a 100644 --- a/Minecraft.World/Blocks/SignTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/SignTile.h @@ -2,10 +2,10 @@ #include #include "BaseEntityTile.h" -#include "TileEntities/TileEntity.h" +#include "entity/TileEntity.h" -#include "../Platform/stdafx.h" -#include "Material.h" +#include "../../../../../Header Files/stdafx.h" +#include "../material/Material.h" class SignTile : public BaseEntityTile { friend class Tile; diff --git a/Minecraft.World/Blocks/SkullTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SkullTile.cpp similarity index 97% rename from Minecraft.World/Blocks/SkullTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SkullTile.cpp index 8594baaad..fc1864c5d 100644 --- a/Minecraft.World/Blocks/SkullTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SkullTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Entities/Mobs/WitherBoss.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../../entity/boss/wither/WitherBoss.h" +#include "../../../net.minecraft.h" #include "SkullTile.h" SkullTile::SkullTile(int id) : BaseEntityTile(id, Material::decoration, false) { diff --git a/Minecraft.World/Blocks/SkullTile.h b/Minecraft.World/net/minecraft/world/level/tile/SkullTile.h similarity index 100% rename from Minecraft.World/Blocks/SkullTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SkullTile.h diff --git a/Minecraft.World/Blocks/SmoothStoneBrickTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SmoothStoneBrickTile.cpp similarity index 94% rename from Minecraft.World/Blocks/SmoothStoneBrickTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SmoothStoneBrickTile.cpp index 76faab042..18177e0b5 100644 --- a/Minecraft.World/Blocks/SmoothStoneBrickTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SmoothStoneBrickTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "SmoothStoneBrickTile.h" -#include "../Headers/net.minecraft.world.h" +#include "../../net.minecraft.world.h" const std::wstring SmoothStoneBrickTile::TEXTURE_NAMES[] = { L"", L"mossy", L"cracked", L"carved"}; diff --git a/Minecraft.World/Blocks/SmoothStoneBrickTile.h b/Minecraft.World/net/minecraft/world/level/tile/SmoothStoneBrickTile.h similarity index 100% rename from Minecraft.World/Blocks/SmoothStoneBrickTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SmoothStoneBrickTile.h diff --git a/Minecraft.World/Blocks/SnowTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SnowTile.cpp similarity index 82% rename from Minecraft.World/Blocks/SnowTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SnowTile.cpp index 801714d8b..e7bfdc31a 100644 --- a/Minecraft.World/Blocks/SnowTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SnowTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../item/net.minecraft.world.item.h" #include "SnowTile.h" SnowTile::SnowTile(int id) : Tile(id, Material::snow) { setTicking(true); } diff --git a/Minecraft.World/Blocks/SnowTile.h b/Minecraft.World/net/minecraft/world/level/tile/SnowTile.h similarity index 100% rename from Minecraft.World/Blocks/SnowTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SnowTile.h diff --git a/Minecraft.World/Blocks/SoulSandTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SoulSandTile.cpp similarity index 74% rename from Minecraft.World/Blocks/SoulSandTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SoulSandTile.cpp index b9f7b48df..070baf708 100644 --- a/Minecraft.World/Blocks/SoulSandTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SoulSandTile.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../phys/net.minecraft.world.phys.h" #include "SoulSandTile.h" SoulSandTile::SoulSandTile(int id) : Tile(id, Material::sand) {} diff --git a/Minecraft.World/Blocks/SoulSandTile.h b/Minecraft.World/net/minecraft/world/level/tile/SoulSandTile.h similarity index 84% rename from Minecraft.World/Blocks/SoulSandTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SoulSandTile.h index b45c8dc53..6a19d52e5 100644 --- a/Minecraft.World/Blocks/SoulSandTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/SoulSandTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class SoulSandTile : public Tile { public: diff --git a/Minecraft.World/Blocks/SpongeTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/SpongeTile.cpp similarity index 53% rename from Minecraft.World/Blocks/SpongeTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/SpongeTile.cpp index 434c98e6f..bec292e18 100644 --- a/Minecraft.World/Blocks/SpongeTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/SpongeTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "SpongeTile.h" diff --git a/Minecraft.World/Blocks/SpongeTile.h b/Minecraft.World/net/minecraft/world/level/tile/SpongeTile.h similarity index 100% rename from Minecraft.World/Blocks/SpongeTile.h rename to Minecraft.World/net/minecraft/world/level/tile/SpongeTile.h diff --git a/Minecraft.World/Blocks/StainedGlassBlock.cpp b/Minecraft.World/net/minecraft/world/level/tile/StainedGlassBlock.cpp similarity index 88% rename from Minecraft.World/Blocks/StainedGlassBlock.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StainedGlassBlock.cpp index 59f15729b..7fe2a4475 100644 --- a/Minecraft.World/Blocks/StainedGlassBlock.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StainedGlassBlock.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.h" #include "StainedGlassBlock.h" Icon* StainedGlassBlock::ICONS[StainedGlassBlock::ICONS_LENGTH]; diff --git a/Minecraft.World/Blocks/StainedGlassBlock.h b/Minecraft.World/net/minecraft/world/level/tile/StainedGlassBlock.h similarity index 100% rename from Minecraft.World/Blocks/StainedGlassBlock.h rename to Minecraft.World/net/minecraft/world/level/tile/StainedGlassBlock.h diff --git a/Minecraft.World/Blocks/StainedGlassPaneBlock.cpp b/Minecraft.World/net/minecraft/world/level/tile/StainedGlassPaneBlock.cpp similarity index 90% rename from Minecraft.World/Blocks/StainedGlassPaneBlock.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StainedGlassPaneBlock.cpp index b1484a92d..79b083262 100644 --- a/Minecraft.World/Blocks/StainedGlassPaneBlock.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StainedGlassPaneBlock.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.h" +#include "../../item/net.minecraft.world.item.h" #include "StainedGlassPaneBlock.h" Icon* StainedGlassPaneBlock::ICONS[StainedGlassPaneBlock::ICONS_COUNT]; diff --git a/Minecraft.World/Blocks/StainedGlassPaneBlock.h b/Minecraft.World/net/minecraft/world/level/tile/StainedGlassPaneBlock.h similarity index 100% rename from Minecraft.World/Blocks/StainedGlassPaneBlock.h rename to Minecraft.World/net/minecraft/world/level/tile/StainedGlassPaneBlock.h diff --git a/Minecraft.World/Blocks/StairTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp similarity index 98% rename from Minecraft.World/Blocks/StairTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp index 7cf98ba3f..a32b78392 100644 --- a/Minecraft.World/Blocks/StairTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.level.h" +#include "../../../net.minecraft.h" #include "StairTile.h" int StairTile::DEAD_SPACES[8][2] = {{2, 6}, {3, 7}, {2, 3}, {6, 7}, diff --git a/Minecraft.World/Blocks/StairTile.h b/Minecraft.World/net/minecraft/world/level/tile/StairTile.h similarity index 100% rename from Minecraft.World/Blocks/StairTile.h rename to Minecraft.World/net/minecraft/world/level/tile/StairTile.h diff --git a/Minecraft.World/Blocks/StemTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/StemTile.cpp similarity index 94% rename from Minecraft.World/Blocks/StemTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StemTile.cpp index 4f8665136..acc805dab 100644 --- a/Minecraft.World/Blocks/StemTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StemTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Platform/Common/Colours/ColourTable.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../Minecraft.Client/Common/Source Files/Colours/ColourTable.h" #include "StemTile.h" const std::wstring StemTile::TEXTURE_ANGLED = L"stem_bent"; diff --git a/Minecraft.World/Blocks/StemTile.h b/Minecraft.World/net/minecraft/world/level/tile/StemTile.h similarity index 100% rename from Minecraft.World/Blocks/StemTile.h rename to Minecraft.World/net/minecraft/world/level/tile/StemTile.h diff --git a/Minecraft.World/Blocks/StoneButtonTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/StoneButtonTile.cpp similarity index 70% rename from Minecraft.World/Blocks/StoneButtonTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StoneButtonTile.cpp index 99bfb96a0..4e8090573 100644 --- a/Minecraft.World/Blocks/StoneButtonTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StoneButtonTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" #include "StoneButtonTile.h" StoneButtonTile::StoneButtonTile(int id) : ButtonTile(id, false) {} diff --git a/Minecraft.World/Blocks/StoneButtonTile.h b/Minecraft.World/net/minecraft/world/level/tile/StoneButtonTile.h similarity index 100% rename from Minecraft.World/Blocks/StoneButtonTile.h rename to Minecraft.World/net/minecraft/world/level/tile/StoneButtonTile.h diff --git a/Minecraft.World/Blocks/StoneMonsterTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/StoneMonsterTile.cpp similarity index 93% rename from Minecraft.World/Blocks/StoneMonsterTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StoneMonsterTile.cpp index 09af1cf27..9c1b3ea52 100644 --- a/Minecraft.World/Blocks/StoneMonsterTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StoneMonsterTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.monster.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/monster/net.minecraft.world.entity.monster.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" #include "StoneMonsterTile.h" const unsigned int diff --git a/Minecraft.World/Blocks/StoneMonsterTile.h b/Minecraft.World/net/minecraft/world/level/tile/StoneMonsterTile.h similarity index 100% rename from Minecraft.World/Blocks/StoneMonsterTile.h rename to Minecraft.World/net/minecraft/world/level/tile/StoneMonsterTile.h diff --git a/Minecraft.World/Blocks/StoneSlabTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/StoneSlabTile.cpp similarity index 91% rename from Minecraft.World/Blocks/StoneSlabTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StoneSlabTile.cpp index 845bc1689..5f33d7314 100644 --- a/Minecraft.World/Blocks/StoneSlabTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StoneSlabTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../net.minecraft.world.h" #include "StoneSlabTile.h" const unsigned int StoneSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = { diff --git a/Minecraft.World/Blocks/StoneSlabTile.h b/Minecraft.World/net/minecraft/world/level/tile/StoneSlabTile.h similarity index 100% rename from Minecraft.World/Blocks/StoneSlabTile.h rename to Minecraft.World/net/minecraft/world/level/tile/StoneSlabTile.h diff --git a/Minecraft.World/Blocks/StoneTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/StoneTile.cpp similarity index 80% rename from Minecraft.World/Blocks/StoneTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/StoneTile.cpp index 8d22a5879..8cc313703 100644 --- a/Minecraft.World/Blocks/StoneTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/StoneTile.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "StoneTile.h" StoneTile::StoneTile(int id) : Tile(id, Material::stone) {} diff --git a/Minecraft.World/Blocks/StoneTile.h b/Minecraft.World/net/minecraft/world/level/tile/StoneTile.h similarity index 100% rename from Minecraft.World/Blocks/StoneTile.h rename to Minecraft.World/net/minecraft/world/level/tile/StoneTile.h diff --git a/Minecraft.World/Blocks/TallGrassPlantTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TallGrassPlantTile.cpp similarity index 89% rename from Minecraft.World/Blocks/TallGrassPlantTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TallGrassPlantTile.cpp index 3367d28ca..194c0acfa 100644 --- a/Minecraft.World/Blocks/TallGrassPlantTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TallGrassPlantTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../net.minecraft.world.h" #include "TallGrassPlantTile.h" const unsigned int diff --git a/Minecraft.World/Blocks/TallGrassPlantTile.h b/Minecraft.World/net/minecraft/world/level/tile/TallGrassPlantTile.h similarity index 100% rename from Minecraft.World/Blocks/TallGrassPlantTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TallGrassPlantTile.h diff --git a/Minecraft.World/Blocks/TheEndPortalFrameTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp similarity index 92% rename from Minecraft.World/Blocks/TheEndPortalFrameTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp index 2c531b244..4fe615f56 100644 --- a/Minecraft.World/Blocks/TheEndPortalFrameTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "TheEndPortalFrameTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.h" -#include "../Util/Facing.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../net.minecraft.world.h" +#include "../../../Facing.h" const std::wstring TheEndPortalFrameTile::TEXTURE_EYE = L"endframe_eye"; diff --git a/Minecraft.World/Blocks/TheEndPortalFrameTile.h b/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.h similarity index 100% rename from Minecraft.World/Blocks/TheEndPortalFrameTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.h diff --git a/Minecraft.World/Blocks/ThinFenceTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp similarity index 96% rename from Minecraft.World/Blocks/ThinFenceTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp index b11a29bfa..7b0257264 100644 --- a/Minecraft.World/Blocks/ThinFenceTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "ThinFenceTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" ThinFenceTile::ThinFenceTile(int id, const std::wstring& tex, const std::wstring& edgeTex, Material* material, diff --git a/Minecraft.World/Blocks/ThinFenceTile.h b/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h similarity index 96% rename from Minecraft.World/Blocks/ThinFenceTile.h rename to Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h index d7ba84fa0..324cdf66b 100644 --- a/Minecraft.World/Blocks/ThinFenceTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class ThinFenceTile : public Tile { private: diff --git a/Minecraft.World/Blocks/Tile.cpp b/Minecraft.World/net/minecraft/world/level/tile/Tile.cpp similarity index 99% rename from Minecraft.World/Blocks/Tile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/Tile.cpp index 995e37598..5fa259587 100644 --- a/Minecraft.World/Blocks/Tile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/Tile.cpp @@ -1,21 +1,21 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.locale.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.item.enchantment.h" -#include "../Headers/net.minecraft.world.level.material.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.tile.entity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.food.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" -#include "Util/Vec3.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../../locale/net.minecraft.locale.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../item/enchantment/net.minecraft.world.item.enchantment.h" +#include "../material/net.minecraft.world.level.material.h" +#include "net.minecraft.world.level.tile.h" +#include "entity/net.minecraft.world.level.tile.entity.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../food/net.minecraft.world.food.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" +#include "../../phys/Vec3.h" #include "Tile.h" #include diff --git a/Minecraft.World/Blocks/Tile.h b/Minecraft.World/net/minecraft/world/level/tile/Tile.h similarity index 99% rename from Minecraft.World/Blocks/Tile.h rename to Minecraft.World/net/minecraft/world/level/tile/Tile.h index baffa8ebb..61c0e2283 100644 --- a/Minecraft.World/Blocks/Tile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/Tile.h @@ -1,8 +1,8 @@ #pragma once -#include "Material.h" -#include "../Util/Vec3.h" -#include "../Util/Definitions.h" -#include "../Util/SoundTypes.h" +#include "../material/Material.h" +#include "../../phys/Vec3.h" +#include "../../../../../ConsoleHelpers/Definitions.h" +#include "../../../../../Header Files/SoundTypes.h" #include #include diff --git a/Minecraft.World/Blocks/TntTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TntTile.cpp similarity index 91% rename from Minecraft.World/Blocks/TntTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TntTile.cpp index e067d0569..914419cc4 100644 --- a/Minecraft.World/Blocks/TntTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TntTile.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.entity.projectile.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../entity/projectile/net.minecraft.world.entity.projectile.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "TntTile.h" -#include "../Util/SoundTypes.h" +#include "../../../../../Header Files/SoundTypes.h" TntTile::TntTile(int id) : Tile(id, Material::explosive) { iconTop = nullptr; diff --git a/Minecraft.World/Blocks/TntTile.h b/Minecraft.World/net/minecraft/world/level/tile/TntTile.h similarity index 100% rename from Minecraft.World/Blocks/TntTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TntTile.h diff --git a/Minecraft.World/Blocks/TopSnowTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TopSnowTile.cpp similarity index 92% rename from Minecraft.World/Blocks/TopSnowTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TopSnowTile.cpp index 54a5ea5a3..e31c2008a 100644 --- a/Minecraft.World/Blocks/TopSnowTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TopSnowTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../net.minecraft.world.h" #include "TopSnowTile.h" const int TopSnowTile::MAX_HEIGHT = 6; diff --git a/Minecraft.World/Blocks/TopSnowTile.h b/Minecraft.World/net/minecraft/world/level/tile/TopSnowTile.h similarity index 100% rename from Minecraft.World/Blocks/TopSnowTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TopSnowTile.h diff --git a/Minecraft.World/Blocks/TorchTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TorchTile.cpp similarity index 97% rename from Minecraft.World/Blocks/TorchTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TorchTile.cpp index c3d742531..ac6bba5f1 100644 --- a/Minecraft.World/Blocks/TorchTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TorchTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" #include "TorchTile.h" #include -#include "Util/AABB.h" +#include "../../phys/AABB.h" TorchTile::TorchTile(int id) : Tile(id, Material::decoration, false) { this->setTicking(true); diff --git a/Minecraft.World/Blocks/TorchTile.h b/Minecraft.World/net/minecraft/world/level/tile/TorchTile.h similarity index 97% rename from Minecraft.World/Blocks/TorchTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TorchTile.h index 525f851cc..b8312881e 100644 --- a/Minecraft.World/Blocks/TorchTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/TorchTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Definitions.h" +#include "../../../../../ConsoleHelpers/Definitions.h" class Random; class HitResult; diff --git a/Minecraft.World/Blocks/TransparentTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TransparentTile.cpp similarity index 87% rename from Minecraft.World/Blocks/TransparentTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TransparentTile.cpp index 44fddb081..55ce7283f 100644 --- a/Minecraft.World/Blocks/TransparentTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TransparentTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" #include "TransparentTile.h" TransparentTile::TransparentTile(int id, Material* material, bool allowSame, diff --git a/Minecraft.World/Blocks/TransparentTile.h b/Minecraft.World/net/minecraft/world/level/tile/TransparentTile.h similarity index 100% rename from Minecraft.World/Blocks/TransparentTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TransparentTile.h diff --git a/Minecraft.World/Blocks/TrapDoorTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TrapDoorTile.cpp similarity index 95% rename from Minecraft.World/Blocks/TrapDoorTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TrapDoorTile.cpp index 97efb0390..7ad5c5161 100644 --- a/Minecraft.World/Blocks/TrapDoorTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TrapDoorTile.cpp @@ -1,10 +1,10 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "net.minecraft.world.level.tile.h" +#include "../../../net.minecraft.h" #include "TrapDoorTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" TrapDoorTile::TrapDoorTile(int id, Material* material) : Tile(id, material, false) { diff --git a/Minecraft.World/Blocks/TrapDoorTile.h b/Minecraft.World/net/minecraft/world/level/tile/TrapDoorTile.h similarity index 100% rename from Minecraft.World/Blocks/TrapDoorTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TrapDoorTile.h diff --git a/Minecraft.World/Blocks/TreeTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TreeTile.cpp similarity index 92% rename from Minecraft.World/Blocks/TreeTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TreeTile.cpp index 8bf398d18..ba3937938 100644 --- a/Minecraft.World/Blocks/TreeTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TreeTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.piston.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "piston/net.minecraft.world.level.tile.piston.h" +#include "../../../net.minecraft.h" +#include "../../net.minecraft.world.h" #include "LeafTile.h" #include "TreeTile.h" diff --git a/Minecraft.World/Blocks/TreeTile.h b/Minecraft.World/net/minecraft/world/level/tile/TreeTile.h similarity index 100% rename from Minecraft.World/Blocks/TreeTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TreeTile.h diff --git a/Minecraft.World/Blocks/TripWireSourceTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TripWireSourceTile.cpp similarity index 97% rename from Minecraft.World/Blocks/TripWireSourceTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TripWireSourceTile.cpp index f2e4a4a30..f3524c2e0 100644 --- a/Minecraft.World/Blocks/TripWireSourceTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TripWireSourceTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.level.redstone.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../redstone/net.minecraft.world.level.redstone.h" #include "TripWireSourceTile.h" #include "optional" -#include "Util/AABB.h" +#include "../../phys/AABB.h" TripWireSourceTile::TripWireSourceTile(int id) : Tile(id, Material::decoration, false) { diff --git a/Minecraft.World/Blocks/TripWireSourceTile.h b/Minecraft.World/net/minecraft/world/level/tile/TripWireSourceTile.h similarity index 100% rename from Minecraft.World/Blocks/TripWireSourceTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TripWireSourceTile.h diff --git a/Minecraft.World/Blocks/TripWireTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/TripWireTile.cpp similarity index 96% rename from Minecraft.World/Blocks/TripWireTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/TripWireTile.cpp index 3fc850110..adccc308c 100644 --- a/Minecraft.World/Blocks/TripWireTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/TripWireTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../item/net.minecraft.world.item.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" #include "TripWireTile.h" #include diff --git a/Minecraft.World/Blocks/TripWireTile.h b/Minecraft.World/net/minecraft/world/level/tile/TripWireTile.h similarity index 100% rename from Minecraft.World/Blocks/TripWireTile.h rename to Minecraft.World/net/minecraft/world/level/tile/TripWireTile.h diff --git a/Minecraft.World/Blocks/VineTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp similarity index 97% rename from Minecraft.World/Blocks/VineTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp index 3c527ece7..1f9fcf8b6 100644 --- a/Minecraft.World/Blocks/VineTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp @@ -1,13 +1,13 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "VineTile.h" -#include "Material.h" -#include "../Util/JavaMath.h" -#include "../Util/Facing.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "Util/AABB.h" +#include "../material/Material.h" +#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "../../../Facing.h" +#include "../net.minecraft.world.level.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../phys/AABB.h" VineTile::VineTile(int id) : Tile(id, Material::replaceable_plant, false) { setTicking(true); diff --git a/Minecraft.World/Blocks/VineTile.h b/Minecraft.World/net/minecraft/world/level/tile/VineTile.h similarity index 98% rename from Minecraft.World/Blocks/VineTile.h rename to Minecraft.World/net/minecraft/world/level/tile/VineTile.h index dc123a38c..3a09402b9 100644 --- a/Minecraft.World/Blocks/VineTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/VineTile.h @@ -1,6 +1,6 @@ #pragma once #include "Tile.h" -#include "../Util/Direction.h" +#include "../../../Direction.h" class Level; class LevelSource; diff --git a/Minecraft.World/Blocks/WallTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WallTile.cpp similarity index 94% rename from Minecraft.World/Blocks/WallTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WallTile.cpp index 8ebe33a39..80407daa3 100644 --- a/Minecraft.World/Blocks/WallTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WallTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.tile.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "WallTile.h" const float WallTile::WALL_WIDTH = 3.0f / 16.0f; diff --git a/Minecraft.World/Blocks/WallTile.h b/Minecraft.World/net/minecraft/world/level/tile/WallTile.h similarity index 100% rename from Minecraft.World/Blocks/WallTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WallTile.h diff --git a/Minecraft.World/Blocks/WaterLilyTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp similarity index 89% rename from Minecraft.World/Blocks/WaterLilyTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp index 29f76bc34..7145db598 100644 --- a/Minecraft.World/Blocks/WaterLilyTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp @@ -1,9 +1,9 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "WaterLilyTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../Util/AABB.h" +#include "../net.minecraft.world.level.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../phys/AABB.h" WaterlilyTile::WaterlilyTile(int id) : Bush(id) { this->updateDefaultShape(); } diff --git a/Minecraft.World/Blocks/WaterLilyTile.h b/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.h similarity index 100% rename from Minecraft.World/Blocks/WaterLilyTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.h diff --git a/Minecraft.World/Blocks/WebTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WebTile.cpp similarity index 81% rename from Minecraft.World/Blocks/WebTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WebTile.cpp index 043079a99..14046bb92 100644 --- a/Minecraft.World/Blocks/WebTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WebTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.item.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/net.minecraft.world.entity.h" +#include "../../item/net.minecraft.world.item.h" #include "WebTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" WebTile::WebTile(int id) : Tile(id, Material::web) {} diff --git a/Minecraft.World/Blocks/WebTile.h b/Minecraft.World/net/minecraft/world/level/tile/WebTile.h similarity index 100% rename from Minecraft.World/Blocks/WebTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WebTile.h diff --git a/Minecraft.World/Blocks/WeightedPressurePlateTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WeightedPressurePlateTile.cpp similarity index 80% rename from Minecraft.World/Blocks/WeightedPressurePlateTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WeightedPressurePlateTile.cpp index 850a21dfc..18a429aec 100644 --- a/Minecraft.World/Blocks/WeightedPressurePlateTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WeightedPressurePlateTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.item.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.redstone.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Entities/Entity.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/item/net.minecraft.world.entity.item.h" +#include "../net.minecraft.world.level.h" +#include "../redstone/net.minecraft.world.level.redstone.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../entity/Entity.h" #include "WeightedPressurePlateTile.h" -#include "Util/AABB.h" +#include "../../phys/AABB.h" WeightedPressurePlateTile::WeightedPressurePlateTile(int id, const std::wstring& tex, diff --git a/Minecraft.World/Blocks/WeightedPressurePlateTile.h b/Minecraft.World/net/minecraft/world/level/tile/WeightedPressurePlateTile.h similarity index 100% rename from Minecraft.World/Blocks/WeightedPressurePlateTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WeightedPressurePlateTile.h diff --git a/Minecraft.World/Blocks/WoodButtonTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WoodButtonTile.cpp similarity index 70% rename from Minecraft.World/Blocks/WoodButtonTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WoodButtonTile.cpp index 3129003de..ad691b2e9 100644 --- a/Minecraft.World/Blocks/WoodButtonTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WoodButtonTile.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../../net.minecraft.h" #include "WoodButtonTile.h" WoodButtonTile::WoodButtonTile(int id) : ButtonTile(id, true) {} diff --git a/Minecraft.World/Blocks/WoodButtonTile.h b/Minecraft.World/net/minecraft/world/level/tile/WoodButtonTile.h similarity index 100% rename from Minecraft.World/Blocks/WoodButtonTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WoodButtonTile.h diff --git a/Minecraft.World/Blocks/WoodSlabTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WoodSlabTile.cpp similarity index 85% rename from Minecraft.World/Blocks/WoodSlabTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WoodSlabTile.cpp index b0d8b7abd..242a5c46d 100644 --- a/Minecraft.World/Blocks/WoodSlabTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WoodSlabTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "WoodSlabTile.h" #include "WoodTile.h" #include "TreeTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.stats.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../stats/net.minecraft.stats.h" const unsigned int WoodSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = { IDS_TILE_STONESLAB_OAK, diff --git a/Minecraft.World/Blocks/WoodSlabTile.h b/Minecraft.World/net/minecraft/world/level/tile/WoodSlabTile.h similarity index 100% rename from Minecraft.World/Blocks/WoodSlabTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WoodSlabTile.h diff --git a/Minecraft.World/Blocks/WoodTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WoodTile.cpp similarity index 80% rename from Minecraft.World/Blocks/WoodTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WoodTile.cpp index 39c6def5a..c6a1dec3b 100644 --- a/Minecraft.World/Blocks/WoodTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WoodTile.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "WoodTile.h" #include "TreeTile.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.biome.h" -#include "../Headers/net.minecraft.world.item.h" -#include "../Headers/net.minecraft.stats.h" -#include "../Headers/net.minecraft.world.h" +#include "../net.minecraft.world.level.h" +#include "../biome/net.minecraft.world.level.biome.h" +#include "../../item/net.minecraft.world.item.h" +#include "../../../stats/net.minecraft.stats.h" +#include "../../net.minecraft.world.h" const unsigned int WoodTile::WOOD_NAMES[WOOD_NAMES_LENGTH] = { IDS_TILE_OAKWOOD_PLANKS, diff --git a/Minecraft.World/Blocks/WoodTile.h b/Minecraft.World/net/minecraft/world/level/tile/WoodTile.h similarity index 100% rename from Minecraft.World/Blocks/WoodTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WoodTile.h diff --git a/Minecraft.World/Blocks/WoolCarpetTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WoolCarpetTile.cpp similarity index 93% rename from Minecraft.World/Blocks/WoolCarpetTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WoolCarpetTile.cpp index 23222cb18..525e42ee3 100644 --- a/Minecraft.World/Blocks/WoolCarpetTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WoolCarpetTile.cpp @@ -1,7 +1,7 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.phys.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Util/SharedConstants.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../phys/net.minecraft.world.phys.h" +#include "../net.minecraft.world.level.h" +#include "../../../SharedConstants.h" #include "WoolCarpetTile.h" WoolCarpetTile::WoolCarpetTile(int id) diff --git a/Minecraft.World/Blocks/WoolCarpetTile.h b/Minecraft.World/net/minecraft/world/level/tile/WoolCarpetTile.h similarity index 100% rename from Minecraft.World/Blocks/WoolCarpetTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WoolCarpetTile.h diff --git a/Minecraft.World/Blocks/WorkbenchTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/WorkbenchTile.cpp similarity index 83% rename from Minecraft.World/Blocks/WorkbenchTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/WorkbenchTile.cpp index 8929f2116..cadbcc8f3 100644 --- a/Minecraft.World/Blocks/WorkbenchTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/WorkbenchTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" -#include "../Headers/net.minecraft.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" +#include "../net.minecraft.world.level.h" +#include "../../net.minecraft.world.h" +#include "../../../net.minecraft.h" #include "WorkbenchTile.h" WorkbenchTile::WorkbenchTile(int id) : Tile(id, Material::wood) { diff --git a/Minecraft.World/Blocks/WorkbenchTile.h b/Minecraft.World/net/minecraft/world/level/tile/WorkbenchTile.h similarity index 100% rename from Minecraft.World/Blocks/WorkbenchTile.h rename to Minecraft.World/net/minecraft/world/level/tile/WorkbenchTile.h diff --git a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/BeaconTileEntity.cpp similarity index 95% rename from Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/BeaconTileEntity.cpp index 90ee61dd9..2b3a03672 100644 --- a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/BeaconTileEntity.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.network.packet.h" -#include "../../Headers/net.minecraft.world.effect.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../network/packet/net.minecraft.network.packet.h" +#include "../../../effect/net.minecraft.world.effect.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "BeaconTileEntity.h" std::shared_ptr BeaconTileEntity::clone() { diff --git a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/BeaconTileEntity.h similarity index 98% rename from Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/BeaconTileEntity.h index 64d6af548..d5c4ea070 100644 --- a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/BeaconTileEntity.h @@ -1,6 +1,6 @@ #pragma once #include "TileEntity.h" -#include "../../Containers/Container.h" +#include "../../../Container.h" class BeaconTileEntity : public TileEntity, public Container { public: diff --git a/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp similarity index 97% rename from Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp index 8341a6758..8c0c2a067 100644 --- a/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "BrewingStandTileEntity.h" -#include "../../Util/SharedConstants.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.alchemy.h" +#include "../../../../SharedConstants.h" +#include "../../../../net.minecraft.h" +#include "../../net.minecraft.world.level.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../item/alchemy/net.minecraft.world.item.alchemy.h" int slotsForUp[] = {BrewingStandTileEntity::INGREDIENT_SLOT}; int slotsForOtherFaces[] = {0, 1, 2}; diff --git a/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h similarity index 97% rename from Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h index 13f689576..313e5d56c 100644 --- a/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h @@ -1,6 +1,6 @@ #pragma once #include "TileEntity.h" -#include "../../Containers/WorldlyContainer.h" +#include "../../../WorldlyContainer.h" class BrewingStandTileEntity : public TileEntity, public WorldlyContainer { public: diff --git a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp similarity index 94% rename from Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp index 2a17b1566..e7945c4a5 100644 --- a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp @@ -1,17 +1,17 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../net.minecraft.world.h" +#include "../../net.minecraft.world.level.h" #include "TileEntity.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.inventory.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.phys.h" +#include "../../../entity/item/net.minecraft.world.entity.item.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../inventory/net.minecraft.world.inventory.h" +#include "../net.minecraft.world.level.tile.h" +#include "../../../phys/net.minecraft.world.phys.h" #include "ChestTileEntity.h" -#include "../../Network/Packets/ContainerOpenPacket.h" -#include "../../Util/SoundTypes.h" +#include "../../../../network/packet/ContainerOpenPacket.h" +#include "../../../../../../Header Files/SoundTypes.h" int ChestTileEntity::getContainerType() { if (isBonusChest) diff --git a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h similarity index 96% rename from Minecraft.World/Blocks/TileEntities/ChestTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h index 5705aa8e2..9d9ade4f8 100644 --- a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h @@ -1,9 +1,9 @@ #pragma once #include "TileEntity.h" -#include "../../Containers/Container.h" +#include "../../../Container.h" -#include "../../IO/NBT/ListTag.h" +#include "../../../../../../com/mojang/nbt/ListTag.h" class Player; class CompoundTag; diff --git a/Minecraft.World/Blocks/TileEntities/CommandBlockEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/CommandBlockEntity.cpp similarity index 88% rename from Minecraft.World/Blocks/TileEntities/CommandBlockEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/CommandBlockEntity.cpp index 576ea0612..f45c036ed 100644 --- a/Minecraft.World/Blocks/TileEntities/CommandBlockEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/CommandBlockEntity.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.network.packet.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.commands.h" -#include "../../../Minecraft.Client/MinecraftServer.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../network/packet/net.minecraft.network.packet.h" +#include "../../net.minecraft.world.level.h" +#include "../../../../commands/net.minecraft.commands.h" +#include "../../../Minecraft.Client/net/minecraft/server/MinecraftServer.h" #include "CommandBlockEntity.h" CommandBlockEntity::CommandBlockEntity() { diff --git a/Minecraft.World/Blocks/TileEntities/CommandBlockEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/CommandBlockEntity.h similarity index 96% rename from Minecraft.World/Blocks/TileEntities/CommandBlockEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/CommandBlockEntity.h index c6d4fae6f..4727809e5 100644 --- a/Minecraft.World/Blocks/TileEntities/CommandBlockEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/CommandBlockEntity.h @@ -1,7 +1,7 @@ #pragma once #include "TileEntity.h" -#include "../../Commands/CommandSender.h" +#include "../../../../commands/CommandSender.h" class ChatMessageComponent; diff --git a/Minecraft.World/Blocks/TileEntities/ComparatorTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/ComparatorTileEntity.cpp similarity index 93% rename from Minecraft.World/Blocks/TileEntities/ComparatorTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/ComparatorTileEntity.cpp index 35aa56b83..98132c9ac 100644 --- a/Minecraft.World/Blocks/TileEntities/ComparatorTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/ComparatorTileEntity.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "ComparatorTileEntity.h" diff --git a/Minecraft.World/Blocks/TileEntities/ComparatorTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/ComparatorTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/ComparatorTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/ComparatorTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/DaylightDetectorTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/DaylightDetectorTileEntity.cpp similarity index 84% rename from Minecraft.World/Blocks/TileEntities/DaylightDetectorTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/DaylightDetectorTileEntity.cpp index 786dda13d..d52c64140 100644 --- a/Minecraft.World/Blocks/TileEntities/DaylightDetectorTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/DaylightDetectorTileEntity.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" #include "DaylightDetectorTileEntity.h" DaylightDetectorTileEntity::DaylightDetectorTileEntity() {} diff --git a/Minecraft.World/Blocks/TileEntities/DaylightDetectorTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/DaylightDetectorTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/DaylightDetectorTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/DaylightDetectorTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp similarity index 94% rename from Minecraft.World/Blocks/TileEntities/DispenserTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp index 57052df4d..3e4ed16b9 100644 --- a/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "TileEntity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" +#include "../../net.minecraft.world.level.h" +#include "../../../entity/item/net.minecraft.world.entity.item.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" #include "DispenserTileEntity.h" DispenserTileEntity::DispenserTileEntity() : TileEntity() { diff --git a/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h similarity index 94% rename from Minecraft.World/Blocks/TileEntities/DispenserTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h index 717f808b9..e09d0bd6a 100644 --- a/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h @@ -1,8 +1,8 @@ #pragma once -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "TileEntity.h" -#include "../../Containers/Container.h" +#include "../../../Container.h" class Player; class Random; diff --git a/Minecraft.World/Blocks/TileEntities/DropperTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/DropperTileEntity.cpp similarity index 89% rename from Minecraft.World/Blocks/TileEntities/DropperTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/DropperTileEntity.cpp index 89e6c04dc..9a09f0cb9 100644 --- a/Minecraft.World/Blocks/TileEntities/DropperTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/DropperTileEntity.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "DropperTileEntity.h" diff --git a/Minecraft.World/Blocks/TileEntities/DropperTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/DropperTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/DropperTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/DropperTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/EnchantmentTableTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp similarity index 94% rename from Minecraft.World/Blocks/TileEntities/EnchantmentTableTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp index 75407395e..d8bd9d74a 100644 --- a/Minecraft.World/Blocks/TileEntities/EnchantmentTableTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "EnchantmentTableTileEntity.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.world.level.h" EnchantmentTableEntity::EnchantmentTableEntity() { random = new Random(); diff --git a/Minecraft.World/Blocks/TileEntities/EnchantmentTableTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/EnchantmentTableTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/EnderChestTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/EnderChestTileEntity.cpp similarity index 95% rename from Minecraft.World/Blocks/TileEntities/EnderChestTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/EnderChestTileEntity.cpp index 5a775d823..53e770018 100644 --- a/Minecraft.World/Blocks/TileEntities/EnderChestTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/EnderChestTileEntity.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" #include "EnderChestTileEntity.h" EnderChestTileEntity::EnderChestTileEntity() { diff --git a/Minecraft.World/Blocks/TileEntities/EnderChestTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/EnderChestTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/EnderChestTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/EnderChestTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp similarity index 95% rename from Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp index 56185e42a..9f615a745 100644 --- a/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp @@ -1,12 +1,12 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.item.crafting.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../Material.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../net.minecraft.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../item/crafting/net.minecraft.world.item.crafting.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" +#include "../../material/Material.h" #include "FurnaceTileEntity.h" int furnaceSlotsForUp[] = {FurnaceTileEntity::SLOT_INPUT}; diff --git a/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h similarity index 98% rename from Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h index 519357f07..9f2eb8af6 100644 --- a/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h @@ -2,7 +2,7 @@ #include "../FurnaceTile.h" #include "TileEntity.h" -#include "../../Containers/WorldlyContainer.h" +#include "../../../WorldlyContainer.h" class Player; class Level; diff --git a/Minecraft.World/Blocks/TileEntities/Hopper.h b/Minecraft.World/net/minecraft/world/level/tile/entity/Hopper.h similarity index 84% rename from Minecraft.World/Blocks/TileEntities/Hopper.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/Hopper.h index 0318a2d4f..2edd010c4 100644 --- a/Minecraft.World/Blocks/TileEntities/Hopper.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/Hopper.h @@ -1,6 +1,6 @@ #pragma once -#include "../../Containers/Container.h" +#include "../../../Container.h" class Level; diff --git a/Minecraft.World/Blocks/TileEntities/HopperTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp similarity index 96% rename from Minecraft.World/Blocks/TileEntities/HopperTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp index d12b38315..244adadf3 100644 --- a/Minecraft.World/Blocks/TileEntities/HopperTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp @@ -1,13 +1,13 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.world.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../net.minecraft.h" +#include "../../../entity/net.minecraft.world.entity.h" +#include "../../../entity/item/net.minecraft.world.entity.item.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.tile.entity.h" +#include "../../../phys/net.minecraft.world.phys.h" +#include "../../../net.minecraft.world.h" #include "HopperTileEntity.h" HopperTileEntity::HopperTileEntity() { diff --git a/Minecraft.World/Blocks/TileEntities/HopperTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/HopperTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/MobSpawnerTileEntity.cpp similarity index 91% rename from Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/MobSpawnerTileEntity.cpp index 351a2ed8b..032a49550 100644 --- a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/MobSpawnerTileEntity.cpp @@ -1,7 +1,7 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.network.packet.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../network/packet/net.minecraft.network.packet.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" #include "MobSpawnerTileEntity.h" MobSpawnerTileEntity::TileEntityMobSpawner::TileEntityMobSpawner( diff --git a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/MobSpawnerTileEntity.h similarity index 96% rename from Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/MobSpawnerTileEntity.h index 0847c1a3a..09d3af09f 100644 --- a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/MobSpawnerTileEntity.h @@ -1,7 +1,7 @@ #pragma once #include "TileEntity.h" -#include "../../Level/BaseMobSpawner.h" +#include "../../BaseMobSpawner.h" class Packet; class Entity; diff --git a/Minecraft.World/Blocks/TileEntities/MusicTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp similarity index 74% rename from Minecraft.World/Blocks/TileEntities/MusicTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp index c5fa02784..f8c2cd463 100644 --- a/Minecraft.World/Blocks/TileEntities/MusicTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp @@ -1,10 +1,10 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.material.h" -#include "../../Headers/net.minecraft.world.level.tile.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../net.minecraft.world.level.h" +#include "../../material/net.minecraft.world.level.material.h" +#include "../net.minecraft.world.level.tile.h" #include "MusicTileEntity.h" diff --git a/Minecraft.World/Blocks/TileEntities/MusicTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/MusicTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.h diff --git a/Minecraft.World/Blocks/PistonMovingTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonMovingTileEntity.cpp similarity index 96% rename from Minecraft.World/Blocks/PistonMovingTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/PistonMovingTileEntity.cpp index a104299e6..bb1904e85 100644 --- a/Minecraft.World/Blocks/PistonMovingTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonMovingTileEntity.cpp @@ -1,11 +1,11 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "PistonMovingTileEntity.h" #include -#include "TileEntities/PistonPieceTileEntity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.h" -#include "../Util/Facing.h" -#include "../Util/AABB.h" +#include "PistonPieceTileEntity.h" +#include "../../net.minecraft.world.level.h" +#include "../../../net.minecraft.world.h" +#include "../../../../Facing.h" +#include "../../../phys/AABB.h" PistonMovingPiece::PistonMovingPiece(int id) : BaseEntityTile(id, Material::piston, false) { diff --git a/Minecraft.World/Blocks/PistonMovingTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonMovingTileEntity.h similarity index 98% rename from Minecraft.World/Blocks/PistonMovingTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/PistonMovingTileEntity.h index 4b0fd1849..7a25bdd35 100644 --- a/Minecraft.World/Blocks/PistonMovingTileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonMovingTileEntity.h @@ -1,5 +1,5 @@ #pragma once -#include "BaseEntityTile.h" +#include "../BaseEntityTile.h" class PistonPieceEntity; diff --git a/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp similarity index 94% rename from Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp index 6862471b6..8b0dc4037 100644 --- a/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp @@ -1,11 +1,11 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" #include "PistonPieceTileEntity.h" -#include "../PistonMovingTileEntity.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Util/Facing.h" +#include "PistonMovingTileEntity.h" +#include "../../net.minecraft.world.level.h" +#include "../../../../Facing.h" #include "../Tile.h" -#include "../../Util/AABB.h" +#include "../../../phys/AABB.h" PistonPieceEntity::PistonPieceEntity() { // for the tile entity loader diff --git a/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp similarity index 87% rename from Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp index d8d578aa5..d97921c1c 100644 --- a/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp @@ -1,18 +1,18 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.entity.item.h" -#include "../../Headers/net.minecraft.world.entity.player.h" -#include "../../Headers/net.minecraft.world.item.h" -#include "../../Headers/net.minecraft.world.entity.h" -#include "../../Headers/net.minecraft.world.phys.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../net.minecraft.world.level.h" +#include "../../../entity/item/net.minecraft.world.entity.item.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../item/net.minecraft.world.item.h" +#include "../../../entity/net.minecraft.world.entity.h" +#include "../../../phys/net.minecraft.world.phys.h" +#include "../../../../network/packet/net.minecraft.network.packet.h" #include "SignTileEntity.h" #include -#include "../../../Minecraft.Client/Network/ClientConnection.h" -#include "../../../Minecraft.Client/Minecraft.h" -#include "../../../Minecraft.Client/Level/ServerLevel.h" -#include "../../Level/Level.h" +#include "../../../Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.h" +#include "../../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../../Minecraft.Client/net/minecraft/server/level/ServerLevel.h" +#include "../../Level.h" const int SignTileEntity::MAX_LINE_LENGTH = 15; diff --git a/Minecraft.World/Blocks/TileEntities/SignTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/SignTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp similarity index 89% rename from Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp index d555b88d8..1b8be9e21 100644 --- a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp @@ -1,6 +1,6 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/com.mojang.nbt.h" -#include "../../Headers/net.minecraft.network.packet.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "../../../../network/packet/net.minecraft.network.packet.h" #include "SkullTileEntity.h" SkullTileEntity::SkullTileEntity() { diff --git a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/SkullTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.h diff --git a/Minecraft.World/Blocks/TheEndPortalTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp similarity index 88% rename from Minecraft.World/Blocks/TheEndPortalTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp index f83226946..82df7f7ed 100644 --- a/Minecraft.World/Blocks/TheEndPortalTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp @@ -1,12 +1,12 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "TheEndPortalTile.h" -#include "TileEntities/TheEndPortalTileEntity.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../Headers/net.minecraft.world.level.dimension.h" -#include "../Headers/net.minecraft.world.level.storage.h" -#include "../Headers/net.minecraft.world.entity.h" -#include "../Headers/net.minecraft.world.entity.player.h" -#include "../Headers/net.minecraft.world.h" +#include "TheEndPortalTileEntity.h" +#include "../../net.minecraft.world.level.h" +#include "../../dimension/net.minecraft.world.level.dimension.h" +#include "../../storage/net.minecraft.world.level.storage.h" +#include "../../../entity/net.minecraft.world.entity.h" +#include "../../../entity/player/net.minecraft.world.entity.player.h" +#include "../../../net.minecraft.world.h" #include thread_local bool TheEndPortal::m_tlsAllowAnywhere = false; diff --git a/Minecraft.World/Blocks/TheEndPortalTile.h b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h similarity index 95% rename from Minecraft.World/Blocks/TheEndPortalTile.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h index 2cd4e99e7..a413f5ca2 100644 --- a/Minecraft.World/Blocks/TheEndPortalTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h @@ -1,6 +1,6 @@ #pragma once -#include "TileEntities/EntityTile.h" -#include "BaseEntityTile.h" +#include "../EntityTile.h" +#include "../BaseEntityTile.h" #include class IconRegister; diff --git a/Minecraft.World/Blocks/TileEntities/TheEndPortalTileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTileEntity.cpp similarity index 85% rename from Minecraft.World/Blocks/TileEntities/TheEndPortalTileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTileEntity.cpp index 6a2376cbb..43d1306e1 100644 --- a/Minecraft.World/Blocks/TileEntities/TheEndPortalTileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTileEntity.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "TheEndPortalTileEntity.h" // 4J Added diff --git a/Minecraft.World/Blocks/TileEntities/TheEndPortalTileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTileEntity.h similarity index 100% rename from Minecraft.World/Blocks/TileEntities/TheEndPortalTileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTileEntity.h diff --git a/Minecraft.World/Blocks/TileEntities/TileEntity.cpp b/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.cpp similarity index 96% rename from Minecraft.World/Blocks/TileEntities/TileEntity.cpp rename to Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.cpp index b3f134c50..836f5c613 100644 --- a/Minecraft.World/Blocks/TileEntities/TileEntity.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.cpp @@ -1,8 +1,8 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.network.packet.h" -#include "../../Headers/net.minecraft.world.level.h" -#include "../../Headers/net.minecraft.world.level.tile.h" -#include "../../Headers/net.minecraft.world.level.tile.entity.h" +#include "../../../../../../Header Files/stdafx.h" +#include "../../../../network/packet/net.minecraft.network.packet.h" +#include "../../net.minecraft.world.level.h" +#include "../net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.tile.entity.h" #include "TileEntity.h" #include "PistonPieceTileEntity.h" diff --git a/Minecraft.World/Blocks/TileEntities/TileEntity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h similarity index 95% rename from Minecraft.World/Blocks/TileEntities/TileEntity.h rename to Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h index fc382b673..ade37c7b2 100644 --- a/Minecraft.World/Blocks/TileEntities/TileEntity.h +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h @@ -1,7 +1,7 @@ #pragma once -#include "../../Util/HashExtension.h" -#include "../../Util/JavaIntHash.h" +#include "../../../../../../ConsoleHelpers/HashExtension.h" +#include "../../../../../../ConsoleJavaLibs/JavaIntHash.h" class Level; class Packet; diff --git a/Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h b/Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h new file mode 100644 index 000000000..b123f7d82 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h @@ -0,0 +1,22 @@ +#pragma once + +#include "BeaconTileEntity.h" +#include "BrewingStandTileEntity.h" +#include "ChestTileEntity.h" +#include "CommandBlockEntity.h" +#include "ComparatorTileEntity.h" +#include "DaylightDetectorTileEntity.h" +#include "DispenserTileEntity.h" +#include "DropperTileEntity.h" +#include "EnchantmentTableTileEntity.h" +#include "FurnaceTileEntity.h" +#include "Hopper.h" +#include "HopperTileEntity.h" +#include "MobSpawnerTileEntity.h" +#include "MusicTileEntity.h" +#include "SignTileEntity.h" +#include "TileEntity.h" +#include "PistonMovingTileEntity.h" +#include "TheEndPortalTileEntity.h" +#include "SkullTileEntity.h" +#include "EnderChestTileEntity.h" diff --git a/Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h b/Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h new file mode 100644 index 000000000..0c0859d25 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h @@ -0,0 +1,131 @@ +#pragma once + +#include "Tile.h" +#include "AirTile.h" +#include "AnvilTile.h" +#include "BaseEntityTile.h" +#include "BasePressurePlateTile.h" +#include "BaseRailTile.h" +#include "BeaconTile.h" +#include "BedTile.h" +#include "BookshelfTile.h" +#include "BrewingStandTile.h" +#include "PlantTile.h" +#include "ButtonTile.h" +#include "CactusTile.h" +#include "CakeTile.h" +#include "CarrotTile.h" +#include "CauldronTile.h" +#include "ChestTile.h" +#include "ClayTile.h" +#include "CocoaTile.h" +#include "ColoredTile.h" +#include "CommandBlock.h" +#include "ComparatorTile.h" +#include "CoralTile.h" +#include "CropTile.h" +#include "DaylightDetectorTile.h" +#include "DeadBushTile.h" +#include "DetectorRailTile.h" +#include "DiodeTile.h" +#include "DirectionalTile.h" +#include "DirtTile.h" +#include "DispenserTile.h" +#include "DoorTile.h" +#include "DropperTile.h" +#include "EggTile.h" +#include "EnchantmentTableTile.h" +#include "EnderChestTile.h" +#include "EntityTile.h" +#include "FarmTile.h" +#include "FenceGateTile.h" +#include "FenceTile.h" +#include "FireTile.h" +#include "FlowerPotTile.h" +#include "FurnaceTile.h" +#include "GlassTile.h" +#include "GlowstoneTile.h" +#include "GrassTile.h" +#include "GravelTile.h" +#include "HalfSlabTile.h" +#include "HalfTransparentTile.h" +#include "HayBlockTile.h" +#include "HeavyTile.h" +#include "HopperTile.h" +#include "HugeMushroomTile.h" +#include "IceTile.h" +#include "JukeboxTile.h" +#include "LadderTile.h" +#include "LeafTile.h" +#include "LevelEvent.h" +#include "LeverTile.h" +#include "LiquidTile.h" +#include "LiquidTileDynamic.h" +#include "LiquidTileStatic.h" +#include "LockedChestTile.h" +#include "MelonTile.h" +#include "MetalTile.h" +#include "MobSpawnerTile.h" +#include "MushroomPlantTile.h" +#include "NoteBlockTile.h" +#include "MycelTile.h" +#include "NetherrackTile.h" +#include "NetherWartTile.h" +#include "NotGateTile.h" +#include "ObsidianTile.h" +#include "OreTile.h" +#include "piston/PistonBaseTile.h" +#include "piston/PistonExtensionTile.h" +#include "PortalTile.h" +#include "PotatoTile.h" +#include "PoweredMetalTile.h" +#include "PoweredRailTile.h" +#include "PressurePlateTile.h" +#include "PumpkinTile.h" +#include "QuartzBlockTile.h" +#include "RailTile.h" +#include "RedlightTile.h" +#include "RedStoneDustTile.h" +#include "RedStoneOreTile.h" +#include "ReedTile.h" +#include "RepeaterTile.h" +#include "RotatedPillarTile.h" +#include "SandStoneTile.h" +#include "SaplingPlantTile.h" +#include "SignTile.h" +#include "SkullTile.h" +#include "SmoothStoneBrickTile.h" +#include "SnowTile.h" +#include "SoulSandTile.h" +#include "SpongeTile.h" +#include "StainedGlassBlock.h" +#include "StainedGlassPaneBlock.h" +#include "StairTile.h" +#include "StemTile.h" +#include "StoneButtonTile.h" +#include "StoneMonsterTile.h" +#include "StoneSlabTile.h" +#include "StoneTile.h" +#include "TallGrassPlantTile.h" +#include "entity/TheEndPortalTile.h" +#include "TheEndPortalFrameTile.h" +#include "ThinFenceTile.h" +#include "TntTile.h" +#include "TopSnowTile.h" +#include "TorchTile.h" +#include "TransparentTile.h" +#include "TrapDoorTile.h" +#include "TreeTile.h" +#include "TripWireSourceTile.h" +#include "TripWireTile.h" +#include "VineTile.h" +#include "WallTile.h" +#include "WaterLilyTile.h" +#include "WebTile.h" +#include "WeightedPressurePlateTile.h" +#include "WoodButtonTile.h" +#include "WorkbenchTile.h" +#include "WoodTile.h" +#include "HalfSlabTile.h" +#include "WoodSlabTile.h" +#include "WoolCarpetTile.h" diff --git a/Minecraft.World/Blocks/PistonBaseTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp similarity index 97% rename from Minecraft.World/Blocks/PistonBaseTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp index d128d911c..343ebab19 100644 --- a/Minecraft.World/Blocks/PistonBaseTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp @@ -1,19 +1,19 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include #include #include "PistonBaseTile.h" -#include "PistonMovingTileEntity.h" -#include "TileEntities/PistonPieceTileEntity.h" +#include "../entity/PistonMovingTileEntity.h" +#include "../entity/PistonPieceTileEntity.h" #include "PistonExtensionTile.h" -#include "../Util/Facing.h" -#include "../Headers/net.minecraft.world.level.h" -#include "../../Minecraft.Client/Minecraft.h" -#include "../../Minecraft.Client/Level/MultiPlayerLevel.h" -#include "../Headers/net.minecraft.world.h" -#include "../Level/LevelChunk.h" -#include "../Level/Dimensions/Dimension.h" +#include "../../../../Facing.h" +#include "../../net.minecraft.world.level.h" +#include "../../Minecraft.Client/net/minecraft/client/Minecraft.h" +#include "../../Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h" +#include "../../../net.minecraft.world.h" +#include "../../chunk/LevelChunk.h" +#include "../../dimension/Dimension.h" -#include "Util/AABB.h" +#include "../../../phys/AABB.h" const std::wstring PistonBaseTile::EDGE_TEX = L"piston_side"; const std::wstring PistonBaseTile::PLATFORM_TEX = L"piston_top"; diff --git a/Minecraft.World/Blocks/PistonBaseTile.h b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h similarity index 99% rename from Minecraft.World/Blocks/PistonBaseTile.h rename to Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h index 36097aacf..80c71ce71 100644 --- a/Minecraft.World/Blocks/PistonBaseTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h @@ -1,5 +1,5 @@ #pragma once -#include "Tile.h" +#include "../Tile.h" #include #include diff --git a/Minecraft.World/Blocks/PistonExtensionTile.cpp b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp similarity index 98% rename from Minecraft.World/Blocks/PistonExtensionTile.cpp rename to Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp index 3658c575a..837bc692c 100644 --- a/Minecraft.World/Blocks/PistonExtensionTile.cpp +++ b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp @@ -1,8 +1,8 @@ -#include "../Platform/stdafx.h" +#include "../../../../../../Header Files/stdafx.h" #include "PistonExtensionTile.h" #include "PistonBaseTile.h" -#include "../Util/Facing.h" -#include "../Headers/net.minecraft.world.level.h" +#include "../../../../Facing.h" +#include "../../net.minecraft.world.level.h" PistonExtensionTile::PistonExtensionTile(int id) : Tile(id, Material::piston, false) { diff --git a/Minecraft.World/Blocks/PistonExtensionTile.h b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h similarity index 98% rename from Minecraft.World/Blocks/PistonExtensionTile.h rename to Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h index f38d101ce..f2f64e336 100644 --- a/Minecraft.World/Blocks/PistonExtensionTile.h +++ b/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h @@ -1,5 +1,5 @@ #pragma once -#include "Tile.h" +#include "../Tile.h" class PistonExtensionTile : public Tile { public: diff --git a/Minecraft.World/net/minecraft/world/level/tile/piston/net.minecraft.world.level.tile.piston.h b/Minecraft.World/net/minecraft/world/level/tile/piston/net.minecraft.world.level.tile.piston.h new file mode 100644 index 000000000..478ddc456 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/level/tile/piston/net.minecraft.world.level.tile.piston.h @@ -0,0 +1,6 @@ +#pragma once + +#include "PistonBaseTile.h" +#include "PistonExtensionTile.h" +#include "../entity/PistonMovingTileEntity.h" +#include "../entity/PistonPieceTileEntity.h" \ No newline at end of file diff --git a/Minecraft.World/Headers/net.minecraft.world.ContainerListener.h b/Minecraft.World/net/minecraft/world/net.minecraft.world.ContainerListener.h similarity index 100% rename from Minecraft.World/Headers/net.minecraft.world.ContainerListener.h rename to Minecraft.World/net/minecraft/world/net.minecraft.world.ContainerListener.h diff --git a/Minecraft.World/net/minecraft/world/net.minecraft.world.h b/Minecraft.World/net/minecraft/world/net.minecraft.world.h new file mode 100644 index 000000000..8b4f3e34e --- /dev/null +++ b/Minecraft.World/net/minecraft/world/net.minecraft.world.h @@ -0,0 +1,15 @@ +#pragma once + +#include "CompoundContainer.h" +#include "Container.h" +#include "Difficulty.h" +#include "MouseInventoryClickHandler.h" +#include "net.minecraft.world.ContainerListener.h" +#include "SimpleContainer.h" + +// TU10 +#include "Icon.h" +#include "IconRegister.h" +#include "FlippedIcon.h" + +#include "WorldlyContainer.h" \ No newline at end of file diff --git a/Minecraft.World/Util/AABB.cpp b/Minecraft.World/net/minecraft/world/phys/AABB.cpp similarity index 99% rename from Minecraft.World/Util/AABB.cpp rename to Minecraft.World/net/minecraft/world/phys/AABB.cpp index c9a58d1bb..ea2e44acd 100644 --- a/Minecraft.World/Util/AABB.cpp +++ b/Minecraft.World/net/minecraft/world/phys/AABB.cpp @@ -5,12 +5,12 @@ // TODO: use brace initialization everywhere -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "AABB.h" #include #include #include "HitResult.h" -#include "Util/Vec3.h" +#include "Vec3.h" AABB::AABB(double x0, double y0, double z0, double x1, double y1, double z1) { this->x0 = x0; diff --git a/Minecraft.World/Util/AABB.h b/Minecraft.World/net/minecraft/world/phys/AABB.h similarity index 95% rename from Minecraft.World/Util/AABB.h rename to Minecraft.World/net/minecraft/world/phys/AABB.h index 83c32519a..e148367f2 100644 --- a/Minecraft.World/Util/AABB.h +++ b/Minecraft.World/net/minecraft/world/phys/AABB.h @@ -1,7 +1,7 @@ #pragma once #include "Vec3.h" -#include "Definitions.h" +#include "../../../../ConsoleHelpers/Definitions.h" class HitResult; diff --git a/Minecraft.World/Util/HitResult.cpp b/Minecraft.World/net/minecraft/world/phys/HitResult.cpp similarity index 86% rename from Minecraft.World/Util/HitResult.cpp rename to Minecraft.World/net/minecraft/world/phys/HitResult.cpp index e6f49dbac..503fb05a6 100644 --- a/Minecraft.World/Util/HitResult.cpp +++ b/Minecraft.World/net/minecraft/world/phys/HitResult.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" -#include "../Headers/net.minecraft.world.entity.h" +#include "../entity/net.minecraft.world.entity.h" #include "HitResult.h" HitResult::HitResult(int x, int y, int z, int f, const Vec3& pos) { diff --git a/Minecraft.World/Util/HitResult.h b/Minecraft.World/net/minecraft/world/phys/HitResult.h similarity index 100% rename from Minecraft.World/Util/HitResult.h rename to Minecraft.World/net/minecraft/world/phys/HitResult.h diff --git a/Minecraft.World/Util/Vec3.cpp b/Minecraft.World/net/minecraft/world/phys/Vec3.cpp similarity index 100% rename from Minecraft.World/Util/Vec3.cpp rename to Minecraft.World/net/minecraft/world/phys/Vec3.cpp diff --git a/Minecraft.World/Util/Vec3.h b/Minecraft.World/net/minecraft/world/phys/Vec3.h similarity index 100% rename from Minecraft.World/Util/Vec3.h rename to Minecraft.World/net/minecraft/world/phys/Vec3.h diff --git a/Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h b/Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h new file mode 100644 index 000000000..87f5bf980 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h @@ -0,0 +1,4 @@ +#pragma once +#include "AABB.h" +#include "HitResult.h" +#include "Vec3.h" \ No newline at end of file diff --git a/Minecraft.World/Scores/Objective.cpp b/Minecraft.World/net/minecraft/world/scores/Objective.cpp similarity index 88% rename from Minecraft.World/Scores/Objective.cpp rename to Minecraft.World/net/minecraft/world/scores/Objective.cpp index f67bc33a7..d784e7c71 100644 --- a/Minecraft.World/Scores/Objective.cpp +++ b/Minecraft.World/net/minecraft/world/scores/Objective.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.scores.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.scores.h" #include "Objective.h" Objective::Objective(Scoreboard* scoreboard, const std::wstring& name, diff --git a/Minecraft.World/Scores/Objective.h b/Minecraft.World/net/minecraft/world/scores/Objective.h similarity index 100% rename from Minecraft.World/Scores/Objective.h rename to Minecraft.World/net/minecraft/world/scores/Objective.h diff --git a/Minecraft.World/Scores/PlayerTeam.cpp b/Minecraft.World/net/minecraft/world/scores/PlayerTeam.cpp similarity index 96% rename from Minecraft.World/Scores/PlayerTeam.cpp rename to Minecraft.World/net/minecraft/world/scores/PlayerTeam.cpp index 553be6bfa..8df62ae3b 100644 --- a/Minecraft.World/Scores/PlayerTeam.cpp +++ b/Minecraft.World/net/minecraft/world/scores/PlayerTeam.cpp @@ -1,5 +1,5 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.scores.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.scores.h" #include "PlayerTeam.h" PlayerTeam::PlayerTeam(Scoreboard* scoreboard, const std::wstring& name) { diff --git a/Minecraft.World/Scores/PlayerTeam.h b/Minecraft.World/net/minecraft/world/scores/PlayerTeam.h similarity index 100% rename from Minecraft.World/Scores/PlayerTeam.h rename to Minecraft.World/net/minecraft/world/scores/PlayerTeam.h diff --git a/Minecraft.World/Scores/Score.cpp b/Minecraft.World/net/minecraft/world/scores/Score.cpp similarity index 90% rename from Minecraft.World/Scores/Score.cpp rename to Minecraft.World/net/minecraft/world/scores/Score.cpp index e49114084..a13f39cd9 100644 --- a/Minecraft.World/Scores/Score.cpp +++ b/Minecraft.World/net/minecraft/world/scores/Score.cpp @@ -1,6 +1,6 @@ -#include "../Platform/stdafx.h" -#include "../Headers/net.minecraft.world.scores.h" -#include "../Headers/net.minecraft.world.scores.criteria.h" +#include "../../../../Header Files/stdafx.h" +#include "net.minecraft.world.scores.h" +#include "criteria/net.minecraft.world.scores.criteria.h" #include "Score.h" Score::Score(Scoreboard* scoreboard, Objective* objective, diff --git a/Minecraft.World/Scores/Score.h b/Minecraft.World/net/minecraft/world/scores/Score.h similarity index 100% rename from Minecraft.World/Scores/Score.h rename to Minecraft.World/net/minecraft/world/scores/Score.h diff --git a/Minecraft.World/Scores/ScoreHolder.h b/Minecraft.World/net/minecraft/world/scores/ScoreHolder.h similarity index 100% rename from Minecraft.World/Scores/ScoreHolder.h rename to Minecraft.World/net/minecraft/world/scores/ScoreHolder.h diff --git a/Minecraft.World/Scores/Scoreboard.cpp b/Minecraft.World/net/minecraft/world/scores/Scoreboard.cpp similarity index 99% rename from Minecraft.World/Scores/Scoreboard.cpp rename to Minecraft.World/net/minecraft/world/scores/Scoreboard.cpp index b79245b5c..1a29b1a83 100644 --- a/Minecraft.World/Scores/Scoreboard.cpp +++ b/Minecraft.World/net/minecraft/world/scores/Scoreboard.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "Scoreboard.h" diff --git a/Minecraft.World/Scores/Scoreboard.h b/Minecraft.World/net/minecraft/world/scores/Scoreboard.h similarity index 100% rename from Minecraft.World/Scores/Scoreboard.h rename to Minecraft.World/net/minecraft/world/scores/Scoreboard.h diff --git a/Minecraft.World/Scores/ScoreboardSaveData.h b/Minecraft.World/net/minecraft/world/scores/ScoreboardSaveData.h similarity index 100% rename from Minecraft.World/Scores/ScoreboardSaveData.h rename to Minecraft.World/net/minecraft/world/scores/ScoreboardSaveData.h diff --git a/Minecraft.World/Scores/Team.cpp b/Minecraft.World/net/minecraft/world/scores/Team.cpp similarity index 80% rename from Minecraft.World/Scores/Team.cpp rename to Minecraft.World/net/minecraft/world/scores/Team.cpp index eaec14ae3..71b3e590b 100644 --- a/Minecraft.World/Scores/Team.cpp +++ b/Minecraft.World/net/minecraft/world/scores/Team.cpp @@ -1,4 +1,4 @@ -#include "../Platform/stdafx.h" +#include "../../../../Header Files/stdafx.h" #include "Team.h" diff --git a/Minecraft.World/Scores/Team.h b/Minecraft.World/net/minecraft/world/scores/Team.h similarity index 100% rename from Minecraft.World/Scores/Team.h rename to Minecraft.World/net/minecraft/world/scores/Team.h diff --git a/Minecraft.World/Scores/Criteria/DummyCriteria.cpp b/Minecraft.World/net/minecraft/world/scores/criteria/DummyCriteria.cpp similarity index 88% rename from Minecraft.World/Scores/Criteria/DummyCriteria.cpp rename to Minecraft.World/net/minecraft/world/scores/criteria/DummyCriteria.cpp index ed458b9c1..464c076f5 100644 --- a/Minecraft.World/Scores/Criteria/DummyCriteria.cpp +++ b/Minecraft.World/net/minecraft/world/scores/criteria/DummyCriteria.cpp @@ -1,4 +1,4 @@ -#include "../../Platform/stdafx.h" +#include "../../../../../Header Files/stdafx.h" #include "DummyCriteria.h" diff --git a/Minecraft.World/Scores/Criteria/DummyCriteria.h b/Minecraft.World/net/minecraft/world/scores/criteria/DummyCriteria.h similarity index 100% rename from Minecraft.World/Scores/Criteria/DummyCriteria.h rename to Minecraft.World/net/minecraft/world/scores/criteria/DummyCriteria.h diff --git a/Minecraft.World/Scores/Criteria/HealthCriteria.cpp b/Minecraft.World/net/minecraft/world/scores/criteria/HealthCriteria.cpp similarity index 82% rename from Minecraft.World/Scores/Criteria/HealthCriteria.cpp rename to Minecraft.World/net/minecraft/world/scores/criteria/HealthCriteria.cpp index e8791fd30..bfb427622 100644 --- a/Minecraft.World/Scores/Criteria/HealthCriteria.cpp +++ b/Minecraft.World/net/minecraft/world/scores/criteria/HealthCriteria.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.entity.player.h" +#include "../../../../../Header Files/stdafx.h" +#include "../../entity/player/net.minecraft.world.entity.player.h" #include "HealthCriteria.h" HealthCriteria::HealthCriteria(const std::wstring& id) : DummyCriteria(id) {} diff --git a/Minecraft.World/Scores/Criteria/HealthCriteria.h b/Minecraft.World/net/minecraft/world/scores/criteria/HealthCriteria.h similarity index 100% rename from Minecraft.World/Scores/Criteria/HealthCriteria.h rename to Minecraft.World/net/minecraft/world/scores/criteria/HealthCriteria.h diff --git a/Minecraft.World/Scores/Criteria/ObjectiveCriteria.cpp b/Minecraft.World/net/minecraft/world/scores/criteria/ObjectiveCriteria.cpp similarity index 85% rename from Minecraft.World/Scores/Criteria/ObjectiveCriteria.cpp rename to Minecraft.World/net/minecraft/world/scores/criteria/ObjectiveCriteria.cpp index 3083fa2da..79cbdac23 100644 --- a/Minecraft.World/Scores/Criteria/ObjectiveCriteria.cpp +++ b/Minecraft.World/net/minecraft/world/scores/criteria/ObjectiveCriteria.cpp @@ -1,5 +1,5 @@ -#include "../../Platform/stdafx.h" -#include "../../Headers/net.minecraft.world.scores.criteria.h" +#include "../../../../../Header Files/stdafx.h" +#include "net.minecraft.world.scores.criteria.h" #include "ObjectiveCriteria.h" std::unordered_map diff --git a/Minecraft.World/Scores/Criteria/ObjectiveCriteria.h b/Minecraft.World/net/minecraft/world/scores/criteria/ObjectiveCriteria.h similarity index 100% rename from Minecraft.World/Scores/Criteria/ObjectiveCriteria.h rename to Minecraft.World/net/minecraft/world/scores/criteria/ObjectiveCriteria.h diff --git a/Minecraft.World/net/minecraft/world/scores/criteria/net.minecraft.world.scores.criteria.h b/Minecraft.World/net/minecraft/world/scores/criteria/net.minecraft.world.scores.criteria.h new file mode 100644 index 000000000..fd8c86400 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/scores/criteria/net.minecraft.world.scores.criteria.h @@ -0,0 +1,5 @@ +#pragma once + +#include "DummyCriteria.h" +#include "HealthCriteria.h" +#include "ObjectiveCriteria.h" \ No newline at end of file diff --git a/Minecraft.World/net/minecraft/world/scores/net.minecraft.world.scores.h b/Minecraft.World/net/minecraft/world/scores/net.minecraft.world.scores.h new file mode 100644 index 000000000..0dccff460 --- /dev/null +++ b/Minecraft.World/net/minecraft/world/scores/net.minecraft.world.scores.h @@ -0,0 +1,9 @@ +#pragma once + +#include "Objective.h" +#include "PlayerTeam.h" +#include "Score.h" +#include "Scoreboard.h" +#include "ScoreboardSaveData.h" +#include "ScoreHolder.h" +#include "Team.h" \ No newline at end of file diff --git a/Minecraft.World/Platform/x64headers/extraX64.h b/Minecraft.World/x64headers/extraX64.h similarity index 99% rename from Minecraft.World/Platform/x64headers/extraX64.h rename to Minecraft.World/x64headers/extraX64.h index efc640224..6a8d5cef3 100644 --- a/Minecraft.World/Platform/x64headers/extraX64.h +++ b/Minecraft.World/x64headers/extraX64.h @@ -8,7 +8,7 @@ #include #include "../../../4J.Common/4J_Compat.h" -#include "../../../Minecraft.Client/Rendering/Models/SkinBox.h" +#include "../../../Minecraft.Client/Header Files/SkinBox.h" #include diff --git a/Minecraft.World/Platform/x64headers/qnet.h b/Minecraft.World/x64headers/qnet.h similarity index 100% rename from Minecraft.World/Platform/x64headers/qnet.h rename to Minecraft.World/x64headers/qnet.h diff --git a/Minecraft.World/Platform/x64headers/xmcore.h b/Minecraft.World/x64headers/xmcore.h similarity index 100% rename from Minecraft.World/Platform/x64headers/xmcore.h rename to Minecraft.World/x64headers/xmcore.h diff --git a/Minecraft.World/Platform/x64headers/xrnm.h b/Minecraft.World/x64headers/xrnm.h similarity index 100% rename from Minecraft.World/Platform/x64headers/xrnm.h rename to Minecraft.World/x64headers/xrnm.h diff --git a/Minecraft.World/Platform/x64headers/xsocialpost.h b/Minecraft.World/x64headers/xsocialpost.h similarity index 100% rename from Minecraft.World/Platform/x64headers/xsocialpost.h rename to Minecraft.World/x64headers/xsocialpost.h diff --git a/Minecraft.World/Platform/x64headers/xuiapp.h b/Minecraft.World/x64headers/xuiapp.h similarity index 100% rename from Minecraft.World/Platform/x64headers/xuiapp.h rename to Minecraft.World/x64headers/xuiapp.h diff --git a/Minecraft.World/Platform/x64headers/xuiresource.h b/Minecraft.World/x64headers/xuiresource.h similarity index 100% rename from Minecraft.World/Platform/x64headers/xuiresource.h rename to Minecraft.World/x64headers/xuiresource.h